Leads are contacts or companies that are potential customers who have shown interest in your products or services. The leads endpoints allow you to manage this data and sync it between HubSpot and other systems.
POST
request to /crm/v3/objects/leads
.
In the request body, include any details about the lead in a properties
object. Your new lead:
hs_lead_name
property.GET
request to /crm/v3/properties/leads
. Learn more about the properties API.
See the table below for some common properties for leads:
PROPERTY | DESCRIPTION |
---|---|
hs_lead_name | The full name of the lead. |
hs_lead_type | A dropdown list of lead types. You can edit or add new types in your lead property settings. |
hs_lead_label | The current status of the lead. You can edit or add new labels in your lead property settings. |
Parameter | Description |
---|---|
to | The record you want to associate with the lead, specified by its unique id value. |
types | The type of the association between the lead 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/leads/{leadsId}
.GET
request to /crm/v3/objects/leads
.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 lead 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 lead 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/leads/batch/read
. The batch endpoint can’t retrieve associations. Learn how to batch read associations with the associations API.Property
parameter to retrieve leads by leadID
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 isn’t required when retrieving by record ID. If you’re using a custom unique value property to retrieve leads, you must include the idProperty
parameter.
leadsId
to update leads via the API.
To update an individual lead by its lead ID, make a PATCH
request to /crm/v3/objects/leads/{leadsId}
, and include the data you want to update in the request body.
PUT
request to /crm/v3/objects/leads/{leadsId}/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/leads/{leadId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
If you remove all primary associations to the lead, the lead will automatically be deleted.
DELETE
request to /crm/v3/objects/leads/{leadId}
.
Learn more about deleting leads in the reference documentation.