Connect a channel
Connect a channel. The required fields depend on channel; no credential is ever returned. Discord (channel: discord) — supply application_id and bot_token, plus the modes selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: 400 invalid_bot_token when Discord rejects it, 400 application_mismatch when it belongs to another application. Returns 501 when the deployment has no CHANNEL_TOKEN_KEY configured. WhatsApp (default) — one of two credential paths, both filling the same write-only secret:
-
BYOT (credential_source: byot, default) — supply phone_number_id and access_token from your own Meta app.
-
Embedded signup (credential_source: embedded_signup) — supply code and waba_id from the Meta popup; naturali exchanges the code for the token, subscribes its app to the WABA and registers the number for sending when it is not yet, so the customer never hands over a token. Returns 501 on deployments where Meta App credentials are not configured.
The project's plan limits how many channels it may hold. At the limit this responds 403 with plan_limit_reached, whose details carry the plan and the limit, before any credential is acquired. Only active channels count, so disabling one frees allowance without deleting it.
Request
- Base URL: https://api.naturali.ai
- URL: https://api.naturali.ai/v1/projects/{project_id}/channels
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)
Request body
Example request
{
"idempotency_key": "signup-2026-09-18-acct-42",
"default": {
"action": "agent",
"agent_id": "agent_V1StGXR8Z5jdHi6B",
"text": "Subscribe at https://example.com/pricing",
"language": "en-US"
},
"max_context_messages": 20,
"channel": "whatsapp",
"phone_number_id": "109999999999999",
"credential_source": "byot",
"access_token": "EAAG...ZDZD",
"code": "AQD...abc",
"pin": "123456",
"waba_id": "104444444444444",
"application_id": "1290000000000000000",
"bot_token": "MT2...bot-token",
"modes": {
"dms": true
}
}Response
Channel created.
Example response
{
"id": "chan_V1StGXR8Z5jdHi6B",
"project_id": "proj_V1StGXR8Z5jdHi6B",
"channel": "whatsapp",
"status": "active",
"credential_source": "byot",
"phone_number_id": "109999999999999",
"waba_id": "104444444444444",
"display_phone_number": "+55 11 90000-0001",
"verified_name": "Acme Suporte",
"application_id": "1290000000000000000",
"modes": {
"dms": true
},
"default": {
"action": "agent",
"agent_id": "agent_V1StGXR8Z5jdHi6B",
"text": "Subscribe at https://example.com/pricing",
"language": "en-US",
"config": {
"media": {
"audio": "transcribe"
},
"discord": {
"allowed_role_ids": [
"1290000000000000042"
]
}
}
},
"max_context_messages": 20,
"has_credential": true,
"gateway_error": {
"close_code": 4004
},
"created_at": "2026-07-23T00:00:00.000Z",
"updated_at": "2026-07-23T00:00:00.000Z"
}Changes
No recorded changes to this operation across all 1 revision of this API.