> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/api/api-how-to-relate-a-custom-object-to-a-contact.md).

# API - How to Relate a Custom Object to a Contact

How to relate an existing Custom Object to a contact.

### Route

<mark style="color:green;">`POST`</mark> `/customobjects/link?apitoken=seu-token&i=sua-instancia`

### Query Params

<table><thead><tr><th width="291">Key</th><th width="450">Description</th></tr></thead><tbody><tr><td>i</td><td>Identifier of your instance, subdomain.</td></tr><tr><td>apitoken</td><td>API token.</td></tr></tbody></table>

### Body

<table><thead><tr><th width="291">Key</th><th width="450">Description</th></tr></thead><tbody><tr><td>objectId</td><td>ID of the created Object. If it was created via API, it is returned by <a href="https://docs.sprinthub.com/en/topics/api/api-how-to-create-a-custom-object.md">this call</a>.</td></tr><tr><td>linkType</td><td>Must be <code>"lead"</code>.</td></tr><tr><td>targetId</td><td>ID of the contact within Sprinthub that will be associated with the Custom Object.</td></tr><tr><td>amount</td><td>Must be <code>1</code>.</td></tr></tbody></table>

## Testing Custom Object Relationship

The request was sent using the software *Postman*. The expected response is an object representing the relationship between the Object and the lead.

<div data-with-frame="true"><figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2Foe1Goo6lPIUCnGbkNGp3%2FScreenshot_3.png?alt=media&amp;token=d71ba42b-bb14-4f14-bbdc-bfcbc421cf6a" alt=""><figcaption><p><em>Request to associate a Custom Object with a contact.</em></p></figcaption></figure></div>

### Checking in the Lead's Full Data

When associating a Custom Object with a contact, it should look like in the image below.

<div data-with-frame="true"><figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F9bUSxlAJFeIdD76wmwXZ%2FScreenshot_4.png?alt=media&amp;token=05d4d2cd-3da2-4681-bf70-8884ebeb17a1" alt=""><figcaption><p><em>Custom Object tab within the contact.</em></p></figcaption></figure></div>
