Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
actions
Create SMS 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 SMS Action
description
string
required
Action purpose. Example: Trigger SMS when user requests messaging
action_timing
string
required
When to trigger: "DURING"
type
string
required
Action type: "SEND_SMS"
webhook
object
Webhook configuration
sms
object
required
SMS configuration object

SMS Configuration

sms.to
object
Recipient phone numbers
value
array
[] - Array of E.164 phone numbers
sms.provider
string
SMS provider: "TWILIO"
sms.from
string
Sender phone number. Example: "+13465507166"
sms.cc
array
CC recipients []
sms.body
object
SMS message content
value
string
Message template
sms.response_message_context
string
Context for response messages

Response

201 Created - SMS action created successfully
ctx_id
string
Request context ID
data
object
action_id
string
New SMS action ID
name
string
Action name
type
string
”SEND_SMS”
400 Bad Request - Invalid SMS configuration or missing fields 401 Unauthorized - Invalid token