Skip to main content
POST
/
v1
/
channels
Create a channel
curl --request POST \
  --url https://api.cuadra.ai/v1/channels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "channelType": "sms",
  "phoneNumber": "<string>",
  "botToken": "<string>",
  "systemPromptId": "<string>",
  "modelId": "<string>",
  "datasetIds": [
    "<string>"
  ],
  "welcomeMessage": "<string>",
  "fallbackMessage": "<string>"
}
'
{
  "id": "<string>",
  "organizationId": "<string>",
  "name": "<string>",
  "channelType": "sms",
  "webhookUrl": "<string>",
  "systemPromptId": "<string>",
  "modelId": "<string>",
  "datasetIds": [
    "<string>"
  ],
  "welcomeMessage": "<string>",
  "fallbackMessage": "<string>",
  "status": "active",
  "lastError": "<string>",
  "lastErrorAt": "2023-11-07T05:31:56Z",
  "conversationCount": 123,
  "messageCount": 123,
  "lastMessageAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "phoneNumber": "<string>"
}

Authorizations

Authorization
string
header
required

JWT token from Stytch B2B authentication (magic link, SSO, or M2M)

Body

application/json

Request schema for creating a channel. Required fields vary by channel type: - SMS/WhatsApp: phoneNumber (E.164 format) - Telegram: botToken

name
string
required

Endpoint name

Required string length: 1 - 255
channelType
enum<string>
required

sms, whatsapp, or telegram

Available options:
sms,
whatsapp,
telegram,
slack
phoneNumber
string | null

E.164 phone number (required for SMS/WhatsApp)

botToken
string | null

Bot token from @BotFather (required for Telegram)

systemPromptId
string | null
modelId
string | null
datasetIds
string[]
welcomeMessage
string | null
fallbackMessage
string | null

Response

Successful Response

Response schema for a channel.

id
string
required
organizationId
string
required
name
string
required
channelType
enum<string>
required

Supported channel types.

Available options:
sms,
whatsapp,
telegram,
slack
webhookUrl
string
required

Configure in your provider console

systemPromptId
string | null
required
modelId
string | null
required
datasetIds
string[]
required
welcomeMessage
string | null
required
fallbackMessage
string
required
status
enum<string>
required
Available options:
active,
paused,
error
lastError
string | null
required
lastErrorAt
string<date-time> | null
required
conversationCount
integer
required
messageCount
integer
required
lastMessageAt
string<date-time> | null
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
phoneNumber
string | null