Contact records store information about individuals. The contacts endpoints allow you to manage this data and sync it between HubSpot and other systems.
POST
request to /crm/v3/objects/contacts
.
In your request, include your contact data in a properties object. You can also add an associations object to associate your new contact with existing records (e.g., companies, deals), or activities (e.g., meetings, notes).
email
, firstname
, or lastname
. It is recommended to always include email
, because email address is the primary unique identifier to avoid duplicate contacts in HubSpot.
To view all available properties, you can retrieve a list of your account’s contact properties by making a GET
request to /crm/v3/properties/contacts
. Learn more about the the properties API.
lifecyclestage
in your request, values must refer to the lifecycle stage’s internal name. The internal names of default stages are text values, and do not change even if you edit the stage’s label(e.g., subscriber
or marketingqualifiedlead
). The internal names of custom stagesare numeric values. You can find a stage’s internal ID in your lifecycle stage settings,or by retrieving the lifecycle stage property via API.Parameter | Description |
---|---|
to | The record or activity you want to associate with the contact, specified by its unique id value. |
types | The type of the association between the contact and the record/activity. Include the associationCategory and associationTypeId . Default association type IDs are listed here, or you can retrieve the value for custom association types (i.e. labels) via the associations API. |
GET
request to /crm/v3/objects/contacts/{contactId} or
/crm/v3/objects/contacts/{email}?idProperty=email
.GET
request to /crm/v3/objects/contacts
.Parameter | Description |
---|---|
properties | A comma separated list of the properties to be returned in the response. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a contact doesn’t have a value, it will be returned as null . |
propertiesWithHistory | A comma separated list of the current and historical properties to be returned in the response. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a contact doesn’t have a value, it will be returned as null . |
associations | A comma separated list of objects to retrieve associated IDs for. Any specified associations that don’t exist will not be returned in the response. Learn more about the associations API. |
POST
request to crm/v3/objects/contacts/batch/read
. The batch endpoint cannot retrieve associations. Learn how to batch read associations with the associations API.idProperty
parameter to retrieve contacts by email
or a custom unique identifier property. By default, the id
values in the request refer to the record ID (hs_object_id
), so the idProperty
parameter is not required when retrieving by record ID. If you’re using email
or a custom unique value property to retrieve contacts, you must include the idProperty
parameter.
For example, to retrieve a batch of contacts based on their record ID values, your request could look like the following (current values only, or current and historical values):
To retrieve contacts based on email address or a custom unique identifier property (e.g., a customer ID number unique for your business), your request would look like:
id
) or the contact’s email address (email
).
PATCH
request to /crm/v3/objects/contacts/{contactId}
, and include the data you want to update.PATCH
request to /crm/v3/objects/contacts/{email}?idProperty=email
, and include the data you want to update.lifecyclestage
property, you can only set the value forward in the stage order. To set the lifecycle stage backward, you’ll first need to clear the record’s existing lifecycle stage value. The value can be cleared manually, or may be automatically cleared via a workflow or an integration that syncs contact data.id
). To update multiple contacts, make a POST
request to /crm/v3/objects/contacts/batch/update
. In your request body, include each contact’s record ID as the id
and include the properties you want to update.
For example:
email
or a custom unique identifier property. Following the request, if the contacts already exist, they’ll be updated and if the contacts don’t exist, they’ll be created.
To upsert contacts, make a POST
request to /crm/v3/objects/contacts/batch/upsert
. In your request body, include the idProperty
parameter to identify whether you’re using email
or a custom unique identifier property. Include that property’s value as the id
and add the other properties you want to set or update.
email
as the idProperty
for contacts. To complete a partial upsert, use a custom unique identifier property as the idProperty
instead.PUT
request to /crm/v3/objects/contacts/{contactId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
associationTypeId
value, refer to this list of default values, or make a GET
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels
.DELETE
request to the following URL: /crm/v3/objects/contacts/{contactID}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
hs_pinned_engagement_id
field in your request. In the field, include the id
of the activity to pin, which can be retrieved via the engagements APIs. You can pin one activity per record, and the activity must already be associated with the contact prior to pinning.
To set or update a contact’s pinned activity, your request could look like:
DELETE
request to /crm/v3/objects/contacts/{contactId}
.
Learn more about batch deleting contacts in the reference documentation.
properties
parameter with the properties email
and hs_additional_emails
. A contact’s primary email address will be displayed in the email
field and additional emails will be displayed in the hs_additional_emails
field.