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

Messenger API

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

Эндпоинты расположены под /api/v1/channels/{id}/…, где {id} — id канала из GET /channels (wa_… для WhatsApp, ig_… для Instagram). Скоупы: channels:read, channels:write, leads:read, leads:write, scenarios:manage, ai:use. Требуется тариф с функцией API. Выберите раздел ниже.

Telegram: чаты и сообщения

Чаты, сообщения, файлы, медиа, контакты и поиск подключённого Telegram-аккаунта (user или бот).

{id} — id канала из GET /channels. {peer} — Telegram peer: числовой id (группы/каналы отрицательные, напр. -1001234567890), @username или телефон +9989…

Бот-аккаунты работают с теми же эндпоинтами; списка диалогов у них нет — чаты появляются по мере того, как пишут клиенты. Медиа сообщения содержит ref — передайте его в POST /dialogs/{peer}/media, чтобы отправить тот же стикер/фото без загрузки.

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

GET /me Workspace, plan and number of channels

Ответ 200 · Me

id integerworkspace stringplan stringaccounts integerrate_limit string

curl https://chatvendor.net/api/v1/me \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels Connected Telegram accounts

Право: channels:read

Ответ 200 · Channel[]

id integertype string: telegram_user | telegram_bot | whatsapp | instagramname stringusername stringphone stringstatus stringconnected_at string (date-time)

curl https://chatvendor.net/api/v1/channels \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id} One channel

Право: channels:read

Параметры

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

Channel id (from GET /channels)

Ответ 200 · Channel

id integertype string: telegram_user | telegram_bot | whatsapp | instagramname stringusername stringphone stringstatus stringconnected_at string (date-time)

curl https://chatvendor.net/api/v1/channels/1 \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/dialogs Chats of a channel

Право: channels:read

Параметры

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

Channel id (from GET /channels)

typequery · string: user | bot | group | supergroup | channel
qquery · string
per_pagequery · integer
livequery · integer

1 = refresh from Telegram first

Ответ 200 · Dialog[]

peer_id integertype stringtitle stringusername stringunread_count integerlast_message_at string (date-time)last_message_text string

curl https://chatvendor.net/api/v1/channels/1/dialogs \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/dialogs/{peer}/messages Messages of a chat

Право: channels:read

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

limitquery · integer
beforequery · integer
afterquery · integer
livequery · integer

Ответ 200 · ChatMessage[]

id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]

curl https://chatvendor.net/api/v1/channels/1/dialogs/@username/messages \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /channels/{id}/dialogs/{peer}/messages Send a text message

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

textstringобязательно
reply_tointeger
parse_modestring: md | html | none
silentboolean
schedulestring (date-time)

Ответ 200 · ChatMessage

id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/messages \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"text":"…"}'
POST /channels/{id}/dialogs/{peer}/file Send a file (multipart/form-data: file, caption, as=auto|document|voice)

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

multipart/form-data — поля перечислены в описании выше.

Ответ 200 · ChatMessage

id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/file \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -F "file=@photo.jpg" -F "caption=…"
POST /channels/{id}/dialogs/{peer}/forward Forward messages

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

idsinteger[]обязательно
to_peerstringобязательно
drop_authorboolean

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/forward \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"ids":1,"to_peer":"…","drop_author":true}'
POST /channels/{id}/dialogs/{peer}/delete Delete messages

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

idsinteger[]обязательно
revokeboolean

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/delete \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"ids":1,"revoke":true}'
POST /channels/{id}/dialogs/{peer}/read Mark a chat as read

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Ответ 200

OK

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/read \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/dialogs/{peer}/messages/{message}/media Download media (?thumb=1 for a thumbnail)

Право: channels:read

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

Message id

Ответ 200

The file

curl https://chatvendor.net/api/v1/channels/1/dialogs/@username/messages/123/media \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/peers/{peer} User / group info

Право: channels:read

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Ответ 200 · Peer

id integertype stringtitle stringusername stringphone string

curl https://chatvendor.net/api/v1/channels/1/peers/@username \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/resolve Resolve @username, t.me link or phone to a peer

Право: channels:read

Параметры

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

Channel id (from GET /channels)

qquery · stringобязательно

Ответ 200 · Peer

id integertype stringtitle stringusername stringphone string

curl https://chatvendor.net/api/v1/channels/1/resolve?q=… \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /channels/{id}/contacts Add a contact

Право: channels:write

Параметры

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

Channel id (from GET /channels)

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

phonestringобязательно
first_namestringобязательно
last_namestring

Ответ 200 · Peer

id integertype stringtitle stringusername stringphone string

curl -X POST https://chatvendor.net/api/v1/channels/1/contacts \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"phone":"…","first_name":"…","last_name":"…"}'
POST /channels/{id}/dialogs/{peer}/album Send an album (multipart/form-data: files[] 2–10, caption, reply_to, topic)

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

multipart/form-data — поля перечислены в описании выше.

Ответ 200 · ChatMessage[]

id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/album \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -F "file=@photo.jpg" -F "caption=…"
POST /channels/{id}/dialogs/{peer}/media Send existing media by ref (sticker, saved GIF, media from any message)

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

refstringобязательно
captionstring
reply_tointeger
topicinteger
spoilerboolean
schedulestring (date-time)

Ответ 200 · ChatMessage

id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/media \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"ref":"…"}'
POST /channels/{id}/dialogs/{peer}/messages/{message}/click Press a bot keyboard button (by data, text or index)

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

Message id

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

datastring
textstring
indexinteger

Ответ 200 · ButtonAnswer

pressed stringmessage stringalert booleanurl string

curl -X POST https://chatvendor.net/api/v1/channels/1/dialogs/@username/messages/123/click \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"data":"…","text":"…","index":1}'
GET /channels/{id}/dialogs/{peer}/messages/{message}/replies Comments under a post / replies in a topic

Право: channels:read

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

Message id

Ответ 200 · MessagePage

messages ChatMessage[]count integer

curl https://chatvendor.net/api/v1/channels/1/dialogs/@username/messages/123/replies \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/{id}/dialogs/{peer}/mentions Unread mentions (?reactions=1: unseen reactions to our messages)

Право: channels:read

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Ответ 200 · MessagePage

messages ChatMessage[]count integer

curl https://chatvendor.net/api/v1/channels/1/dialogs/@username/mentions \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
PUT /channels/{id}/dialogs/{peer}/draft Save the chat draft (empty text clears it)

Право: channels:write

Параметры

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

Channel id (from GET /channels)

peerpath · stringобязательно

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

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

textstring
reply_tointeger
topicinteger

Ответ 200

OK

curl -X PUT https://chatvendor.net/api/v1/channels/1/dialogs/@username/draft \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"text":"…","reply_to":1,"topic":1}'
POST /channels/{id}/translate Translate text or messages with Telegram's translator

Право: channels:read

Параметры

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

Channel id (from GET /channels)

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

tostringобязательно

ISO 639-1

textstring
peerstring
idsinteger[]

Ответ 200 · Translation[]

text string

curl -X POST https://chatvendor.net/api/v1/channels/1/translate \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"to":"…"}'
GET /channels/{id}/preview Link preview Telegram would attach to this text

Право: channels:read

Параметры

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

Channel id (from GET /channels)

textquery · stringобязательно

Ответ 200 · WebPage

url stringsite_name stringtitle stringdescription stringhas_photo boolean

curl https://chatvendor.net/api/v1/channels/1/preview?text=… \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"