Forms V3 API - update form definition error

Hello,

I am working from an Enterprise portal.

I have a form that I want to update, I could use partially or complete but same error for both.

The purpose of editing the definition is because the text I want to be on the form needs to be different each time I send the form out. This text is stored outside of HubSpot and so an API call to edit the form text is required.

I am using:

For:

Update a form definition
Update all fields of a hubspot form definition.

PUT /marketing/v3/forms/{formId}

And:

Partially update a form definition
Update some of the form definition components

PATCH /marketing/v3/forms/{formId}

Error is:

{
“status”: “error”,
“message”: “internal error”,
“correlationId”: “b55b0db1-19e1-4e5d-9784-98782efea8aa”,
“category”: “VALIDATION_ERROR”
}

I have included the id of the form in the request and the URL. I have tried to remove elements like layout and design, recapta (which was set to false anyway), lifecycle stages and checking the name and date for updateAt and createdAt were correct.

I have multiple of the same error, different correlationId.

I have checked the submission fields contain fields that exist and the dropdown choices exist.

I designed the JSON output from using the example provided, it is valid JSON.

EDIT:

Plus I used the GET form definition for the form after I designed it on the front-end. From there I used the JSON response of the definition to ensure I had the correct results.

Here are more correlation ids which will show the request body

6cc007f5-ecd4-44c3-aaeb-6e6cf0c07724

28d177d6-efc9-4fa5-af2b-26b16b541d06

Hey, @EIbbetson :waving_hand: did you get this resolved? If not, I have a troubleshooting suggestion.

Have you tried logging out your errors more robustly? With something like:

try {
 const response = await axios.put(url, formData, config);
 console.log('Form updated successfully:', response.data);
 } catch (error) {
 if (error.response) {
 // A non 2xx status code
 console.error('API responded with an error:', error.response.status, error.response.data);
 } else if (error.request) {
 // No response was received
 console.error('No response received:', error.request);
 } else {
 // Something happened
 console.error('Error setting up the request:', error.message);
 }
 }

Talk soon! — Jaycee

I am using postman to test the json body I am using is working so I haven’t got a script.