Update an existing contact

Last updated June 17, 2020

POST /contacts/v1/contact/vid/:vid/profile

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

N/A

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing & CRM

Required Scope:

contacts

This endpoint is used to update an existing contact in HubSpot. It only updates the properties specified in the request.

Use case for this endpoint: Let's say you've been updating contact records in an external database and now you want to sync those updates to HubSpot. You can use the update an existing contact endpoint to complete the sync and avoid making manual updates.

Example URL to POST to: https://api.hubapi.com/contacts/v1/contact/vid/2340324/profile?hapikey=demo 

Property updates

To update a contact, make an HTTP POST call to this endpoint. The request should specify the relevant contact properties. (See the sample JSON to the right.)

If a property doesn't exist yet, you can create a new custom property through the API using the create property method.

For more information about notable contact properties, see the notes below the required parameters table.

Response details

  • Returns a 204 with no response body when a contact is updated successfully.
  • Returns a 400 if there is a problem with the data in the request body. You'll get a message in the response body with more details.
  • Returns a 401 when an unauthorized request is made, such as an expired access token or wrong API key.
  • Returns a 404 when there is no existing contact with the specified vid (visitor ID).
  • Returns a 500 when an internal server error occurs. Please alert us in the developer forum if this happens.

Required parameters How to use Description
OAuth Access Token or API Key Authorization: Bearer {token} header
or hapikey={key} query parameter.
Used to authenticate the request. Please see this page for more details about authentication.
Contact VID Used in the request URL The VID of the specific contact you want to update.
Contact JSON Used in the request body This is JSON that represents a contact that you're updating. This should be of the format seen below in the code sample given. Properties can have an optional timestamp indicating when the property was set (this will be the current time if not specified).

There are some properties that are worth noting in terms of updating a contact:

  • Lifecycle stage - This property denotes the stage at which the contact is in. Stages include 'subscriber', 'lead', 'marketingqualifiedlead', 'salesqualifiedlead', 'opportunity' and 'customer'. These values are described in HubSpot's Contacts application under "Contacts > Manage Settings > Lifecycle Stages". Once a contact does become a "customer", it will be reflected in HubSpot's Sources application as such.
  • Please Note The Lifecycle stage is not designed to move backwards. If you need to set this property to a previous stage, you will first need to set the value to "" (an empty string) and then set the new Stage
  • HubSpot Score - This property cannot be updated through the API.

These code samples use a demo API key. Using this key for anything but GET requests will result in an error. For all other requests (such as POST or PUT), you'll need to use your own API key or OAuth. For more details, please see here