Developer platform · v2

API reference

View as MarkdownAll docs

Chat channels

12 operations · all resources

What this covers#

Connect a channel of your own to one of your agents, and the agent answers everyone who writes to it: a Telegram bot made with @BotFather (its webhook is set for you), or a WhatsApp number or Instagram professional account on your own Meta app (paste the response's webhook_url and meta.verify_token into the app's webhook settings). Tokens and secrets are sent once and never returned. WhatsApp and Instagram replies go out only within Meta's 24-hour window.

Every example below runs as written once these are exported:

bash
export DVAARIK_API_KEY="dvk_..."        # project API key, server side only
export DVAARIK_TOKEN="<account access token>"   # console session, from POST /console/auth/login
export CHANNEL_ID="<uuid>"
export PROJECT_ID="<uuid>"

A <value> inside a JSON body is a value you supply. Responses are JSON; every error body is { "detail": … }. Each schema is expanded once per page, where it first appears.

Machine door errors#

Raised by the project-key dependency before any handler on this page runs.

StatusCause
401Missing API key or Invalid API key — the X-Api-Key header is absent, unknown, or revoked.
403API key is not scoped to a project, Project unavailable, or API key is missing the required scope '<scope>'.
429The project's api_rpm ceiling was exceeded. Honour Retry-After; X-RateLimit-* headers are on every response.

Scopes used on this page: channel:read, channel:write. Mint a key with only these.

Account door errors#

StatusCause
401No account session was presented, or it is invalid or expired. Refresh once, then re-authenticate.
403The account is suspended or its email is not verified.

Operations — project API key#

Call these from your own server with a project key. Never from a browser or a mobile bundle.

GET /v2/chat-channels#

List the project's channels with their state, webhook address, limits and, for WhatsApp and Instagram, what to paste into the Meta app. Never a token or a secret.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:read
OperationlistChatChannels
Success200 ChatChannelPage

ChatChannelPage#

FieldTypeRequiredNotes
dataChatChannelInfo[]yes

ChatChannelInfo#

FieldTypeRequiredNotes
account_idstring or nullyes
account_namestring or nullyes
agent_iduuid or nullyes
checked_atdate-time or nullyes
created_atdate-timeyes
disconnected_atdate-time or nullyes
iduuidyes
last_errorstring or nullyes
last_error_atdate-time or nullyes
metaChatChannelMeta or nullno
namestringyes
pending_updatesinteger or nullyes
provider"telegram" or "whatsapp" or "instagram" or "api"yes
replies_per_dayintegeryes
replies_per_minuteintegeryes
status"active" or "error" or "disconnected"yes
turns_per_hourintegeryes
updated_atdate-timeyes
webhook_urlstringyes

ChatChannelMeta#

WhatsApp and Instagram: what to paste into your Meta app, and what Meta says about the account.

FieldTypeRequiredNotes
display_phone_numberstring or nullno
subscriptionChatChannelSubscription or nullno
token_expires_atdate-time or nullno
token_refreshed_atdate-time or nullno
usernamestring or nullno
verified_namestring or nullno
verify_tokenstringyes
waba_idstring or nullno
webhook_fieldsstring[]yes
webhook_object"whatsapp_business_account" or "instagram"yes

ChatChannelSubscription#

How subscribing your app to the account's webhooks went (Meta's subscribed_apps).

FieldTypeRequiredNotes
atdate-time or nullno
errorstring or nullno
okbooleanyes

FieldErrors#

A 422 from a route that names its fields: every field that failed validation, or one sentence when the request validated and was then refused.

FieldTypeRequiredNotes
detailstring or FieldError[]yesThe fields that failed validation (each named), or a sentence for the developer.
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/v2/chat-channels" \
  -H "X-Api-Key: $DVAARIK_API_KEY"

POST /v2/chat-channels#

Connect a Telegram bot, a WhatsApp number or an Instagram account to an agent. The token is checked with the provider first and a refused one is never stored. A Telegram webhook is set for you; for WhatsApp and Instagram, paste webhook_url and meta.verify_token into your Meta app.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:write
OperationcreateChatChannel
Success201 ChatChannelInfo

Request body: ChatChannelCreate.

ChatChannelCreate#

Connect a channel to one of your agents: your own Telegram bot (its token from @BotFather), or a WhatsApp number or Instagram professional account on your OWN Meta app (the access token, the app secret that signs its webhooks, and the account's id). For WhatsApp and Instagram, paste the response's webhook_url and meta.verify_token into your Meta app's webhook settings.

FieldTypeRequiredNotes
access_tokenstring or nullno
agent_iduuidyes
app_secretstring or nullno
bot_tokenstring or nullno
instagram_account_idstring or nullno
instagram_app_secretstring or nullno
namestringyesmin length 1; max length 120
phone_number_idstring or nullno
provider"telegram" or "whatsapp" or "instagram"yes
replies_per_dayinteger or nullno
replies_per_minuteinteger or nullno
turns_per_hourinteger or nullno
waba_idstring or nullno
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
404The addressed resource does not exist in this key's project. One in another project is deliberately indistinguishable from one that never existed.
409A limit or the resource's state refuses this change; the sentence says which.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X POST "https://api.developers.dvaarik.com/v2/chat-channels" \
  -H "X-Api-Key: $DVAARIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "<agent uuid>",
    "name": "Support bot",
    "provider": "telegram",
    "bot_token": "<token from @BotFather>"
  }'

DELETE /v2/chat-channels/{channel_id}#

Disconnect the channel: it stops answering at once and its credentials are forgotten. A Telegram webhook is deleted while it still points here; a Meta app keeps its callback URL until you change it.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:write
OperationdisconnectChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
404The addressed resource does not exist in this key's project. One in another project is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X DELETE "https://api.developers.dvaarik.com/v2/chat-channels/$CHANNEL_ID" \
  -H "X-Api-Key: $DVAARIK_API_KEY"

