# Custom Object association and association label

**URL:** <https://community.hubspot.com/t/custom-object-association-and-association-label/70046>\
**Category:** APIs & Integrations\
**Created:** [November 27, 2022, 8:31pm UTC](https://community.hubspot.com/t/custom-object-association-and-association-label/70046 "2022-11-27T20:31:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TZiesing](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tziesing/32/54294_2.png) [@TZiesing](https://community.hubspot.com/u/TZiesing)\
**Post date:** [November 27, 2022, 8:31pm UTC](https://community.hubspot.com/t/custom-object-association-and-association-label/70046/1 "2022-11-27T20:31:34Z")

</div>

Hi there,

Hope someone can help me with the followin issue:

I created a custom object via the api (at a time when it wasn’t possible in the system itself) and added the needed associatio in an array:

“associatedObjects”: [  
“CONTACT”,  
“COMPANY”,  
“TICKET”,  
“DEAL”,  
“2-3453932”  
]

I am now trying to put together a collection for the external devloper to send me contacts with the associated custom object according to the contact API documentation:

[CRM API | Contacts (hubspot.com)](https://developers.hubspot.com/docs/api/crm/contacts)

#### Associate a contact with another object

**PUT** …/crm/v4/objects/contacts/{contactId}/associations/{toObjectType}/{toObjectId}

Unfortunatley I am struggling with the paramaters I have to fill, especially with the association type.

After trying with different values I decided to reach out to Hubspot support and there I was told that there was no association between the contact and the custom object and that I would have to create an association via PUT to **/crm/v3/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}/{associationType}**.

And then was linked to this:

"If the object relationship is already [**defined**](https://developers.hubspot.com/docs/api/crm/crm-custom-objects#defining-a-new-association), to determine the **associationType** value, make a **GET** request to **crm/v3/schemas/{objectType}**. "

I did this request to get the schema

[https://api.hubapi.com/crm/v3/schemas/2-7111007](https://api.hubapi.com/crm/v3/schemas/2-7111007)

and got the response:

{

```
        "fromObjectTypeId": "2-7111007",

        "toObjectTypeId": "0-1",

        "name": "event\_to\_contact",

        "cardinality": "ONE\_TO\_MANY",

        "inverseCardinality": "ONE\_TO\_MANY",

        "id": "47",

        "createdAt": null,

        "updatedAt": null

    },

```

This makes be believe that the association is already there.

I used the values to assign the contacts to the custom object again (the name of my custom object is event):

contact: 15601

toObjectType: event

to Objectid: 47

associationType: event\_to\_contact

but the response is still:

{  
“status”: “error”,  
“message”: “Unable to infer object type from: event”,  
“correlationId”: “6146c84b-ad12-47ff-a577-710d327b1e3a”  
}

Does this really mean that I have to do the PUT request?

I tried this as well:

[https://api.hubapi.com/crm/v3/objects/event/2-7111007/associations/contact/0-1/event\_to\_contact](https://api.hubapi.com/crm/v3/objects/events/2-7111007/associations/contact/0-1/event_to_contact)

Unfortunately it says:

{

```
"status": "error",

"message": "Unable to infer object type from: event",

"correlationId": "b9cf3e62-d566-48ed-be83-db78f92d001a"

```

}

What am I doing wrong. If someone has hint please let me know.

Thanks!

I would then also need to also transfer or assign the specific association labels I created…

Many thanks and best regards

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 2, 2022, 8:47pm UTC](https://community.hubspot.com/t/custom-object-association-and-association-label/70046/2 "2022-12-02T20:47:02Z")

</div>

Hey, @TZiesing 👋 Were you able to get this sorted? If not, I am happy to help.

Best,

Jaycee
