Skip to main content
POST
/
v1
/
channels
/
whatsapp
/
oauth
/
initiate
Initiate WhatsApp OAuth
curl --request POST \
  --url https://api.cuadra.ai/v1/channels/whatsapp/oauth/initiate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "redirectUrl": "<string>",
  "name": "<string>",
  "systemPromptId": "<string>",
  "modelId": "<string>",
  "datasetIds": [
    "<string>"
  ],
  "welcomeMessage": "<string>",
  "fallbackMessage": "<string>"
}
'
{
  "authorizationUrl": "<string>",
  "state": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Request to initiate WhatsApp OAuth flow.

redirectUrl
string
required

URL to redirect after OAuth (your frontend callback)

name
string
required

Channel name (used after OAuth completes)

Required string length: 1 - 255
systemPromptId
string | null
modelId
string | null
datasetIds
string[]
welcomeMessage
string | null
fallbackMessage
string | null

Response

Successful Response

Response for WhatsApp OAuth initiation.

authorizationUrl
string
required

Redirect user to this URL

state
string
required

OAuth state token (store for callback verification)

expiresAt
string<date-time>
required

State token expiration time