Passer au contenu principal
PUT
/
crm
/
v4
/
objects
/
{objectType}
/
{objectId}
/
associations
/
{toObjectType}
/
{toObjectId}
Créer
curl --request PUT \
  --url https://api.hubapi.com/crm/v4/objects/{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>"
}

Produits pris en charge

Exige l'un des produits suivants ou un produit supérieur.
Marketing HubMarketing Hub -Gratuit
Sales HubSales Hub -Gratuit
Service HubService Hub -Gratuit
Content HubContent Hub -Gratuit

Autorisations

Authorization
string
header
requis

The access token received from the authorization server in the OAuth 2.0 flow.

Paramètres de chemin

objectId
string
requis

Identifiant unique de l'objet source dans l'association à créer.

objectType
string
requis

Spécifie le type de l'objet source dans l'association à créer.

toObjectId
string
requis

Identifiant unique de l'objet cible dans l'association à créer.

toObjectType
string
requis

Spécifie le type de l'objet cible dans l'association à créer.

Corps

application/json
associationCategory
enum<string>
requis

La catégorie de l'association, par exemple "HUBSPOT_DEFINED".

Options disponibles:
HUBSPOT_DEFINED,
INTEGRATOR_DEFINED,
USER_DEFINED
associationTypeId
integer<int32>
requis

L'ID représentant le type spécifique d'association.

Réponse

successful operation

Contains the details of the labels that were created to define associations between a specific pair of objects.

createdResourceId
string
requis

Identifiant unique de la ressource nouvellement créée.

entity
object
requis

The relationship descriptors applicable between two object types.

location
string

Emplacement URL de la ressource nouvellement créée.

Last modified on January 26, 2026