Object APIs
You use the object APIs to create and manage an object’s records. For supported objects, you can use object endpoints and replace the{objectTypeId} in the request URL with the desired object. For example, to create contacts, you’d make a POST request to crm/v3/objects/0-1 and to create courses, you’d make a POST request to crm/v3/objects/0-410.
Refer to this article for more information about using the object endpoints for various objects.
Object type IDs
When using CRM and other APIs, you’ll need to use theobjectTypeId field, which is a unique numerical value assigned to each object. For example, to retrieve records, you’d make a GET request to /crm/v3/objects/{objectTypeId}, or when creating a property for an object, you’d make a POST request to /crm/v3/properties/{objectTypeId}.
Expand the section below to view objects and their object type ID values.
Object type ID values
Object type ID values
| Object | Type ID | Description |
|---|---|---|
| Appointments | 0-421 | Represent encounters or services scheduled for an individual. View the objects API |
| Calls | 0-48 | A type of activity that represents phone call interactions associated with your records. View the calls API |
| Carts | 0-142 | Stores data related to ecommerce purchases in HubSpot. View the carts API |
| Communications | 0-18 | A type of activity that represents SMS, LinkedIn, and WhatsApp message interactions associated with your records. View the communications API |
| Companies | 0-2 | Stores information about a business or organization. View the companies API |
| Contacts | 0-1 | Stores information about an individual person. View the contacts API |
| Courses | 0-410 | Represent structured programs or series of lessons, trainings, or educational modules. View the objects API |
| Custom objects | 2-XXX | Stores data that doesn’t fit in with existing objects. To find the objectTypeId for a custom object, make a GET request to /crm/v3/schemas. View the objects API |
| Deals | 0-3 | Represent sales opportunities and transactions, tracked through pipeline stages. View the deals API |
| Discounts | 0-84 | Associated with quotes as part of their pricing details. View the discounts API |
| Emails | 0-49 | A type of activity that represents one-to-one email interactions associated with your records. View the email API |
| Feedback submissions | 0-19 | Stores information submitted to a feedback survey. Feedback submissions are associated with contact records. View the feedback submissions API |
| Fees | 0-85 | Associated with quotes as part of their pricing details. View the fees API |
| Goals | 0-74 | Represent targets for HubSpot users. View the goals API |
| Invoices | 0-53 | Represent the invoices sent for sales transactions. View the invoices API |
| Leads | 0-136 | Represent potential customers who have shown interest in your products or services. View the leads API |
| Line items | 0-8 | Represent individual products and services sold in a deal. Line items can be created from existing products in your product library, or can be created standalone. View the line items API |
| Listings | 0-420 | Represent properties or units to be bought, sold, or rented. View the objects API |
| Marketing events | 0-54 | Represent events related to your marketing efforts, specifically including events from connected integrations. You can specify whether or not a contact attended, registered for, or cancelled attending a marketing event. View the marketing events API |
| Meetings | 0-47 | A type of activity that represents meeting interactions associated with your records. View the meetings API |
| Notes | 0-46 | A type of activity that represents notes associated with your records. View the notes API |
| Orders | 0-123 | Represent ecommerce purchases in HubSpot. View the orders API |
| Payments | 0-101 | The payments made by buyers through invoices, payment links, and quotes. View the payments API |
| Postal mail | 0-116 | A type of activity that represents physical mail interactions associated with your records. View the postal mail API |
| Products | 0-7 | Represent goods or services for sale. Products can’t be associated with other objects, but you can create line items based on products and associate those with deals and quotes. View the products API |
| Projects | 0-970 | Centralized tasks to help your team manage work. View the projects API |
| Quotes | 0-14 | Represent pricing information shared with potential buyers. View the quotes API |
| Services | 0-162 | Represent intangible offerings provided to customers. Examples include onboarding and consulting, repairs and maintenance, and personal care. View the objects API |
| Subscriptions | 0-69 | Represent recurring payments scheduled through payment links and quotes. View the subscriptions API |
| Tasks | 0-27 | A type of activity that represents to-dos associated with your records. View the tasks API |
| Taxes | 0-86 | Associated with quotes as part of their pricing details. View the taxes API |
| Tickets | 0-5 | Represent customer requests for help or support, tracked through pipeline statuses. View the tickets API |
| Users | 0-115 | Represent the users in your HubSpot account. Users cannot be associated with other objects, but can be retrieved and updated via API. View the user details API |
- When starting an import with the imports API, the
columnObjectTypeIdspecifies which object the data in your file belongs to. To import data for contacts, your value forcolumnObjectTypeIdcould becontactor0-1. - When using the associations API, the
fromObjectTypeandtoObjectTypevalues specify the objects and the direction of the association. To view association types for contacts to companies, yourGETrequest could be tocrm/v4/associations/contact/company/labelsorcrm/v4/associations/0-1/0-2/labels.
Unique identifiers and record IDs
A unique identifier is a value that differentiates one record in the CRM from another, even if they have otherwise identical information. For example, a database might have records for two people named John Smith. To avoid accidentally sending money to the wrong John Smith, each record is assigned a number as their Record ID. When a record is created in HubSpot, its Record ID (hs_object_id) is automatically generated and should be treated as a string. Record IDs are unique within an object, so there can be both a contact and company with the same ID. For contacts and companies, there are additional unique identifiers, including a contact’s email and a company’s domain name. You can also create custom unique identifier properties.
In the CRM APIs, you’ll use unique identifier values to identify and manage specific records. You can always use a record’s hs_object_id value, but can also use custom unique identifier properties for certain endpoints, specified by the idProperty parameter. For example, to edit a contact, you could make a PATCH request to /crm/v3/objects/0-1/{contactId} or /crm/v3/objects/0-1/{contactEmail}?idProperty=email. Learn more about how HubSpot handles deduplication in the Knowledge Base.
Associations API
In HubSpot, you can show how objects are related to one another by associating their records. For example, you can associate multiple contacts with a company, and then associate the company and relevant contacts with a deal. You can use the associations API to manage which association types are supported between objects and to associate individual records within objects. The Associations API includes two sets of endpoints:- Association details endpoints: create, edit, and remove associations between records. For example, associate a contact record with a company record.
- Association schema endpoints: view and manage your account’s association definitions (also known as types or labels) and set limits for associations. For example, create a custom Decision Maker association type to associate a contact record and a company record while labelling the contact as that company’s Decision Maker.
{toObjectTypeId} and {fromObjectTypeId} in the request URLs and request bodies.
Before associating records across objects, to understand which objects can be associated to one another, you can retrieve association types. If you have access to a HubSpot account, you can also review your account’s unique object relationships by navigating to the data model tool.
Learn more about object relationships and managing associations using the associations API in this article.
Properties API
Information about records are stored in fields called properties. HubSpot provides a set of default properties for each object. In addition to each object’s default properties, you can store custom data by creating custom properties. When using the properties API, you can substitute objects in the endpoints to create and manage an object’s properties. For example,/crm/v3/properties/0-1 for contact properties or /crm/v3/properties/0-5 for ticket properties.
Learn more about using the properties API in this article.
Schemas API
Each object in HubSpot is defined by a schema, which is a set of configuration details that define what the object is (i.e. its name and ID), the data that it can store (i.e. properties), and its relationships with other objects (i.e. associations). The schemas API can be used to create custom objects, which includes setting up schema details such as display properties, searchable properties, unlabelled associations, and properties required to create records. Learn more about custom objects in HubSpot. The schemas API can also be used to retrieve schema details for custom objects, which will return those high-level object details. However, to manage an object’s properties and association types, you’ll use the properties and associations APIs.Search API
To filter and sort records and activities based on their properties and associations, you can use the search API. When using the search endpoints, substitute the{objectTypeId} value for the object within which you want to search. For example, to search calls, you’d make a POST request to /crm/v3/objects/0-48/search.
Learn more about using the CRM search API in this article.