Company records store data about businesses. The companies endpoints allow you to manage this data and sync it between HubSpot and other systems.
POST
request to /crm/v3/objects/companies
.
In your request, include your company data in a properties object. You can also add an associations object to associate your new company with existing records (e.g., contacts, deals), or activities (e.g., meetings, notes).
name
or domain
. It is recommended to always include domain
, because domain names are the primary unique identifier to avoid duplicate companies in HubSpot. If a company has multiple domains, you can add them through the API by using the hs_additional_domains
field with semicolons separating each domain. For example: "hs_additional_domains" : "domain.com; domain2.com; domain3.com"
.
To view all available properties, you can retrieve a list of your account’s company properties by making a GET
request to /crm/v3/properties/companies
. 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 stages are 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 company, specified by its unique id value. |
types | The type of the association between the company 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/companies/{companyId}
.GET
request to /crm/v3/objects/companies
.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 company 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 company 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/companies/batch/read
. The batch endpoint cannot retrieve associations. Learn how to batch read associations with the associations API.idProperty
parameter to retrieve companies by 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. To use a custom unique value property to retrieve companies, you must include the idProperty
parameter.
For example, to retrieve a batch of companies, your request could look like either of the following:
To retrieve companies with current and historical values for a property, your request could look like:
PATCH
request to /crm/v3/objects/companies/{companyId}
, 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.PUT
request to /crm/v3/objects/companies/{companyId}/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/companies/{companyId}/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 company prior to pinning.
To set or update a company’s pinned activity, your request could look like:
DELETE
request to /crm/v3/objects/companies/{companyId}
.
Learn more about batch deleting companies in the reference documentation.