Skip to navigation

Create Experiment Campaign

View as Markdown

Create a campaign that runs an experiment. This uses the same Create campaign endpoint. Send experiment_id on app_config and leave out app_id and app_version. Dial rate, phone numbers, retries, schedule, and the webhook are unchanged — see Create campaign for the full schema.

POST https://apps.sarvam.ai/api/scheduling/v1/orgs/{org_id}/workspaces/{workspace_id}/campaigns

Create the experiment first with Create an experiment.

Request

{
"name": "Q1 Payment Reminders — greeting experiment",
"description": "Split the greeting across two committed versions",
"app_config": {
"app_type": "agent",
"experiment_id": "greeting-te-9f1c2a7b-4d3e",
"attempts_per_second": 2,
"connection_configs": [
{
"connection_id": "conn-xyz",
"phone_numbers": ["+918041234567"],
"weight": 1
}
],
"retry_config": {
"max_retries": 3,
"retry_interval_minutes": 30,
"retry_on": {
"busy": { "enabled": true },
"no_answer": { "enabled": true },
"short_duration": { "enabled": true, "threshold_seconds": 30 }
}
},
"phone_rotation": { "agent": true },
"webhook_config": {
"url": "https://your-server.com/webhook",
"metadata": { "team": "collections" }
}
},
"start_timestamp": "2026-04-01T09:00:00Z",
"end_timestamp": "2026-04-15T18:00:00Z",
"allowed_schedule": {
"timezone": "Asia/Kolkata",
"allowed_start_time": "09:00",
"allowed_end_time": "18:00",
"allowed_days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
}
}

Do not send app_id or app_version with experiment_id.

Response

FieldValue
app_idThe agent the experiment is testing.
app_versionnull. The version is chosen per attempt.
experiment_idThe experiment you sent.

After create

The campaign stays on that experiment. A later update can change the dial plan when you resend the same experiment_id. It cannot switch the campaign to a single version, or to a different experiment.

For the traffic split and variant rules, see Experiments.