GET /v2/chat-channels/{channel_id}#

Read one channel.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:read
OperationgetChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
404The addressed resource does not exist in this key's project. One in another project is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/v2/chat-channels/$CHANNEL_ID" \
  -H "X-Api-Key: $DVAARIK_API_KEY"

PATCH /v2/chat-channels/{channel_id}#

Rename the channel, answer with another agent, change its limits, or give the same account's new credentials: a bot's new token; a new access token, app secret or WABA id. Only the fields you send change; the verify token never does.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:write
OperationupdateChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes

Request body: ChatChannelUpdate.

ChatChannelUpdate#

Rename, answer with another agent, change the limits, or give the SAME account's new credentials: a bot's new token (Telegram); a new access token, app secret or WABA id (WhatsApp, Instagram). A new token is checked against the account before it is saved.

FieldTypeRequiredNotes
access_tokenstring or nullno
agent_iduuid or nullno
app_secretstring or nullno
bot_tokenstring or nullno
instagram_app_secretstring or nullno
namestring or nullno
replies_per_dayinteger or nullno
replies_per_minuteinteger or nullno
turns_per_hourinteger or nullno
waba_idstring or nullno
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
404The addressed resource does not exist in this key's project. One in another project is deliberately indistinguishable from one that never existed.
409A limit or the resource's state refuses this change; the sentence says which.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X PATCH "https://api.developers.dvaarik.com/v2/chat-channels/$CHANNEL_ID" \
  -H "X-Api-Key: $DVAARIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "replies_per_minute": 20
  }'

POST /v2/chat-channels/{channel_id}/check#

Ask the provider now: Telegram's last error and the messages it still holds, or whether Meta still accepts the token, with your app subscribed again. A refused token turns the channel error.

DetailValue
DoorProject API key — X-Api-Key: $DVAARIK_API_KEY
Scopechannel:write
OperationcheckChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
ErrorWhen
401No API key was sent in X-Api-Key, or it is invalid or revoked.
403The API key lacks the scope this route needs, or its account or project is unavailable.
404The addressed resource does not exist in this key's project. One in another project is deliberately indistinguishable from one that never existed.
409A limit or the resource's state refuses this change; the sentence says which.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
429The project's requests-per-minute limit is reached; Retry-After says when to try again.

Plus the machine-door errors above. Full list on the errors page.

bash
curl -sS -X POST "https://api.developers.dvaarik.com/v2/chat-channels/$CHANNEL_ID/check" \
  -H "X-Api-Key: $DVAARIK_API_KEY"

Operations — account session#

The same resource through the console door. These are what the web console calls; both doors return the same shapes.

GET /console/v2/projects/{project_id}/chat-channels#

List the project's channels with their state, webhook address, limits and, for WhatsApp and Instagram, what to paste into the Meta app. Never a token or a secret.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleListChatChannels
Success200 ChatChannelPage
ParameterInTypeRequiredNotes
project_idpathuuidyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

POST /console/v2/projects/{project_id}/chat-channels#

Connect a Telegram bot, a WhatsApp number or an Instagram account to an agent. The token is checked with the provider first and a refused one is never stored. A Telegram webhook is set for you; for WhatsApp and Instagram, paste webhook_url and meta.verify_token into your Meta app.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleCreateChatChannel
Success201 ChatChannelInfo
ParameterInTypeRequiredNotes
project_idpathuuidyes

Request body: ChatChannelCreate.

ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
409The project or resource is in a state that refuses this change.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X POST "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels" \
  -H "Authorization: Bearer $DVAARIK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "<agent uuid>",
    "name": "Support bot",
    "provider": "telegram",
    "bot_token": "<token from @BotFather>"
  }'

DELETE /console/v2/projects/{project_id}/chat-channels/{channel_id}#

Disconnect the channel: it stops answering at once and its credentials are forgotten. A Telegram webhook is deleted while it still points here; a Meta app keeps its callback URL until you change it.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleDisconnectChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
project_idpathuuidyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
409The project or resource is in a state that refuses this change.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X DELETE "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels/$CHANNEL_ID" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

GET /console/v2/projects/{project_id}/chat-channels/{channel_id}#

Read one channel.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleGetChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
project_idpathuuidyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels/$CHANNEL_ID" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

PATCH /console/v2/projects/{project_id}/chat-channels/{channel_id}#

Rename the channel, answer with another agent, change its limits, or give the same account's new credentials: a bot's new token; a new access token, app secret or WABA id. Only the fields you send change; the verify token never does.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleUpdateChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
project_idpathuuidyes

Request body: ChatChannelUpdate.

ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
409The project or resource is in a state that refuses this change.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X PATCH "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels/$CHANNEL_ID" \
  -H "Authorization: Bearer $DVAARIK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "replies_per_minute": 20
  }'

POST /console/v2/projects/{project_id}/chat-channels/{channel_id}/check#

Ask the provider now: Telegram's last error and the messages it still holds, or whether Meta still accepts the token, with your app subscribed again. A refused token turns the channel error.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleCheckChatChannel
Success200 ChatChannelInfo
ParameterInTypeRequiredNotes
channel_idpathuuidyes
project_idpathuuidyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
409The project or resource is in a state that refuses this change.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X POST "https://api.developers.dvaarik.com/console/v2/projects/$PROJECT_ID/chat-channels/$CHANNEL_ID/check" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

Try it without a key in the browser

The playground opens a real voice session with your account session, so a project key never reaches a browser. Machine calls belong on your own server.