# Теги

{% hint style="warning" %}
Как правильно сформировать запрос?! Смотрим в [основах](/dlya-razrabotchikov/dokumentaciya-i-rabota-s-api/osnovy.md)
{% endhint %}

## Получить список тегов бота

<mark style="color:blue;">`GET`</mark> `https://app.cleverapp.pro/api/v1/getBotTags`

Этот метод позволяет получить список всех тегов для определенного бота.

#### Path Parameters

| Name                                      | Type    | Description |
| ----------------------------------------- | ------- | ----------- |
| bot\_id<mark style="color:red;">\*</mark> | integer | ID бота.    |

{% tabs %}
{% tab title="200: OK Запрос успешно обработан" %}

```
"data": [
  "Одежда",
  "Акция",
  "Горячий"
}
```

{% endtab %}
{% endtabs %}

## Получить список тегов контакта

<mark style="color:blue;">`GET`</mark> `https://app.cleverapp.pro/api/v1/getContactTags`

Этот метод позволяет получить список тегов контакта.

#### Path Parameters

| Name                                      | Type    | Description  |
| ----------------------------------------- | ------- | ------------ |
| bot\_id<mark style="color:red;">\*</mark> | integer | ID контакта. |

{% tabs %}
{% tab title="200: OK Запрос успешно обработан" %}

```javascript
{
  "data": [
    "Горячий", 
    "Реклама"
  ]
}
```

{% endtab %}
{% endtabs %}

## Привязать тег к контакту

<mark style="color:green;">`POST`</mark> `https://app.cleverapp.pro/api/v1/attachTagToContact`

Этот метод позволяет привязать тег к контакту по id или имени тега.

#### Request Body

| Name                                          | Type    | Description  |
| --------------------------------------------- | ------- | ------------ |
| contact\_id<mark style="color:red;">\*</mark> | integer | ID контакта. |
| tag\_id                                       | string  | Имя тега     |

{% tabs %}
{% tab title="204: No Content Запрос успешно обработан" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Отвязать тег от контакта

<mark style="color:green;">`POST`</mark> `https://app.cleverapp.pro/api/v1/detachTagFromContact`

Этот метод позволяет отвязать тег от контакта по id или имени тега.

#### Request Body

| Name        | Type   | Description  |
| ----------- | ------ | ------------ |
| contact\_id | string | ID контакта. |
| name        | string | Имя тега.    |

{% tabs %}
{% tab title="204: No Content Запрос успешно обработан" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://help.cleverapp.pro/dlya-razrabotchikov/dokumentaciya-i-rabota-s-api/kontakty/tegi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
