Hi there, Im getting an error when trying to add a contact to a static list in hubspot through the HTTP action. In postman it works but not in Clay. I get this error on the "Add to list" column in this table: "Invalid input JSON on line 1, column 2: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)" Hubspot docs: https://developers.hubspot.com/docs/api-reference/crm-lists-v3/memberships/put-crm-v3-lists-listId-memberships-add
This JSON error typically occurs when there's a formatting issue with your request body. The error suggests that the API expects a string value but is receiving an object instead. [1]
When using dynamic variables in the HTTP API body, you must follow proper JSON formatting rules - strings need quotation marks around /column references, but numbers and booleans don't.
Could you copy and paste the JSON from your HTTP API body so I can help troubleshoot the specific formatting issue?
If you still need help resolving the JSON formatting issue with your HTTP API request, I’m here to assist. Would you like to share the exact JSON body you are using so we can troubleshoot further?
JSON body:
[
162501830242
]
The issue is with your JSON formatting. According to the HubSpot API documentation you linked, the request body should be an object with a "recordIds" array, not just a plain array. [1]
Your current JSON:
[162501830242]
Should be:
{
"recordIds": ["162501830242"]
}
Note that the contact ID should be a string (in quotes) rather than a number, as HubSpot expects string values for record IDs.
Did that answer your question?
If you still need help with the JSON formatting or adding contacts to your HubSpot list, I’m happy to assist further. Would you like to provide more details about what you’re trying to achieve or any other issues you’re encountering?