> 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

### 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="/files/a1dd72546d04e239f9da0d801eae0880e588a073" 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="/files/83f185b027f3cb120b3ec3f3c58985bb2fedca1d" 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="/files/878df6585f877c9624426fbfe8cc1f8702c91871" alt=""><figcaption><p><em>Modifying Lead 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.
