Skip to main content
POST
/
create-campaign
Create campaign
curl --request POST \
  --url https://www.tryunleashx.com/api/v1/global/create-campaign \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "agent_id": 123,
  "campaign_name": "<string>",
  "description": "<string>",
  "start_date": "2023-12-25",
  "end_date": "2023-12-25",
  "max_retry": 25,
  "max_delay": "<string>"
}
'
Use this endpoint to create a new campaign.

Endpoint

POST /create-campaign Content-Type: application/json Authentication: Required (workspace auth)

Request Body

{
  "agent_id": 123,
  "campaign_name": "Winter Sale Campaign",
  "description": "Outbound calls to promote winter offers",
  "start_date": "2025-12-01",
  "end_date": "2025-12-31",
  "max_retry": 3,
  "max_delay": "{\"d\":1,\"h\":2,\"m\":30}"
}

Notes

  • All fields (agent_id, campaign_name, description, start_date, end_date, max_retry) are required.
  • campaign_name must be unique within a workspace.
  • max_retry cannot be greater than 50.
  • max_delay is required when max_retry is greater than 1. It must be passed as a JSON string (not an object) with keys d (days), h (hours), and m (minutes) as numbers. Example: "{\"d\":1,\"h\":2,\"m\":30}".
  • start_date and end_date must be in YYYY-MM-DD format (e.g., "2025-12-01").

Example cURL

curl -X POST https://www.tryunleashx.com/api/v1/global/create-campaign \
  -H "Content-Type: application/json" \
  -H "Authorization: <api_key>" \
  -d '{
    "agent_id": 123,
    "campaign_name": "Winter Sale Campaign",
    "description": "Outbound calls to promote winter offers",
    "start_date": "2025-12-01",
    "end_date": "2025-12-31",
    "max_retry": 3,
    "max_delay": "{\"d\":1,\"h\":2,\"m\":30}"
  }'

Headers

token
string
required

API token for authentication

Body

application/json
agent_id
integer
required

Voice agent to use for this campaign

campaign_name
string
required

Name of the campaign. Must be unique within a workspace.

description
string
required

Description of the campaign

start_date
string<date>
required

Campaign start date in YYYY-MM-DD format (e.g. 2025-12-01)

end_date
string<date>
required

Campaign end date in YYYY-MM-DD format (e.g. 2025-12-31)

max_retry
integer
required

Maximum number of retry attempts (cannot be greater than 50)

Required range: 1 <= x <= 50
max_delay
string

Delay between retries as a JSON string. Required when max_retry > 1. Keys: d (days), h (hours), m (minutes) with numeric values. Example: {"d":1,"h":2,"m":30}

Response

Campaign created successfully