# set

Иногда, для продолжения сценария, нужно установить значение переменной подписчику

## Запрос с помощью ID подписчика в платформе

<mark style="color:green;">`POST`</mark> `https://leadconverter.ru/api/v1/токен/variable.set`

#### Query Parameters

| Name                                             | Type    | Description                              |
| ------------------------------------------------ | ------- | ---------------------------------------- |
| subscriber\_id<mark style="color:red;">\*</mark> | integer | идентификатор подписчика в LeadConverter |
| variable<mark style="color:red;">\*</mark>       | string  | Название переменной                      |
| value<mark style="color:red;">\*</mark>          | String  | Значение переменной                      |

{% tabs %}
{% tab title="200: OK " %}

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

{% endtab %}
{% endtabs %}

**Пример использования:**

```
https://leadconverter.ru/api/v1/токен/variable.set?secret=секретный_ключ&subscriber_id=ид_подписчика_в_платформе&variable=название_переменной&value=значение_переменной
```

## Запрос с помощью ID подписчика и ID канала в мессенджере

<mark style="color:blue;">`GET`</mark> `https://leadconverter.ru/api/v1/токен/variable.set`

#### Query Parameters

| Name                                          | Type    | Description                                          |
| --------------------------------------------- | ------- | ---------------------------------------------------- |
| user\_id <mark style="color:red;">\*</mark>   | integer | ID подписчика в мессенджере, которому запускаем бота |
| channel\_id<mark style="color:red;">\*</mark> | integer | ID канала в мессенджере                              |
| variable<mark style="color:red;">\*</mark>    | String  | Название переменной                                  |
| value<mark style="color:red;">\*</mark>       | String  | Значение переменной                                  |

{% tabs %}
{% tab title="200: OK " %}

```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://docs.leadconverter.su/api-metody/variable/set.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.
