Перейти к содержимому
ChatVendor ChatVendor

Messenger API

Всё, что панель умеет с подключённым аккаунтом Telegram, WhatsApp или Instagram, — через REST: один ключ, один формат ответа, по разделам.

Сегменты, кампании, задачи

Аудитории по карточке контакта, drip-кампании с A/B-шагами и напоминания для команды.

Base URL: https://chatvendor.net/api/v1 · каждый ответ {"success": true, "data": …}

GET /segments Saved audiences (segments) with rules and the cached size

Право: channels:read

Ответ 200

OK

curl https://chatvendor.net/api/v1/segments \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /segments/preview Count contacts for ad-hoc rules (tags_any, tags_none, vars, active_days, silent_days, purchased, min_points, has_phone, networks, lead_status…)

Право: channels:read

Тело запроса (application/json)

rulesobject

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/segments/preview \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"rules":{"tags_any":"vip","active_days":30}}'
GET /segments/{id}/contacts Members of a segment (channel_id, peer_id, title, phone, tags, points); ?limit=&offset=

Право: channels:read

Параметры

idpath · integerобязательно

Segment id

Ответ 200

OK

curl https://chatvendor.net/api/v1/segments/1/contacts \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /campaigns Drip campaigns (entry rule, steps, enrolled)

Право: channels:read

Ответ 200

OK

curl https://chatvendor.net/api/v1/campaigns \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /campaigns/{id} A campaign with per-step / per-variant stats (sent, replied, converted) and enrolment counts

Право: channels:read

Параметры

idpath · integerобязательно

Campaign id

Ответ 200

OK

curl https://chatvendor.net/api/v1/campaigns/1 \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /campaigns/{id}/enrol Put a contact into the campaign now (the first step follows its day/hour rule)

Право: channels:write

Параметры

idpath · integerобязательно

Campaign id

Тело запроса (application/json)

channel_idstring
peer_idstring

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/campaigns/1/enrol \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"channel_id":"wa_12","peer_id":"998901234567"}'
GET /tasks Open reminders of the team (?done=1 for finished, ?all=1 for both)

Право: channels:read

Ответ 200

OK

curl https://chatvendor.net/api/v1/tasks \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /tasks Create a reminder; channel_id + peer_id tie it to a chat, user_id assigns it

Право: channels:write

Тело запроса (application/json)

titlestring
due_atstring
notestring
user_idinteger
channel_idstring
peer_idstring

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/tasks \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'
POST /tasks/{id}/done Mark a reminder done (undo=true reopens)

Право: channels:write

Параметры

idpath · integerобязательно

Task id

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/tasks/1/done \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"