Quick tipDeveloperSmart CRM

Association labels through the v4 API: find the type ID, then associate

Every label is a type ID. Look it up per object pair before you write associations.

Subscription
Custom labels need Professional or Enterprise
Permissions
App with CRM write scopes
Time
5 min · Advanced
Last verified

Short answer

Labels are association types with their own typeId. Get them with GET /crm/v4/associations/contact/deal/labels, then send associationCategory (HUBSPOT_DEFINED for default labels, USER_DEFINED for custom) and associationTypeId when you associate. Batch create takes up to 2,000 inputs per request. Including only the new label replaces an existing one, so include both to append. The v3 associations API cannot create or edit labels.

1. Look up the label

GET https://api.hubapi.com/crm/v4/associations/contact/deal/labels

The response lists each label with its typeId and category. Custom label IDs differ per account, so do not hard-code them across portals.

2. Associate in bulk

POST https://api.hubapi.com/crm/v4/associations/contact/deal/batch/create
{
  "inputs": [
    {
      "from": { "id": "CONTACT_ID" },
      "to": { "id": "DEAL_ID" },
      "types": [ { "associationCategory": "USER_DEFINED", "associationTypeId": 36 } ]
    }
  ]
}

3. Things to watch

  • Replace versus append: send all labels you want kept.
  • Association limits per record pair still apply.
  • Default type IDs are listed in the docs. Object type IDs are in HubSpot object type IDs.
  • In the UI, see association labels.

Sources

New field notes by email

One email when a new article publishes.

Still stuck?

If this did not fix it, the problem is probably specific to your setup. Book a call and we will look at it together.

Book a call with Sam