> For the complete documentation index, see [llms.txt](https://manual.selarti.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.selarti.com/vneshnie-integracii/dobavlenie-ca-v-zadanie-cherez-api.md).

# Добавление ЦА в задание через API

## Метод для добавления ЦА в задание

## add target audience

> 🇬🇧 Add target audience\
> \
> 🇷🇺 Добавить целевую аудиторию\
> \
> 🇺🇿 Maqsadli auditoriyani qo'shish

```json
{"openapi":"3.0.3","info":{"title":"Selarti public api","version":"1.0.0"},"tags":[{"name":"Other","description":"**Base URL:** https://selarti.com"}],"servers":[{"url":"https://selarti.com","description":"Main API server (for /api/1.1/wf/* endpoints)"},{"url":"https://api.selarti.com","description":"Advanced API server (for /v1/* endpoints)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/api/1.1/wf/add_target":{"post":{"tags":["Other"],"summary":"add target audience","description":"🇬🇧 Add target audience\n\n🇷🇺 Добавить целевую аудиторию\n\n🇺🇿 Maqsadli auditoriyani qo'shish","operationId":"addTarget","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"task":{"type":"string","description":"task_id"},"target":{"type":"string","description":"phone, username, id (depending on the communication channel). For more than one, use \"1111\\n2222\\n3333...\""}},"required":["task","target"]}}}},"responses":{"200":{"description":""}}}}}}
```

Чтобы получить task, в разделе «[Задания](< https://selarti.com/panel?menu=tasks>)» скопируйте ID задания, для этого нажмите на кнопку слева от названия нужного задания.

<figure><img src="https://4089339230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSciXxWqmoBx13cWpl1JJ%2Fuploads%2FSQCPsJiwQN2jLIjtvFyS%2Fimage.png?alt=media&amp;token=7eed55ea-4017-45b0-b11e-9f459aaa2487" alt=""><figcaption></figcaption></figure>
