> 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-getting-and-modifying-lead-tags.md).

# API - Getting and modifying Lead tags

How to view, remove, and add tags from a Lead.

### General Query Params

<table><thead><tr><th width="291">Key</th><th width="450">Description</th></tr></thead><tbody><tr><td>i</td><td>Your instance identifier, 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=seu-token&i=sua-instancia`

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/tags?apitoken=seu-token\\&i=sua-instancia></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&amp;token=2f47914f-45a3-4fe3-9a87-04686d20c971" alt=""><figcaption><p><em>Getting instance tags.</em></p></figcaption></figure>

## Getting the Lead's current tags

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

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

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/leads/id-do-lead?query={tags{id,tag,color\\}}\\&apitoken=seu-token\\&i=sua-instancia></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&amp;token=57158e5c-3149-4e4c-8c3c-a3e6de8a4a40" alt=""><figcaption><p><em>Getting Lead tags</em></p></figcaption></figure>

## Modifying the Lead's tags&#x20;

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

<mark style="color:green;">`PUT`</mark> `/leads/id-do-lead&apitoken=seu-token&i=sua-instancia`

Full endpoint: <mark style="color:green;"><https://sprinthub-api-master.sprinthub.app/leads/id-do-lead\\&apitoken=seu-token\\&i=sua-instancia></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&amp;token=44a5d89d-4cf7-4eca-8bcd-3911cc182e4f" alt=""><figcaption><p><em>Modifying the Lead's tags.</em></p></figcaption></figure>


---

# 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-getting-and-modifying-lead-tags.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.
