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>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "action_timing": "<string>",
  "webhook": {
    "mandatory": true
  },
  "type": "<string>",
  "sms": {
    "to": {
      "value": [
        "<string>"
      ]
    },
    "provider": "<string>",
    "from": "<string>",
    "cc": [
      "<string>"
    ],
    "body": {
      "value": "<string>"
    },
    "response_message_context": "<string>"
  }
}
'
{
  "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"
webhook
object
Webhook configuration
mandatory
boolean
Require confirmation.
type
string
required
Action type: "SEND_SMS"
sms
object
required
SMS configuration object
to
object
Recipient phone numbers
value
string[]
required
provider
string
SMS provider: "TWILIO"
from
string
Sender phone number. Example: "+13465507166"
cc
string[]
CC recipients []
body
object
SMS message content
value
string
Message template
value
string
response_message_context
string
Response message context. Example: I’ve just sent you a text message. Please let me know if you received it.

SMS Configuration

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