Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
campaign
/
create_with_touchpoint
Create Campaign with WhatsApp Touchpoint
curl --request POST \
  --url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/campaign/create_with_touchpoint \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "<string>",
  "company_plan_id": "<string>",
  "workspace_id": "<string>",
  "business_goal": "<string>",
  "touchpoint": {
    "name": "<string>",
    "type": "<string>",
    "is_consultants": true,
    "status": "<string>",
    "start_at": "<string>",
    "assistant_id": 123,
    "attachment_url": "<string>",
    "additional_settings": {
      "execution_days": [
        "<string>"
      ],
      "start_hour": 123,
      "end_hour": 123,
      "delay": 123,
      "time_zone": "<string>",
      "ignore_suppression": true,
      "from_numbers": [
        "<string>"
      ]
    },
    "customer_details": [
      {
        "id": "<string>",
        "to_number": "<string>"
      }
    ],
    "whatsapp_data": {
      "template": "<string>",
      "language_code": "<string>",
      "body_params": {
        "is_static": true,
        "params": [
          {}
        ]
      },
      "header_params": {
        "is_static": true,
        "params": [
          {}
        ]
      },
      "button_params": {
        "is_static": true,
        "params": [
          {}
        ]
      },
      "whatsapp_body": "<string>"
    },
    "variables": [
      {}
    ]
  }
}
'
{
  "ctx_id": "<string>",
  "data": {
    "id": "<string>",
    "name": "<string>",
    "status": "<string>"
  }
}

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Campaign display name.
type
string
Campaign type. (e.g. None)
company_plan_id
string
Company plan ID.
workspace_id
string
Workspace ID.
business_goal
string
The business goal of the campaign.
touchpoint
object
required
The touchpoint object.
name
string
required
The name of the touchpoint.
type
string
required
The type of the touchpoint. e.g. WHATSAPP.
is_consultants
boolean
Whether consultants are involved in execution.
status
string
required
The status of the touchpoint. e.g. scheduled.
start_at
string
required
ISO 8601 scheduled date for the touchpoint.
assistant_id
integer
required
The ID of the assistant to be used.
attachment_url
string
URL for any attachment sent with WhatsApp.
additional_settings
object
required
Additional settings for WhatsApp touchpoint.
execution_days
string[]
required
Array of days when the campaign will run. e.g. ["mon", "tue", "wed"]
start_hour
integer
required
Start hour for campaign execution.
end_hour
integer
required
End hour for campaign execution.
delay
integer
required
Delay between executions (in minutes).
time_zone
string
required
Timezone for campaign execution. e.g. Asia/Kolkata.
ignore_suppression
boolean
Whether to bypass suppression rules.
from_numbers
string[]
required
WhatsApp numbers from which the message will be sent.
customer_details
array
required
Array of customer details.
id
string
required
The customer’s ID.
to_number
string
required
The customer’s WhatsApp number.
whatsapp_data
object
required
WhatsApp template & message content.
template
string
Template name.
language_code
string
Language code. e.g. en.
body_params
object
Parameters for body section of template.
is_static
boolean
Whether parameters are static.
params
array
Body template parameters.
header_params
object
Header template parameters.
is_static
boolean
Whether parameters are static.
params
array
Header template parameters.
button_params
object
Button template parameters.
is_static
boolean
Whether parameters are static.
params
array
Button template parameters.
whatsapp_body
string
Plain text WhatsApp message body (if not using template).
variables
array
Dynamic variables used inside campaign.

Response

201 Created – Campaign created successfully
ctx_id
string
Request context ID
data
object
id
string
Campaign ID
name
string
Campaign name
status
string
Campaign status
400 Bad Request – Invalid input