APIs & Integrations

Developez
Member

Can't Add Contact to List Using API

I’m trying to use the Hubspot API to add a contact to a list. Here’s the URL:

https://api.hubapi.com/contacts/v1/lists/1332/add?hapikey=

Here’s the body example of the HTTP POST:

{
“emails”: [
"email@test.com"
]

}

I get an HTTP/1.1 200 OK and body response is empty. I check the list on Hubspot but don’t see the contact added. This is a static list. Does anyone have any ideas? Thanks.

0 Upvotes
2 Replies 2
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Can't Add Contact to List Using API

Hi @developez,

The response body should contain a JSON object with the results of your request. Can you send me a link to the static list in your HubSpot portal?

0 Upvotes
Developez
Member

Can't Add Contact to List Using API

Hi Derek

I have solved the problem by adding in the header of the request

‘Content-type’: ‘application/json’

Thanks :slight_smile: