Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
actions
Create WhatsApp Action
curl --request POST \
  --url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/actions \
  --header 'Authorization: <authorization>'
{
  "ctx_id": "<string>",
  "data": {
    "action_id": "<string>",
    "name": "<string>",
    "type": "<string>"
  }
}

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Action display name. Example: My Whatsapp Action
description
string
required
Action purpose. Example: Send WhatsApp when user requests messaging
type
string
required
Action type: "SEND_WHATSAPP"
is_active
boolean
Enable/disable action
action_timing
string
required
When to trigger: "during"
phone_number
string
Override phone number (optional)
webhook
object
required
WhatsApp webhook configuration

WhatsApp Configuration

webhook.to
string
required
Recipient WhatsApp number. Example: "12817126508"
webhook.from
string
required
Sender WhatsApp ID. Example: "650175178190170"
webhook.template_name
string
required
WhatsApp template name. Example: "call_permession_request"
webhook.body_params
array
Template body parameters []
webhook.header_params
array
Template header parameters []
webhook.button_params
array
Template button parameters []
webhook.language_code
string
Template language. Example: "en"
webhook.mandatory
boolean
Require WhatsApp response before proceeding

Response

201 Created - WhatsApp action created successfully
ctx_id
string
Request context ID
data
object
action_id
string
New WhatsApp action ID
name
string
Action name
type
string
”SEND_WHATSAPP”
400 Bad Request - Invalid WhatsApp template or numbers 401 Unauthorized - Invalid token