curl --request POST \
--url https://api.hubapi.com/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"from": {
"id": "<string>"
},
"to": {
"id": "<string>"
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 123
}
]
}
]
}
'{
"completedAt": "2023-11-07T05:31:56Z",
"results": [
{
"fromObjectId": "<string>",
"fromObjectTypeId": "<string>",
"labels": [
"<string>"
],
"toObjectId": "<string>",
"toObjectTypeId": "<string>"
}
],
"startedAt": "2023-11-07T05:31:56Z",
"status": "CANCELED",
"errors": [
{
"category": "<string>",
"context": {},
"errors": [
{
"message": "<string>",
"code": "<string>",
"context": "{missingScopes=[scope1, scope2]}",
"in": "<string>",
"subCategory": "<string>"
}
],
"links": {},
"message": "<string>",
"status": "<string>",
"id": "<string>",
"subCategory": {}
}
],
"links": {},
"numErrors": 123,
"requestedAt": "2023-11-07T05:31:56Z"
}Batch create associations for objects
curl --request POST \
--url https://api.hubapi.com/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": [
{
"from": {
"id": "<string>"
},
"to": {
"id": "<string>"
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 123
}
]
}
]
}
'{
"completedAt": "2023-11-07T05:31:56Z",
"results": [
{
"fromObjectId": "<string>",
"fromObjectTypeId": "<string>",
"labels": [
"<string>"
],
"toObjectId": "<string>",
"toObjectTypeId": "<string>"
}
],
"startedAt": "2023-11-07T05:31:56Z",
"status": "CANCELED",
"errors": [
{
"category": "<string>",
"context": {},
"errors": [
{
"message": "<string>",
"code": "<string>",
"context": "{missingScopes=[scope1, scope2]}",
"in": "<string>",
"subCategory": "<string>"
}
],
"links": {},
"message": "<string>",
"status": "<string>",
"id": "<string>",
"subCategory": {}
}
],
"links": {},
"numErrors": 123,
"requestedAt": "2023-11-07T05:31:56Z"
}Supported products
Required Scopes
The access token received from the authorization server in the OAuth 2.0 flow.
Show child attributes
successful operation
The timestamp when the batch processing was completed, in ISO 8601 format.
Show child attributes
The timestamp when the batch processing began, in ISO 8601 format.
The status of the batch processing request: "PENDING", "PROCESSING", "CANCELLED", or "COMPLETE".
CANCELED, COMPLETE, PENDING, PROCESSING Show child attributes
An object containing relevant links related to the batch request.
Show child attributes
The number of errors encountered during the batch processing.
The timestamp when the batch request was initially made, in ISO 8601 format.
Was this page helpful?