hubspot-batch-create-associations
Create batch associations between HubSpot objects to link records across different object types. Define association types and specify relationships in a single operation for efficient CRM data management.
Instructions
🛡️ Guardrails:
1. Data Modification Warning: This tool modifies HubSpot data. Only use when the user has explicitly requested to update their CRM.
🎯 Purpose:
1. Establishes relationships between HubSpot objects, linking records across different object types, by creating associations between objects in batch.
2. Uses a single set of association types for all associations in the batch.
📋 Prerequisites:
1. Use the hubspot-get-user-details tool to get the OwnerId and UserId if you don't have that already.
2. Use the hubspot-get-association-definitions tool to identify valid association types before creating associations.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
fromObjectType | Yes | The type of HubSpot object to create association from. Valid values include: appointments, companies, contacts, courses, deals, leads, line_items, listings, marketing_events, meetings, orders, postal_mail, products, quotes, services, subscriptions, tickets, users. For custom objects, use the hubspot-get-schemas tool to get the objectType. | |
inputs | Yes | List of association inputs defining the relationships to create. (max 100 associations per batch) | |
toObjectType | Yes | The type of HubSpot object to create association to. Valid values include: appointments, companies, contacts, courses, deals, leads, line_items, listings, marketing_events, meetings, orders, postal_mail, products, quotes, services, subscriptions, tickets, users. For custom objects, use the hubspot-get-schemas tool to get the objectType. | |
types | Yes | The types of associations to create |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"fromObjectType": {
"description": "The type of HubSpot object to create association from. Valid values include: appointments, companies, contacts, courses, deals, leads, line_items, listings, marketing_events, meetings, orders, postal_mail, products, quotes, services, subscriptions, tickets, users. For custom objects, use the hubspot-get-schemas tool to get the objectType.",
"type": "string"
},
"inputs": {
"description": "List of association inputs defining the relationships to create. (max 100 associations per batch)",
"items": {
"additionalProperties": false,
"properties": {
"from": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The ID of the object to create association from",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"to": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The ID of the object to create association to",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
},
"required": [
"from",
"to"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"toObjectType": {
"description": "The type of HubSpot object to create association to. Valid values include: appointments, companies, contacts, courses, deals, leads, line_items, listings, marketing_events, meetings, orders, postal_mail, products, quotes, services, subscriptions, tickets, users. For custom objects, use the hubspot-get-schemas tool to get the objectType.",
"type": "string"
},
"types": {
"description": "The types of associations to create",
"items": {
"additionalProperties": false,
"properties": {
"associationCategory": {
"enum": [
"HUBSPOT_DEFINED",
"USER_DEFINED",
"INTEGRATOR_DEFINED"
],
"type": "string"
},
"associationTypeId": {
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"associationCategory",
"associationTypeId"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"fromObjectType",
"toObjectType",
"types",
"inputs"
],
"type": "object"
}