Creating legacy public apps and project-based apps is temporarily unavailable for new HubSpot accounts.
Learn more in our Trust Center.
curl --request PUT \
--url https://api.hubapi.com/crm/objects/2025-09/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 123
}
]
'{
"createdResourceId": "<string>",
"entity": {
"fromObjectId": "<string>",
"fromObjectTypeId": "<string>",
"labels": [
"<string>"
],
"toObjectId": "<string>",
"toObjectTypeId": "<string>"
},
"location": "<string>"
}Set association labels between two records.
curl --request PUT \
--url https://api.hubapi.com/crm/objects/2025-09/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 123
}
]
'{
"createdResourceId": "<string>",
"entity": {
"fromObjectId": "<string>",
"fromObjectTypeId": "<string>",
"labels": [
"<string>"
],
"toObjectId": "<string>",
"toObjectTypeId": "<string>"
},
"location": "<string>"
}Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
successful operation
Contains the details of the labels that were created to define associations between a specific pair of objects.
Was this page helpful?