Skip to main content
Using the object APIs, you can create and manage records and activities within HubSpot. The object APIs have the same basic functionality for all supported objects, so you can substitute the objectTypeId in the endpoints to work with different objects. 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.
Some objects have limited API functionality. For more details, click the link to an object’s endpoints reference documentation in the table below. If an object listed doesn’t have its own guide, you can refer to the objects API guide and substitute the {objectTypeId} in each endpoint to your desired object.
Expand the section below to view objects and their object type ID values.
ObjectType ID
Appointments0-421
Calls0-48
Carts0-142
Communications0-18
Companies0-2
Contacts0-1
Courses0-410
Custom objects2-XXX
Deals0-3
Discounts0-84
Emails0-49
Feedback submissions0-19
Fees0-85
Goals0-74
Invoices0-53
Leads0-136
Line items0-8
Listings0-420
Marketing events0-54
Meetings0-47
Notes0-46
Orders0-123
Payments0-101
Postal mail0-116
Products0-7
Projects0-970
Quotes0-14
Services0-162
Subscriptions0-69
Tasks0-27
Taxes0-86
Tickets0-5
Users0-115
In this article, learn the basics of how to use the object APIs.
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 to crm/v3/objects/{objectTypeId}/batch/read and include the id values of the records in the request body. The batch endpoint cannot retrieve associations. Learn how to batch read associations with the associations API.
For these endpoints, you can include the following query parameters in the request URL:
ParameterDescription
propertiesA 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.
propertiesWithHistoryA 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.
associationsA 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.
idPropertyIndicates the unique identifier property used to identify records. You only need to use this parameter if retrieving by a custom unique identifier property.
For example, to retrieve a meeting with the meeting’s text body and starting time, you’d make a GET request to /crm/v3/objects/0-47/{meetingId}?properties=hs_meeting_body,hs_timestamp and your response would look similar to the following:
{
  "id": "65059681027",
  "properties": {
    "hs_createdate": "2024-11-20T20:12:09.236Z",
    "hs_lastmodifieddate": "2024-11-20T20:12:10.610Z",
    "hs_meeting_body": "<div style=\"\" dir=\"auto\" data-top-level=\"true\"><p style=\"margin:0;\">New meeting</p></div>",
    "hs_object_id": "65059681027",
    "hs_timestamp": "2024-11-20T20:12:03.054Z"
  },
  "createdAt": "2024-11-20T20:12:09.236Z",
  "updatedAt": "2024-11-20T20:12:10.610Z",
  "archived": false
}
To retrieve a batch of deals, your request could look like either of the following:
{
  "properties": ["dealname", "dealstage", "pipeline"],
  "inputs": [
    {
      "id": "7891023"
    },
    {
      "id": "987654"
    }
  ]
}
{
  "properties": ["dealname", "dealstage", "pipeline"],
  "idProperty": "uniqueordernumber",
  "inputs": [
    {
      "id": "0001111"
    },
    {
      "id": "0001112"
    }
  ]
}

Create records

  • To create a record for an object, make a POST request to crm/v3/objects/{objectTypeId}.
  • To create multiple records, make a POST request to /crm/v3/objects/{objectTypeId}/batch/create.
In your request, include data for each record in a 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 a GET request to /crm/v3/properties/{objectTypeId}. Learn more about the properties API and how to format property values. Expand the section below to view the objects for which records can be created via API, and the properties required for creation.
ObjectType IDRequired properties to create
Appointments0-421hs_appointment_name
Calls0-48hs_timestamp
Carts0-142None, but recommended hs_cart_name
Communications0-18hs_timestamp and hs_communication_channel_type
Companies0-2At least one of domain (recommended) or name
Contacts0-1None, but recommended at least one of email, firstname, or lastname
Courses0-410hs_course_name
Custom objects2-XXXThe required properties specified in your object’s schema.
Deals0-3dealname, dealstage and pipeline
Emails0-49hs_timestamp and hs_email_direction
Invoices0-53hs_currency
Leads0-136hs_associated_contact_email, hs_associated_contact_lastname, hs_lead_name, hs_associated_company_domain, hs_associated_contact_firstname, and hs_associated_company_name
Line items0-8None, but review recommended properties.
Listings0-420hs_name
Marketing events0-54hs_event_description and hs_event_name
Meetings0-47hs_timestamp
Notes0-46hs_timestamp
Orders0-123hs_order_name
Payments0-101hs_initial_amount and hs_initiated_date
Postal mail0-116hs_timestamp
Products0-7hs_sku, hs_folder, price, name, and description
Projects0-970hs_name, hs_pipeline, and hs_pipeline_stage
Quotes0-14hs_title and hs_expiration_date
Services0-162hs_name, hs_pipeline, and hs_pipeline_stage
Subscriptions0-69hs_name
Tasks0-27hs_timestamp
Tickets0-5subject (the ticket’s name), hs_pipeline_stage (the ticket’s status), and hs_pipeline
Users0-115hs_internal_user_id and hs_email
For example, to create a new ticket without associations, your request may look similar to the following:
{
  "properties": {
    "hs_pipeline": "0",
    "hs_pipeline_stage": "1",
    "hs_ticket_priority": "HIGH",
    "subject": "troubleshoot report"
  }
}
For example, to create multiple contacts without associations, your request may look similar to the following:
{
  "inputs": [
    {
      "properties": {
        "email": "testone@test.com",
        "firstname": "Test",
        "lastname": "PersonOne",
        "favorite_food": "Pizza"
      }
    },
    {
      "properties": {
        "email": "testtwo@test.com",
        "firstname": "Test",
        "lastname": "PersonTwo",
        "favorite_food": "Ice cream"
      }
    }
  ]
}

