POST
/
v1
/
orgs
/
{org_id}
/
workspaces
/
{workspace_id}
/
campaigns
Create Campaign
curl --request POST \
  --url https://apps.sarvam.ai/api/scheduling/v1/orgs/{org_id}/workspaces/{workspace_id}/campaigns \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "app_config": {
    "app_id": "<string>",
    "app_version": 2,
    "attempts_per_second": 250.05,
    "connection_configs": [
      {
        "connection_id": "<string>",
        "phone_numbers": [
          "<string>"
        ],
        "weight": 1
      }
    ],
    "retry_config": {
      "max_retries": 10,
      "retry_on": {
        "busy": {
          "enabled": true
        },
        "failed": {
          "enabled": true
        },
        "no_answer": {
          "enabled": true
        },
        "short_duration": {
          "enabled": true,
          "threshold_seconds": 123
        },
        "provider_error": {
          "enabled": true,
          "max_retries": 10,
          "retry_interval_minutes": 6
        },
        "internal_error": {
          "enabled": true,
          "max_retries": 3,
          "retry_interval_minutes": 5
        }
      },
      "retry_interval_minutes": []
    },
    "app_type": "agent",
    "webhook_config": {
      "url": "<string>",
      "metadata": {}
    }
  },
  "start_timestamp": "2023-11-07T05:31:56Z",
  "end_timestamp": "2023-11-07T05:31:56Z",
  "allowed_schedule": {
    "allowed_start_time": "<string>",
    "allowed_end_time": "<string>",
    "allowed_days": [
      "Monday"
    ],
    "timezone": "Asia/Kolkata"
  },
  "description": "<string>"
}
'
{
  "name": "<string>",
  "campaign_id": "<string>",
  "status": "ended",
  "app_id": "<string>",
  "created_by": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "app_type": "agent",
  "app_version": 123,
  "updated_by": "<string>"
}

Overview

A campaign ties an app (agent or workflow) to a schedule, rate, and retry policy — defining who to contact, when, and how fast.

Typical flow

  1. Create a campaign with app config, schedule, and retry policy
  2. Upload a cohort — CSV of users + transformation config
  3. System processes and dispatches jobs at the configured rate
  4. Retry engine handles failures automatically
  5. Campaign ends when the time window expires or you cancel it

Next: Upload a Cohort

After creating a campaign, upload a CSV of users to start processing jobs.

Authorizations

X-API-Key
string
header
required

Path Parameters

org_id
string
required
workspace_id
string
required

Body

application/json

Request body for creating a new campaign. Ties an app to a schedule, rate, and retry policy.

name
string
required
app_config
AgentConfig · object
required

Configuration for an agent campaign, including rate limiting, telephony connections, and retry policy.

start_timestamp
string<date-time>
required

Campaign start time (ISO 8601)

end_timestamp
string<date-time>
required

Campaign end time (ISO 8601)

allowed_schedule
AllowedScheduleConfig · object
required

Schedule constraints for when the campaign can run

description
string | null

Optional campaign description. Max 150 characters.

Maximum string length: 150

Response

Successful Response

Summary metadata for a campaign, returned in list responses.

name
string
required

Name of the resource

campaign_id
string
required

Unique identifier for the campaign

status
enum<string>
required

Current status

Available options:
ended,
active,
paused,
scheduled,
cancelled
app_id
string
required

ID of the agent or workflow app

created_by
string
required

User who created this resource

created_at
string<date-time>
required

Timestamp when the resource was created (ISO 8601)

updated_at
string<date-time>
required

Timestamp when the resource was last updated (ISO 8601)

description
string | null

Optional description

app_type
enum<string>
default:agent

Type of app

Available options:
agent,
workflow
app_version
integer | null

Version of the app to use

updated_by
string | null

User who last updated this resource