There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

Create or update a contact

Last updated May 12, 2023

POST /contacts/v1/contact/createOrUpdate/email/:contact_email

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing & CRM

Required Scope:

crm.objects.contacts.write

The create or update a contact endpoint is used to create a new HubSpot contact or update an existing one. 

Use case for this endpoint: This method is useful when syncing changes to contacts in other CRMs with your HubSpot contacts.

Response details

If successful, the returned data will include the unique identifier (visitor ID, or vid) of the contact and the request type (create or update).

  • Returns a 200 response on success. The response will contain a vid of the updated or created record, and an isNew field that indicates if a new record was created. If the field is false, an existing record was updated.
  • Return a 409 Conflict error response if you are trying to update the email address of a record, and there is an existing record with the new email address.

Need to create or update a large number of contacts? Try the Batch API.

Required parameters How to use Description
OAuth access token or private app access token Authorization: Bearer {token} header Used to authenticate the request. Please see this page for more details about authentication.
Contact JSON Used in the request body This is JSON that represents a contact that you're creating. This should be of the format seen below in the code sample given.

Example URL to POST to:  https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/test@hubspot.com/