> 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

### Route

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

### 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="/pages/ca8a1838330311bd80c9d1104159be1c08be1267">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 related to 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="/files/91c6d97370c836b0b4dc9112f448ae130f903d01" alt=""><figcaption><p><em>Request to relate a Custom Object to a contact.</em></p></figcaption></figure></div>

### Checking in the Lead's Full Data

When relating a Custom Object to a contact, it should appear as in the image below.

<div data-with-frame="true"><figure><img src="/files/2db75d09e19c01cb574a790475afebde3e4682db" alt=""><figcaption><p><em>Custom Object tab within the contact.</em></p></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sprinthub.com/en/topics/api/api-how-to-relate-a-custom-object-to-a-contact.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
