{"openapi":"3.1.0","info":{"title":"ChatVendor API","version":"1.0","description":"SMS through your own Android phones plus Telegram automation (chats, leads, scenarios, AI) under one API key. Every response is {\"success\": bool, \"data\": …} or {\"success\": false, \"error\": {\"code\", \"message\"}}.","contact":{"url":"https://chatvendor.net"}},"servers":[{"url":"https://chatvendor.net/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"SMS"},{"name":"Telegram"},{"name":"Telegram groups"},{"name":"Telegram more"},{"name":"WhatsApp"},{"name":"Instagram"},{"name":"Messenger"},{"name":"Viber"},{"name":"Website chat"},{"name":"Contacts"},{"name":"Sales"},{"name":"Bookings"},{"name":"Marketing"},{"name":"Leads"},{"name":"Scenarios"},{"name":"AI"},{"name":"Webhooks"}],"paths":{"/messages":{"post":{"tags":["SMS"],"summary":"Queue an SMS","security":[{"apiKey":["messages:send"]}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SmsMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","message"],"properties":{"to":{"type":"string","example":"+998901234567","description":"International format; local numbers need default_region"},"message":{"type":"string","example":"Your code is 483921"},"device_id":{"type":"string","description":"Send from this phone only — fails rather than silently using another"},"sim_id":{"type":"string","description":"A specific SIM of that device"},"priority":{"type":"string","enum":["low","normal","high"],"description":"high jumps the queue; rate limits still apply"},"client_reference":{"type":"string","description":"Your own id, returned and filterable"},"schedule_at":{"type":"string","format":"date-time","description":"Send at this time (ISO 8601)"},"expires_in":{"type":"integer","description":"Seconds (30–86400): expires instead of arriving late"},"callback_url":{"type":"string","format":"uri","description":"Per-message webhook (unsigned)"},"consent_category":{"type":"string","enum":["transactional","otp","notification","marketing"]},"default_region":{"type":"string","description":"Two-letter country for local-format numbers"}}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","description":"Retrying with the same key returns the original response instead of sending twice","schema":{"type":"string"}}]},"get":{"tags":["SMS"],"summary":"List SMS messages","security":[{"apiKey":["messages:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/SmsMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"device_id","in":"query","schema":{"type":"string"}},{"name":"client_reference","in":"query","schema":{"type":"string"}},{"name":"per_page","in":"query","schema":{"type":"integer"}}]}},"/messages/{message}":{"get":{"tags":["SMS"],"summary":"SMS status and timeline","security":[{"apiKey":["messages:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SmsMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"message","in":"path","required":true,"description":"Message public id","schema":{"type":"string"}}]}},"/messages/{message}/cancel":{"post":{"tags":["SMS"],"summary":"Cancel a queued SMS","security":[{"apiKey":["messages:send"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/SmsMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"message","in":"path","required":true,"description":"Message public id","schema":{"type":"string"}}]}},"/devices":{"get":{"tags":["SMS"],"summary":"List paired phones","security":[{"apiKey":["devices:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Device"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/{device}":{"get":{"tags":["SMS"],"summary":"One device","security":[{"apiKey":["devices:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Device"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"device","in":"path","required":true,"description":"Device public id","schema":{"type":"string"}}]}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"apiKey":["webhooks:manage"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","security":[{"apiKey":["webhooks:manage"]}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","device.online","device.offline","chat.message","chat.message.edited","chat.message.deleted","chat.action","chat.reaction","chat.operator_requested","lead.new","lead.updated","scenario.done","scenario.failed","scenario.cancelled","channel.connected","channel.disconnected","channel.revoked","bot.callback","bot.inline_query","bot.inline_chosen","bot.precheckout","bot.shipping","bot.join_request","bot.stopped","bot.reaction","bot.business_message","bot.paid_media","bot.payment","call.incoming","call.ended","call.group","secret.chat","contact.referral","contact.link_click","contact.updated","comment.new","order.created","order.paid","order.expired","order.updated","booking.created","booking.confirmed","booking.cancelled"]}}}}}}}}},"/webhooks/{webhook}":{"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint","security":[{"apiKey":["webhooks:manage"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"webhook","in":"path","required":true,"description":"Webhook public id","schema":{"type":"string"}}]},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","security":[{"apiKey":["webhooks:manage"]}],"responses":{"204":{"description":"Deleted"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"webhook","in":"path","required":true,"description":"Webhook public id","schema":{"type":"string"}}]}},"/me":{"get":{"tags":["Telegram"],"summary":"Workspace, plan and number of channels","security":[{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Me"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/channels":{"get":{"tags":["Telegram"],"summary":"Connected Telegram accounts","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/channels/{id}":{"get":{"tags":["Telegram"],"summary":"One channel","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Channel"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/{id}/dialogs":{"get":{"tags":["Telegram"],"summary":"Chats of a channel","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"type","in":"query","schema":{"type":"string","enum":["user","bot","group","supergroup","channel"]}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"per_page","in":"query","schema":{"type":"integer"}},{"name":"live","in":"query","description":"1 = refresh from Telegram first","schema":{"type":"integer"}}]}},"/channels/{id}/dialogs/{peer}/messages":{"get":{"tags":["Telegram"],"summary":"Messages of a chat","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"before","in":"query","schema":{"type":"integer"}},{"name":"after","in":"query","schema":{"type":"integer"}},{"name":"live","in":"query","schema":{"type":"integer"}}]},"post":{"tags":["Telegram"],"summary":"Send a text message","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"},"reply_to":{"type":"integer"},"parse_mode":{"type":"string","enum":["md","html","none"]},"silent":{"type":"boolean"},"schedule":{"type":"string","format":"date-time"}}}}}}}},"/channels/{id}/dialogs/{peer}/file":{"post":{"tags":["Telegram"],"summary":"Send a file (multipart/form-data: file, caption, as=auto|document|voice)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/dialogs/{peer}/forward":{"post":{"tags":["Telegram"],"summary":"Forward messages","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","to_peer"],"properties":{"ids":{"type":"array","items":{"type":"integer"}},"to_peer":{"type":"string"},"drop_author":{"type":"boolean"}}}}}}}},"/channels/{id}/dialogs/{peer}/delete":{"post":{"tags":["Telegram"],"summary":"Delete messages","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"integer"}},"revoke":{"type":"boolean"}}}}}}}},"/channels/{id}/dialogs/{peer}/read":{"post":{"tags":["Telegram"],"summary":"Mark a chat as read","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/dialogs/{peer}/messages/{message}/media":{"get":{"tags":["Telegram"],"summary":"Download media (?thumb=1 for a thumbnail)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"The file"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"message","in":"path","required":true,"description":"Message id","schema":{"type":"integer"}}]}},"/channels/{id}/peers/{peer}":{"get":{"tags":["Telegram"],"summary":"User / group info","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Peer"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/resolve":{"get":{"tags":["Telegram"],"summary":"Resolve @username, t.me link or phone to a peer","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Peer"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"q","in":"query","required":true,"schema":{"type":"string"}}]}},"/channels/{id}/contacts":{"get":{"tags":["Contacts"],"summary":"Contact cards (tags, variables, points, referrals); id = Telegram account, wa_{id} or ig_{id}. Query: tag, q, var, limit, offset","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]},"post":{"tags":["Telegram"],"summary":"Add a contact","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Peer"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","first_name"],"properties":{"phone":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/channels/{id}/chats/{peer}/members":{"get":{"tags":["Telegram groups"],"summary":"Group members","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Peer"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"filter","in":"query","schema":{"type":"string","enum":["admins","bots","kicked","banned"]}},{"name":"limit","in":"query","schema":{"type":"integer"}}]}},"/channels/{id}/chats/join":{"post":{"tags":["Telegram groups"],"summary":"Join a group or channel","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Peer"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["link"],"properties":{"link":{"type":"string"}}}}}}}},"/channels/{id}/dialogs/{peer}/album":{"post":{"tags":["Telegram"],"summary":"Send an album (multipart/form-data: files[] 2–10, caption, reply_to, topic)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/dialogs/{peer}/media":{"post":{"tags":["Telegram"],"summary":"Send existing media by ref (sticker, saved GIF, media from any message)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ref"],"properties":{"ref":{"type":"string"},"caption":{"type":"string"},"reply_to":{"type":"integer"},"topic":{"type":"integer"},"spoiler":{"type":"boolean"},"schedule":{"type":"string","format":"date-time"}}}}}}}},"/channels/{id}/dialogs/{peer}/messages/{message}/click":{"post":{"tags":["Telegram"],"summary":"Press a bot keyboard button (by data, text or index)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ButtonAnswer"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"message","in":"path","required":true,"description":"Message id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"data":{"type":"string"},"text":{"type":"string"},"index":{"type":"integer"}}}}}}}},"/channels/{id}/dialogs/{peer}/messages/{message}/link":{"get":{"tags":["Telegram"],"summary":"Public t.me link of a channel/group message","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Link"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"message","in":"path","required":true,"description":"Message id","schema":{"type":"integer"}}]}},"/channels/{id}/dialogs/{peer}/messages/{message}/replies":{"get":{"tags":["Telegram"],"summary":"Comments under a post / replies in a topic","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MessagePage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"message","in":"path","required":true,"description":"Message id","schema":{"type":"integer"}}]}},"/channels/{id}/dialogs/{peer}/mentions":{"get":{"tags":["Telegram"],"summary":"Unread mentions (?reactions=1: unseen reactions to our messages)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MessagePage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/dialogs/{peer}/draft":{"put":{"tags":["Telegram"],"summary":"Save the chat draft (empty text clears it)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"reply_to":{"type":"integer"},"topic":{"type":"integer"}}}}}}}},"/channels/{id}/search":{"get":{"tags":["Telegram"],"summary":"Full-text search across all chats","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/MessagePage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","schema":{"type":"string","enum":["users","groups","channels"]}},{"name":"limit","in":"query","schema":{"type":"integer"}}]}},"/channels/{id}/translate":{"post":{"tags":["Telegram"],"summary":"Translate text or messages with Telegram's translator","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Translation"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string","description":"ISO 639-1"},"text":{"type":"string"},"peer":{"type":"string"},"ids":{"type":"array","items":{"type":"integer"}}}}}}}}},"/channels/{id}/preview":{"get":{"tags":["Telegram"],"summary":"Link preview Telegram would attach to this text","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/WebPage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"text","in":"query","required":true,"schema":{"type":"string"}}]}},"/channels/{id}/stickers/sets":{"get":{"tags":["Telegram more"],"summary":"Installed sticker sets","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StickerSet"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/{id}/stickers/sets/{name}":{"get":{"tags":["Telegram more"],"summary":"Stickers of a set (each with a ref to send)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/StickerSetContents"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"name","in":"path","required":true,"description":"Set short name","schema":{"type":"string"}}]}},"/channels/{id}/stickers/gifs":{"get":{"tags":["Telegram more"],"summary":"Saved GIFs (each with a ref to send)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/{id}/chats/{peer}/topics":{"get":{"tags":["Telegram groups"],"summary":"Forum topics of a supergroup","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Topic"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]},"post":{"tags":["Telegram groups"],"summary":"Create a forum topic","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Topic"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"icon_color":{"type":"integer"},"icon_emoji_id":{"type":"integer"}}}}}}}},"/channels/{id}/chats/{peer}/topics/{topic}":{"patch":{"tags":["Telegram groups"],"summary":"Rename / close / hide / pin a topic","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"topic","in":"path","required":true,"description":"Topic id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"title":{"type":"string"},"closed":{"type":"boolean"},"hidden":{"type":"boolean"},"pinned":{"type":"boolean"}}}}}}}},"/channels/{id}/chats/{peer}/settings":{"patch":{"tags":["Telegram groups"],"summary":"Channel/supergroup switches (only the fields sent are applied)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Applied"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"username":{"type":"string"},"signatures":{"type":"boolean"},"join_to_send":{"type":"boolean"},"join_request":{"type":"boolean"},"slowmode":{"type":"integer","enum":[0,10,30,60,300,900,3600]},"noforwards":{"type":"boolean"},"discussion":{"type":"string"},"reactions":{"description":"\"all\" | \"none\" | [\"👍\", \"❤\"]"},"history_hidden":{"type":"boolean"},"forum":{"type":"boolean"}}}}}}}},"/channels/{id}/chats/{peer}/invite-links":{"get":{"tags":["Telegram groups"],"summary":"Invite links of a group/channel","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InviteLink"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]},"post":{"tags":["Telegram groups"],"summary":"Create an invite link","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/InviteLink"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"title":{"type":"string"},"expire":{"type":"string","format":"date-time"},"usage_limit":{"type":"integer"},"request_needed":{"type":"boolean"}}}}}}}},"/channels/{id}/folders":{"get":{"tags":["Telegram more"],"summary":"Chat folders","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]},"post":{"tags":["Telegram more"],"summary":"Create a chat folder","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Folder"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"emoticon":{"type":"string"},"include":{"type":"array","items":{"type":"string"}},"exclude":{"type":"array","items":{"type":"string"}},"contacts":{"type":"boolean"},"non_contacts":{"type":"boolean"},"groups":{"type":"boolean"},"broadcasts":{"type":"boolean"},"bots":{"type":"boolean"},"exclude_muted":{"type":"boolean"},"exclude_read":{"type":"boolean"},"exclude_archived":{"type":"boolean"}}}}}}}},"/channels/{id}/folders/{folder}":{"patch":{"tags":["Telegram more"],"summary":"Edit a chat folder","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Folder"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"folder","in":"path","required":true,"description":"Folder id","schema":{"type":"integer"}}]},"delete":{"tags":["Telegram more"],"summary":"Delete a chat folder","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"folder","in":"path","required":true,"description":"Folder id","schema":{"type":"integer"}}]}},"/channels/{id}/business":{"get":{"tags":["Telegram more"],"summary":"Telegram Business settings (hours, location, greeting/away, intro, quick replies)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Business"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/{id}/business/quick-replies":{"get":{"tags":["Telegram more"],"summary":"Quick-reply shortcuts","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/QuickReply"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]},"post":{"tags":["Telegram more"],"summary":"Add a message to a quick-reply shortcut (Premium)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["shortcut","text"],"properties":{"shortcut":{"type":"string"},"text":{"type":"string"}}}}}}}},"/channels/{id}/business/quick-replies/{shortcut}/send":{"post":{"tags":["Telegram more"],"summary":"Send a quick reply to a chat","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"shortcut","in":"path","required":true,"description":"Shortcut id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["peer"],"properties":{"peer":{"type":"string"}}}}}}}},"/channels/{id}/business/links":{"get":{"tags":["Telegram more"],"summary":"Business chat links (t.me/m/…)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/BusinessLink"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]},"post":{"tags":["Telegram more"],"summary":"Create a business chat link (Premium)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/BusinessLink"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"},"title":{"type":"string"}}}}}}}},"/channels/wa_{id}/dialogs":{"get":{"tags":["WhatsApp"],"summary":"WhatsApp: chats of a number","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"unread","in":"query","schema":{"type":"integer"}}]}},"/channels/wa_{id}/dialogs/{peer}/messages":{"get":{"tags":["WhatsApp"],"summary":"WhatsApp: messages of a chat (peer = phone in international format)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]},"post":{"tags":["WhatsApp"],"summary":"WhatsApp: send text, an approved template, or reply buttons","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"reply_to":{"type":"integer"},"template":{"type":"string"},"language":{"type":"string"},"components":{"type":"array","items":{"type":"object"}},"buttons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}}}}}}}}}}},"/channels/wa_{id}/dialogs/{peer}/file":{"post":{"tags":["WhatsApp"],"summary":"WhatsApp: send a file (multipart: file, caption, as=auto|document|voice)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/wa_{id}/dialogs/{peer}/read":{"post":{"tags":["WhatsApp"],"summary":"WhatsApp: mark the chat as read","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/wa_{id}/dialogs/{peer}/messages/{message}/media":{"get":{"tags":["WhatsApp"],"summary":"WhatsApp: download media","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"The file"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}},{"name":"message","in":"path","required":true,"description":"Message id","schema":{"type":"integer"}}]}},"/channels/wa_{id}/templates":{"get":{"tags":["WhatsApp"],"summary":"WhatsApp: message templates of the number","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/ig_{id}/dialogs":{"get":{"tags":["Instagram"],"summary":"Instagram: Direct chats of the account (peer = IGSID; rows carry kind: comment | story_reply | story_mention)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/ig_{id}/dialogs/{peer}/messages":{"get":{"tags":["Instagram"],"summary":"Instagram: messages of a chat","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]},"post":{"tags":["Instagram"],"summary":"Instagram: send text or quick-reply buttons; reply_to + public_reply=true answers a comment row publicly, otherwise the first message to a commenter goes as a private reply","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"buttons":{"type":"array","items":{"type":"string"}},"reply_to":{"type":"integer"},"public_reply":{"type":"boolean"}}}}}}}},"/channels/ig_{id}/dialogs/{peer}/file":{"post":{"tags":["Instagram"],"summary":"Instagram: send a file (multipart: file, caption, as=auto|document|voice)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/ig_{id}/dialogs/{peer}/read":{"post":{"tags":["Instagram"],"summary":"Instagram: mark seen","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]}},"/channels/{id}/contacts/{peer}":{"get":{"tags":["Contacts"],"summary":"One contact card","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Contact"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}]},"patch":{"tags":["Contacts"],"summary":"Change tags / variables / notes of a contact","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Contact"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"tags":{"type":"array","items":{"type":"string"}},"add_tags":{"type":"array","items":{"type":"string"}},"remove_tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object"},"notes":{"type":"string"}}}}}}}},"/channels/{id}/contacts/{peer}/points":{"post":{"tags":["Contacts"],"summary":"Add / deduct points (ref deduplicates)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"delta":{"type":"integer"},"reason":{"type":"string"},"ref":{"type":"string"}}}}}}}},"/channels/{id}/leaderboard":{"get":{"tags":["Contacts"],"summary":"Points leaderboard","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/{id}/links":{"get":{"tags":["Contacts"],"summary":"Tracked links ({{link:name}} placeholders) with click counts","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]},"post":{"tags":["Contacts"],"summary":"Create / update a tracked link","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"name":{"type":"string"},"url":{"type":"string"},"tag":{"type":"string"},"peer_id":{"type":"integer"}}}}}}}},"/channels/fb_{id}/dialogs":{"get":{"tags":["Messenger"],"summary":"Messenger (Facebook Page): chats (peer = PSID). Messages, file, read, media: the same paths as WhatsApp with fb_{id}","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/fb_{id}/dialogs/{peer}/messages":{"post":{"tags":["Messenger"],"summary":"Messenger: send text (buttons = quick replies; reply_to + public_reply answers a comment in the thread)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"reply_to":{"type":"integer"},"buttons":{"type":"array","items":{"type":"string"}}}}}}}}},"/channels/vb_{id}/dialogs":{"get":{"tags":["Viber"],"summary":"Viber bot: chats (peer = local id; user ids are strings). Messages, file, read, media: the same paths as WhatsApp with vb_{id}","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/vb_{id}/dialogs/{peer}/messages":{"post":{"tags":["Viber"],"summary":"Viber: send text (buttons = reply keyboard, up to 24; a button may carry url)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"buttons":{"type":"array","items":{"type":"string"}}}}}}}}},"/channels/web_{id}/dialogs":{"get":{"tags":["Website chat"],"summary":"Website widget: visitor chats (peer = visitor id). Messages, file, read, media: the same paths as WhatsApp with web_{id}","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}]}},"/channels/web_{id}/dialogs/{peer}/messages":{"post":{"tags":["Website chat"],"summary":"Website widget: send text to a visitor (buttons render as chips; a button may carry url)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ChatMessage"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"peer","in":"path","required":true,"description":"Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string"},"buttons":{"type":"array","items":{"type":"string"}}}}}}}}},"/services":{"get":{"tags":["Bookings"],"summary":"Bookable services (duration, price)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/services/{service}/slots":{"get":{"tags":["Bookings"],"summary":"Free time slots of a service on a date (?date=YYYY-MM-DD, Asia/Tashkent)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"service","in":"path","required":true,"description":"Service id","schema":{"type":"integer"}},{"name":"date","in":"query","schema":{"type":"string"}}]}},"/bookings":{"get":{"tags":["Bookings"],"summary":"Bookings (filters: status, from, to, limit)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bookings"],"summary":"Book a slot (starts_at must be a free slot); channel_id + peer_id link it to a chat so reminders reach the customer","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["service_id","starts_at"],"properties":{"service_id":{"type":"integer"},"starts_at":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"},"note":{"type":"string"},"channel_id":{"type":"string"},"peer_id":{"type":"integer"},"status":{"type":"string","enum":["pending","confirmed"]}}}}}}}},"/bookings/{id}":{"patch":{"tags":["Bookings"],"summary":"Change status (confirmed / cancelled / done / no_show), move (starts_at) or note","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Booking id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"status":{"type":"string"},"starts_at":{"type":"string"},"note":{"type":"string"},"notify":{"type":"boolean"}}}}}}}},"/segments":{"get":{"tags":["Marketing"],"summary":"Saved audiences (segments) with rules and the cached size","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/segments/preview":{"post":{"tags":["Marketing"],"summary":"Count contacts for ad-hoc rules (tags_any, tags_none, vars, active_days, silent_days, purchased, min_points, has_phone, networks, lead_status…)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"rules":{"type":"object","example":{"tags_any":"vip","active_days":30}}}}}}}}},"/segments/{id}/contacts":{"get":{"tags":["Marketing"],"summary":"Members of a segment (channel_id, peer_id, title, phone, tags, points); ?limit=&offset=","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Segment id","schema":{"type":"integer"}}]}},"/campaigns":{"get":{"tags":["Marketing"],"summary":"Drip campaigns (entry rule, steps, enrolled)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}":{"get":{"tags":["Marketing"],"summary":"A campaign with per-step / per-variant stats (sent, replied, converted) and enrolment counts","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Campaign id","schema":{"type":"integer"}}]}},"/campaigns/{id}/enrol":{"post":{"tags":["Marketing"],"summary":"Put a contact into the campaign now (the first step follows its day/hour rule)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Campaign id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"channel_id":{"type":"string","example":"wa_12"},"peer_id":{"type":"string","example":"998901234567"}}}}}}}},"/tasks":{"get":{"tags":["Marketing"],"summary":"Open reminders of the team (?done=1 for finished, ?all=1 for both)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Marketing"],"summary":"Create a reminder; channel_id + peer_id tie it to a chat, user_id assigns it","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"title":{"type":"string"},"due_at":{"type":"string","example":"2026-10-01T09:00:00+05:00"},"note":{"type":"string"},"user_id":{"type":"integer"},"channel_id":{"type":"string"},"peer_id":{"type":"string"}}}}}}}},"/tasks/{id}/done":{"post":{"tags":["Marketing"],"summary":"Mark a reminder done (undo=true reopens)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Task id","schema":{"type":"integer"}}]}},"/shop/products":{"get":{"tags":["Sales"],"summary":"Products of the workspace (name, price, picture, category, stock)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/shop/orders":{"get":{"tags":["Sales"],"summary":"Orders (filters: status, peer_id, product_id, limit)","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sales"],"summary":"Create an order for a contact and get the Payme / Click pay link; send=true posts it into the chat (gateway=telegram: a bot invoice paid with Stars or a provider token)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"channel_id":{"type":"string"},"peer_id":{"type":"integer"},"product_id":{"type":"integer"},"gateway":{"type":"string","enum":["auto","payme","click","telegram","manual"]},"send":{"type":"boolean"},"text":{"type":"string"},"promo":{"type":"string"}}}}}}}},"/shop/orders/{id}":{"get":{"tags":["Sales"],"summary":"One order with its pay link","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Order id","schema":{"type":"integer"}}]}},"/shop/orders/{id}/paid":{"post":{"tags":["Sales"],"summary":"Mark an order paid by hand (fires payment_ok rules, tags, subscription clock)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Order id","schema":{"type":"integer"}}]}},"/shop/orders/{id}/cancel":{"post":{"tags":["Sales"],"summary":"Cancel a pending order or refund a paid one (revokes tags/access)","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Order id","schema":{"type":"integer"}}]}},"/channels/{id}/tg/{path}":{"get":{"tags":["Telegram more"],"summary":"Passthrough to every connector endpoint (read): stars, gifts, calls, mini apps, secret chats, folders, stats… — see the connector catalogue in the docs","security":[{"apiKey":["channels:read"]}],"responses":{"200":{"description":"The connector response under data"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"path","in":"path","required":true,"description":"Connector path, e.g. stars, gifts/catalog, calls, chats/{peer}/call, secret, raw/methods","schema":{"type":"string"}}]},"post":{"tags":["Telegram more"],"summary":"Passthrough to every connector endpoint (write): JSON body or multipart; POST tg/raw {method, params} calls any TL method","security":[{"apiKey":["channels:write"]}],"responses":{"200":{"description":"The connector response under data"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}},{"name":"path","in":"path","required":true,"description":"Connector path, e.g. gifts/send, dialogs/{peer}/todo, bot/send/{peer}, secret/{chat_id}/messages, raw","schema":{"type":"string"}}]}},"/channels/{id}/ai/analyze":{"post":{"tags":["AI"],"summary":"AI analysis of a message photo/file","security":[{"apiKey":["ai:use"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Analysis"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (from GET /channels)","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["peer","message_id"],"properties":{"peer":{"type":"string"},"message_id":{"type":"integer"},"prompt":{"type":"string"},"provider_id":{"type":"integer"},"json_schema":{"type":"object"}}}}}}}},"/leads":{"get":{"tags":["Leads"],"summary":"List leads","security":[{"apiKey":["leads:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}}]},"post":{"tags":["Leads"],"summary":"Create a lead (account_id may be a channel reference such as wa_12); amount = deal value for the pipeline","security":[{"apiKey":["leads:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Lead"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["account_id","peer_id"],"properties":{"account_id":{"type":"string"},"peer_id":{"type":"integer"},"amount":{"type":"number"},"source":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"score":{"type":"integer"},"notes":{"type":"string"}}}}}}}},"/leads/{leadId}":{"get":{"tags":["Leads"],"summary":"One lead","security":[{"apiKey":["leads:read"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Lead"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"leadId","in":"path","required":true,"description":"Lead id","schema":{"type":"integer"}}]},"patch":{"tags":["Leads"],"summary":"Update a lead","security":[{"apiKey":["leads:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Lead"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"leadId","in":"path","required":true,"description":"Lead id","schema":{"type":"integer"}}]},"delete":{"tags":["Leads"],"summary":"Delete a lead","security":[{"apiKey":["leads:write"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Empty"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"leadId","in":"path","required":true,"description":"Lead id","schema":{"type":"integer"}}]}},"/scenario-runs":{"get":{"tags":["Scenarios"],"summary":"Scenario runs","security":[{"apiKey":["scenarios:manage"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ScenarioRun"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/scenario-runs/{runId}/decide":{"post":{"tags":["Scenarios"],"summary":"Approve, reject or cancel a run","security":[{"apiKey":["scenarios:manage"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ScenarioRun"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"runId","in":"path","required":true,"description":"Run id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["decision"],"properties":{"decision":{"type":"string","enum":["approve","reject","cancel"]}}}}}}}},"/ai/chat":{"post":{"tags":["AI"],"summary":"Chat completion with your own provider key","security":[{"apiKey":["ai:use"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/AiReply"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}},"system":{"type":"string"},"provider_id":{"type":"integer"},"max_tokens":{"type":"integer"}}}}}}}},"/ai/providers":{"get":{"tags":["AI"],"summary":"Your AI providers","security":[{"apiKey":["ai:use"]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AiProvider"}},"meta":{"type":"object"}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"cv_live_… / cv_test_…","description":"Scopes: messages:send, messages:read, devices:read, devices:manage, webhooks:manage, analytics:read, channels:read, channels:write, leads:read, leads:write, scenarios:manage, ai:use"}},"schemas":{"Error":{"type":"object","properties":{"success":{"type":"boolean","const":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_API_KEY","API_KEY_EXPIRED","API_KEY_REVOKED","INSUFFICIENT_SCOPE","ORGANIZATION_SUSPENDED","VALIDATION_FAILED","INVALID_PHONE_NUMBER","MESSAGE_TOO_LONG","MESSAGE_NOT_FOUND","BATCH_NOT_FOUND","DEVICE_NOT_FOUND","WEBHOOK_NOT_FOUND","DEVICE_OFFLINE","DEVICE_DISABLED","SIM_UNAVAILABLE","SMS_PERMISSION_MISSING","MESSAGE_NOT_CANCELLABLE","RATE_LIMIT_EXCEEDED","ENTITLEMENT_EXCEEDED","IDEMPOTENCY_KEY_REUSED","IDEMPOTENT_REQUEST_IN_PROGRESS","INVALID_PAIRING_CODE","PAIRING_CODE_EXPIRED","INTERNAL_ERROR","PLAN_REQUIRED","CHANNEL_NOT_FOUND","CHANNEL_NOT_CONNECTED","CONNECTOR_ERROR","FLOOD_WAIT","CHANNEL_REQUEST_FAILED"]},"message":{"type":"string"},"details":{"type":"object"}}}}},"Empty":{"type":"object"},"SmsMessage":{"type":"object","properties":{"id":{"type":"string"},"to":{"type":"string"},"message":{"type":"string"},"status":{"type":"string","enum":["queued","scheduled","assigned","sent","delivered","failed","cancelled","expired"]},"device_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"Device":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"last_seen_at":{"type":"string","format":"date-time"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["message.queued","message.sent","message.delivered","message.failed","device.online","device.offline","chat.message","chat.message.edited","chat.message.deleted","chat.action","chat.reaction","chat.operator_requested","lead.new","lead.updated","scenario.done","scenario.failed","scenario.cancelled","channel.connected","channel.disconnected","channel.revoked","bot.callback","bot.inline_query","bot.inline_chosen","bot.precheckout","bot.shipping","bot.join_request","bot.stopped","bot.reaction","bot.business_message","bot.paid_media","bot.payment","call.incoming","call.ended","call.group","secret.chat","contact.referral","contact.link_click","contact.updated","comment.new","order.created","order.paid","order.expired","order.updated","booking.created","booking.confirmed","booking.cancelled"]}},"enabled":{"type":"boolean"}}},"Me":{"type":"object","properties":{"id":{"type":"integer"},"workspace":{"type":"string"},"plan":{"type":"string"},"accounts":{"type":"integer"},"rate_limit":{"type":"string"}}},"Channel":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["telegram_user","telegram_bot","whatsapp","instagram"]},"name":{"type":"string"},"username":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string"},"connected_at":{"type":"string","format":"date-time"}}},"Dialog":{"type":"object","properties":{"peer_id":{"type":"integer"},"type":{"type":"string"},"title":{"type":"string"},"username":{"type":"string"},"unread_count":{"type":"integer"},"last_message_at":{"type":"string","format":"date-time"},"last_message_text":{"type":"string"}}},"ChatMessage":{"type":"object","properties":{"id":{"type":"integer"},"chat_id":{"type":"integer"},"sender_id":{"type":"integer"},"sender_name":{"type":"string"},"out":{"type":"boolean"},"date":{"type":"string","format":"date-time"},"text":{"type":"string"},"media":{"oneOf":[{"$ref":"#/components/schemas/Media"},{"type":"null"}]},"reply_to":{"type":"integer"},"topic_id":{"type":"integer"},"buttons":{"type":"array","description":"Bot keyboard rows: [{text, type, data|url}]","items":{"type":"array","items":{"type":"object"}}}}},"Peer":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"title":{"type":"string"},"username":{"type":"string"},"phone":{"type":"string"}}},"Lead":{"type":"object","properties":{"id":{"type":"integer"},"account_id":{"type":"integer"},"peer_id":{"type":"integer"},"title":{"type":"string"},"username":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string"},"score":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}},"summary":{"type":"string"},"data":{"type":"object"},"last_message_at":{"type":"string","format":"date-time"}}},"ScenarioRun":{"type":"object","properties":{"id":{"type":"integer"},"scenario_id":{"type":"integer"},"account_id":{"type":"integer"},"peer_id":{"type":"integer"},"status":{"type":"string","enum":["active","waiting","confirm","done","failed","cancelled"]},"step":{"type":"integer"},"data":{"type":"object"}}},"Analysis":{"type":"object","properties":{"id":{"type":"integer"},"text":{"type":"string"},"json":{"type":["object","null"]},"url":{"type":"string"}}},"AiReply":{"type":"object","properties":{"text":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object"}}},"AiProvider":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"type":{"type":"string"},"model":{"type":"string"},"is_default":{"type":"boolean"}}},"Media":{"type":"object","properties":{"type":{"type":"string","enum":["photo","image","document","video","video_note","voice","audio","sticker","gif","webpage"]},"ref":{"type":"string","description":"Pass to /dialogs/{peer}/media to send it again"},"mime":{"type":"string"},"size":{"type":"integer"},"file_name":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"duration":{"type":"number"},"emoji":{"type":"string"}}},"MessagePage":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"count":{"type":"integer"}}},"ButtonAnswer":{"type":"object","properties":{"pressed":{"type":"string"},"message":{"type":"string"},"alert":{"type":"boolean"},"url":{"type":"string"}}},"Link":{"type":"object","properties":{"link":{"type":"string"},"html":{"type":"string"}}},"Translation":{"type":"object","properties":{"text":{"type":"string"}}},"WebPage":{"type":"object","properties":{"url":{"type":"string"},"site_name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"has_photo":{"type":"boolean"}}},"StickerSet":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"short_name":{"type":"string"},"count":{"type":"integer"},"official":{"type":"boolean"},"animated":{"type":"boolean"},"emojis":{"type":"boolean"}}},"StickerSetContents":{"type":"object","properties":{"set":{"$ref":"#/components/schemas/StickerSet"},"stickers":{"type":"array","items":{"$ref":"#/components/schemas/Media"}}}},"Topic":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"closed":{"type":"boolean"},"pinned":{"type":"boolean"},"hidden":{"type":"boolean"},"unread_count":{"type":"integer"},"top_message":{"type":"integer"}}},"Applied":{"type":"object","properties":{"applied":{"type":"array","items":{"type":"string"}}}},"InviteLink":{"type":"object","properties":{"link":{"type":"string"},"title":{"type":"string"},"revoked":{"type":"boolean"},"permanent":{"type":"boolean"},"request_needed":{"type":"boolean"},"usage":{"type":"integer"},"usage_limit":{"type":"integer"},"expire_date":{"type":"string","format":"date-time"}}},"Folder":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"emoticon":{"type":"string"},"include_peers":{"type":"array","items":{"type":"integer"}},"exclude_peers":{"type":"array","items":{"type":"integer"}}}},"Business":{"type":"object","properties":{"work_hours":{"type":["object","null"]},"location":{"type":["object","null"]},"greeting":{"type":["object","null"]},"away":{"type":["object","null"]},"intro":{"type":["object","null"]},"quick_replies":{"type":"array","items":{"$ref":"#/components/schemas/QuickReply"}}}},"QuickReply":{"type":"object","properties":{"id":{"type":"integer"},"shortcut":{"type":"string"},"count":{"type":"integer"}}},"Template":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"category":{"type":"string"},"language":{"type":"string"},"body":{"type":"string"}}},"Contact":{"type":"object","properties":{"peer_id":{"type":"integer"},"title":{"type":"string"},"username":{"type":"string"},"type":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"vars":{"type":"object"},"points":{"type":"integer"},"referrals_count":{"type":"integer"},"referrer_peer_id":{"type":"integer"},"ref_code":{"type":"string"},"ref_link":{"type":"string"},"notes":{"type":"string"},"converted_at":{"type":"string","format":"date-time"},"last_message_at":{"type":"string","format":"date-time"}}},"BusinessLink":{"type":"object","properties":{"link":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"text":{"type":"string"},"views":{"type":"integer"}}}}}}