Last modified: September 3, 2025
The object APIs enable you to create and manage records and activities within HubSpot. The object APIs have the same basic functionality for all supported objects, which allows you to substitute the objectTypeId
of an object in the endpoints. For example, to create contacts, you’d make a POST
request to crm/v3/objects/0-1
and to create courses, the request would be to crm/v3/objects/0-410
.
In this article, learn the basics of how to use the object APIs. For certain objects, you can refer to object-specific guides with examples and other details about unique functionality: Companies, Contacts, Deals, Tickets, Calls, Communications, Custom objects, Emails, Feedback submissions, Invoices, Leads, Marketing events, Meetings, Notes, Orders, Payments, Postal mail, Products, Quotes, Subscriptions, Tasks, Users.
Please note:New objects (e.g., appointments, courses, listings, services) must be activated in the HubSpot account before you can manage their records via API. Learn how to check if they’re activated via the object library API and how to activate them in HubSpot.
Retrieve records
You can retrieve records individually or in batches.- To retrieve an individual record, make a
GET
request to/crm/v3/objects/{objectTypeId}/{recordId}
. - To request a list of all records for an object, make a
GET
request to/crm/v3/objects/{objectTypeId}
. - To retrieve a batch of specific records by record ID or a custom unique identifier property, make a
POST
request tocrm/v3/objects/{objectTypeId}/batch/read
and include theid
values of the records in the request body. The batch endpoint cannot retrieve associations. Learn how to batch read associations with the associations API.
Parameter | Description |
---|---|
properties | A comma separated list of the properties to be returned in the response. If the requested record doesn’t have a value for a property, it will not appear in the response. |
propertiesWithHistory | A comma separated list of the current and historical properties to be returned in the response. If the requested record doesn’t have a value for a property, it will not appear in the response. |
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.Note: this parameter is not supported in the batch read endpoint. |
idProperty | Indicates the unique identifier property used to identify records. You only need to use this parameter if retrieving by a custom unique identifier property. |
GET
request to /crm/v3/objects/0-47/{meetingId}?properties=hs_meeting_body,hs_timestamp
and your response would look similar to the following:
Create records
- To create a record for an object, make a
POST
request tocrm/v3/objects/{objectTypeId}
. - To create multiple records, make a
POST
request to/crm/v3/objects/{objectTypeId}/batch/create
.
properties
object. You can also add an associations
object to associate your new record with existing records (e.g., companies, deals), or activities (e.g., meetings, notes).
If you want to create and update records at the same time, learn how to upsert records below.
Properties
Record details are stored in properties. To view all available properties for an object, you can retrieve a list of your account’s properties by making aGET
request to /crm/v3/properties/{objectTypeId}
. Learn more about the properties API and how to format property values.
The table below includes the objects for which records can be created via API and the properties required for creation.
Type ID | Object | Required properties to create |
---|---|---|
0-2 | Companies | At least one of domain (recommended) or name |
0-1 | Contacts | At least one of of email (recommended), firstname , or lastname |
0-3 | Deals | dealname , dealstage and pipeline |
0-5 | Tickets | subject (the ticket’s name), hs_pipeline_stage (the ticket’s status), and hs_pipeline |
0-421 | Appointments | hs_appointment_start |
0-48 | Calls | hs_timestamp |
0-18 | Communications | hs_timestamp and hs_communication_channel_type |
0-410 | Courses | hs_course_name |
2-XXX | Custom objects | The required properties specified in your object’s schema. |
0-49 | Emails | hs_timestamp and hs_email_direction |
0-136 | Leads | hs_associated_contact_email , hs_associated_contact_lastname , hs_lead_name , hs_associated_company_domain , hs_associated_contact_firstname , and hs_associated_company_name |
0-8 | Line items | Recommended properties |
0-420 | Listings | hs_name |
0-54 | Marketing events | hs_event_description and hs_event_name |
0-47 | Meetings | hs_timestamp |
0-46 | Notes | hs_timestamp |
0-123 | Orders | hs_order_name |
0-116 | Postal mail | hs_timestamp |
0-7 | Products | hs_sku , hs_folder , price , name , and description |
0-14 | Quotes | hs_title and hs_expiration_date |
0-162 | Services | hs_name , hs_pipeline , and hs_pipeline_stage |
0-69 | Subscriptions | hs_name |
0-27 | Tasks | hs_timestamp |
0-115 | Users | hs_internal_user_id and hs_email |
Associations
When creating a new record, you can also associate it with existing records or activities by including anassociations
object. In the associations
object, you should include the following:
Parameter | Description |
---|---|
to | The record or activity you want to associate with the record, specified by its unique id value. |
types | The type of the association between the record 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. |
For batch create actions, you can enable multi-status errors which tell you which records were successfully created and which were not. Learn more about setting up multi-status error handling.
Update records
You can update records individually or in batches. For existing records, the Record ID is a default unique value that you can use to update the record via API, but you can also identify records using theidProperty
parameter with a custom unique identifier property. If you want to create and update records at the same time, learn how to upsert records.
- To update an individual record, make a
PATCH
request to/crm/v3/objects/{objectTypeId}/{recordId}
, and include the data you want to update. - To update multiple records, make a
POST
request to/crm/v3/objects/{objectTypeId}/batch/update
. In the request body, include an array with the identifiers for the records and the properties you want to update.
Please note:If you’ve merged records, you can use the previous record ID values stored in the
hs_merged_object_ids
field to update a record using the basic update endpoint. However, these values are not supported when updating records using the batch update endpoint.Upsert records
You can also batch create and update records at the same time using the upsert endpoint. For this endpoint, you can use a custom unique identifier property oremail
for contacts. Following the request, if the records already exist, they’ll be updated and if the records don’t exist, they’ll be created.
To upsert records, make a POST
request to /crm/v3/objects/{objectTypeId}/batch/upsert
. In your request body, include the idProperty
parameter to identify the unique identifier property you’re using. Include that property’s value as the id
and add the other properties you want to set or update.
Please note:Partial upserts are not supported when using
email
as the idProperty
for contacts. To complete a partial upsert, use a custom unique identifier property as the idProperty
instead.email
as the identifier, your request would look similar to the following:
Update associations
Once records are created, you can update their associations using the associations API.- To associate a record with other records or an activity, make a
PUT
request to/crm/v3/objects/{objectTypeId}/{fromRecordId}/associations/{toObjectTypeId}/{toRecordId}/{associationTypeId}
. - To remove an association between a record and a record or activity, make a
DELETE
request to the following URL:/crm/v3/objects/{objectTypeId}/{fromRecordId}/associations/{toObjectTypeId}/{toRecordId}/{associationTypeId}
.
To retrieve the
associationTypeId
value, refer to this list of default values, or make a GET
request to /crm/v4/associations/{fromObjectTypeId}/{toObjectTypeId}/labels
.Pin an activity on a record
You can pin an activity on a record by including thehs_pinned_engagement_id
field in your create, update, or upsert request. In the field, include the id
of the activity to pin, which can be retrieved by making a GET
request to /crm/v3/objects/{objectTypeId}/{recordId}
for calls, communications, emails, meetings, notes, postal mail, or tasks. You can pin one activity per record, and the activity must already be associated with the record prior to pinning.
For example, to set or update an existing deal’s pinned activity, your request could look like:
Delete records
You can delete records individually or in batches, which will add the record to the recycling bin in HubSpot. You can restore the record within HubSpot for up to 90 days after deletion.- To delete an individual record by its record ID, make a
DELETE
request to/crm/v3/objects/{objectTypeId}/{recordId}
. - To delete multiple records, make a
POST
request to/crm/v3/objects/{objectTypeId}/batch/archive
and include the record ID values as theid
inputs in your request body.