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

Authorizations

Authorization
string
header
required

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

Path Parameters

objectId
string
required

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

objectType
string
required

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

toObjectId
string
required

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

toObjectType
string
required

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

Body

application/json
associationCategory
enum<string>
required

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

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

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

Response

successful operation

createdResourceId
string
required

Identifiant unique de la ressource nouvellement créée.

entity
object
required
location
string

Emplacement URL de la ressource nouvellement créée.

Last modified on December 9, 2025