Connect a channel
POST/v1/projects/:project_id/channels
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) — supplyphone_number_idandaccess_tokenfrom your own Meta app. -
Embedded signup (
credential_source: embedded_signup) — supplycodeandwaba_id(and optionallypin) from the Meta popup; naturali exchanges thecodefor the token and subscribes its app to the WABA, so the customer never hands over a token. Returns501on 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
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 501
- 502
Channel created.
The request was malformed or failed validation.
Missing or invalid credentials.
The credential is scoped to a different project, or the caller's role in the project does not carry this action.
The resource does not exist (existence is not leaked).
The request conflicts with the resource's current state.
The requested path is not enabled on this deployment (e.g. embedded signup before Meta App credentials are configured, or a Discord channel before CHANNEL_TOKEN_KEY is set).
The upstream runtime, or Meta, could not complete the operation.