Messenger API
Всё, что панель умеет с подключённым аккаунтом Telegram, WhatsApp или Instagram, — через REST: один ключ, один формат ответа, по разделам.
Лиды
Лиды, собранные правилами и AI: статус, балл, теги и резюме.
Лиды создают правила лидов и AI; account_id — id Telegram-канала, peer_id — клиент.
Base URL: https://chatvendor.net/api/v1 · каждый ответ {"success": true, "data": …}
GET
/leads
List leads
leads:read
Право: leads:read
Параметры
statusquery · stringqquery · stringОтвет 200 · Lead[]
id integeraccount_id integerpeer_id integertitle stringusername stringphone stringstatus stringscore integertags string[]summary stringdata objectlast_message_at string (date-time)
curl https://chatvendor.net/api/v1/leads \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/leads
Create a lead (account_id may be a channel reference such as wa_12); amount = deal value for the pipeline
leads:write
Право: leads:write
Тело запроса (application/json)
account_idstringобязательноpeer_idintegerобязательноamountnumbersourcestringtitlestringstatusstringtagsstring[]scoreintegernotesstringОтвет 200 · Lead
id integeraccount_id integerpeer_id integertitle stringusername stringphone stringstatus stringscore integertags string[]summary stringdata objectlast_message_at string (date-time)
curl -X POST https://chatvendor.net/api/v1/leads \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"account_id":"…","peer_id":1}'
GET
/leads/{leadId}
One lead
leads:read
Право: leads:read
Параметры
leadIdpath · integerобязательноLead id
Ответ 200 · Lead
id integeraccount_id integerpeer_id integertitle stringusername stringphone stringstatus stringscore integertags string[]summary stringdata objectlast_message_at string (date-time)
curl https://chatvendor.net/api/v1/leads/42 \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
PATCH
/leads/{leadId}
Update a lead
leads:write
Право: leads:write
Параметры
leadIdpath · integerобязательноLead id
Ответ 200 · Lead
id integeraccount_id integerpeer_id integertitle stringusername stringphone stringstatus stringscore integertags string[]summary stringdata objectlast_message_at string (date-time)
curl -X PATCH https://chatvendor.net/api/v1/leads/42 \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
DELETE
/leads/{leadId}
Delete a lead
leads:write
Право: leads:write
Параметры
leadIdpath · integerобязательноLead id
Ответ 200
OK
curl -X DELETE https://chatvendor.net/api/v1/leads/42 \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"