PATCH
/
v1
/
orgs
/
{org_id}
/
workspaces
/
{workspace_id}
/
campaigns
/
{campaign_id}
Update Campaign
curl --request PATCH \
  --url https://apps.sarvam.ai/api/scheduling/v1/orgs/{org_id}/workspaces/{workspace_id}/campaigns/{campaign_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<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": {}
    }
  },
  "end_timestamp": "2023-11-07T05:31:56Z",
  "allowed_schedule": {
    "allowed_start_time": "<string>",
    "allowed_end_time": "<string>",
    "allowed_days": [
      "Monday"
    ],
    "timezone": "Asia/Kolkata"
  }
}
'
{
  "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>"
}
Updates are only allowed when the campaign is in paused or scheduled status.

Authorizations

X-API-Key
string
header
required

Path Parameters

org_id
string
required
workspace_id
string
required
campaign_id
string
required

Body

application/json

Request body for updating a campaign. Only allowed when the campaign is in paused or scheduled status.

name
string | null

Updated campaign name. Alphanumeric, hyphens, underscores and spaces allowed. Max 50 characters.

description
string | null

Updated campaign description. Max 150 characters.

Maximum string length: 150
app_config
AgentConfig · object

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

end_timestamp
string<date-time> | null

Updated campaign end time (ISO 8601)

allowed_schedule
AllowedScheduleConfig · object

Updated schedule constraints

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