# API - Getting and modifying Lead tags

### General 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>

## Getting instance tags

The request was sent using the software *Postman*. The expected response is a list of objects with the IDs and names of the tags in the instance.

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

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/tags?apitoken=your-token\\&i=your-instance></mark>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FAR8RleQUykBRgXfltbDv%2Fartigo-1.png?alt=media&#x26;token=2f47914f-45a3-4fe3-9a87-04686d20c971" alt=""><figcaption><p><em>Getting instance tags.</em></p></figcaption></figure>

## Getting current Lead tags

The expected response is a list with the tags attached to the Lead and their respective colors.

<mark style="color:green;">`GET`</mark> `/leads/lead-id?query={tags{id,tag,color}}&apitoken=your-token&i=your-instance`

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/leads/lead-id?query={tags{id,tag,color\\}}\\&apitoken=your-token\\&i=your-instance></mark>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FrWaJA3qZNj81MH11cz60%2Fartigo-2.png?alt=media&#x26;token=57158e5c-3149-4e4c-8c3c-a3e6de8a4a40" alt=""><figcaption><p><em>Getting Lead tags</em></p></figcaption></figure>

## Modifying Lead tags&#x20;

To modify tags, an overwrite method is used. The tag IDs sent in the request body will replace the lead's current tags. You must pass an object with the key `tags` which has as its value an array with the IDs.

<mark style="color:green;">`PUT`</mark> `/leads/lead-id&apitoken=your-token&i=your-instance`

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/leads/lead-id\\&apitoken=your-token\\&i=your-instance></mark>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FT2skmDjVrbhZRHEQlNDj%2Fartigo-3.png?alt=media&#x26;token=44a5d89d-4cf7-4eca-8bcd-3911cc182e4f" alt=""><figcaption><p><em>Modifying Lead tags.</em></p></figcaption></figure>