Associations

When creating a new record, you can also associate it with existing records or activities by including an associations object. In the associations object, you should include the following:
ParameterDescription
toThe record or activity you want to associate with the record, specified by its unique id value.
typesThe 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 example, to create a new contact and associate with an existing company and email, your request would look like the following:
{
  "properties": {
    "email": "example@hubspot.com",
    "firstname": "Jane",
    "lastname": "Doe",
    "phone": "(555) 555-5555",
    "company": "HubSpot",
    "website": "hubspot.com",
    "lifecyclestage": "marketingqualifiedlead"
  },
  "associations": [
    {
      "to": {
        "id": 123456
      },
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 279
        }
      ]
    },
    {
      "to": {
        "id": 556677
      },
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 197
        }
      ]
    }
  ]
}
For example, to create multiple deals and associate them with existing companies and meetings, your request would look similar to the following:
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.
{
  "inputs": [
    {
      "associations": [
        {
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 5
            }
          ],
          "to": {
            "id": "23125848331"
          }
        },
        {
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 211
            }
          ],
          "to": {
            "id": "65059681027"
          }
        }
      ],
      "properties": {
        "dealname": "New deal 1",
        "dealstage": "qualifiedtobuy",
        "pipeline": "default"
      }
    },
    {
      "associations": [
        {
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 5
            }
          ],
          "to": {
            "id": "23125848331"
          }
        },
        {
          "types": [
            {
              "associationCategory": "HUBSPOT_DEFINED",
              "associationTypeId": 211
            }
          ],
          "to": {
            "id": "65059681027"
          }
        }
      ],
      "properties": {
        "dealname": "New deal 2",
        "dealstage": "qualifiedtobuy",
        "pipeline": "default"
      }
    }
  ]
}

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 the idProperty 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.
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.
For example, to update a contact, your request would look similar to the following:
{
  "properties": {
    "favorite_food": "burger",
    "jobtitle": "Manager",
    "lifecyclestage": "Customer"
  }
}

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 or email 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.
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.
For example, to upsert contacts to set the phone number property using email as the identifier, your request would look similar to the following:
{
  "inputs": [
    {
      "properties": {
        "phone": "5555555555"
      },
      "id": "luke@lukesdiner.com",
      "idProperty": "email"
    },
    {
      "properties": {
        "phone": "7777777777"
      },
      "id": "lorelai@thedragonfly.com",
      "idProperty": "email"
    },
    {
      "properties": {
        "phone": "1111111111"
      },
      "id": "michel@thedragonfly.com",
      "idProperty": "email"
    }
  ]
}

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 the hs_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:
{
  "properties": {
    "hs_pinned_engagement_id": 123456789
  }
}
To create a new deal, associate it with an activity, and pin that activity, you request would look like:
{
  "properties": {
    "dealname": "New Deal",
    "pipeline": "default",
    "dealstage": "appointmentscheduled",
    "hs_pinned_engagement_id": 123456789
  },
  "associations": [
    {
      "to": {
        "id": 123456789
      },
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 205
        }
      ]
    }
  ]
}

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 the id inputs in your request body.
For example, to delete multiple appointments, your request would look like:
{
  "inputs": [
    {
      "id": "123456"
    },
    {
      "id": "7891011"
    },
    {
      "id": "12123434"
    }
  ]
}

Limits

Object API batch endpoints are limited to 100 inputs per request. For example, create or retrieve up to 100 contacts per request.
Last modified on December 18, 2025