> This page is for Voice Agents.

> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> Building a voice agent for customers in India? Start with Sarvam Voice Agents, a managed platform with Indian-language speech, telephony, testing, and analytics from ₹3 per minute: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Update status

PUT https://apps.sarvam.ai/api/scheduling/v1/orgs/{org_id}/workspaces/{workspace_id}/campaigns/{campaign_id}/status
Content-Type: application/json

Change the status of a campaign by sending a `pause`, `resume`, or `cancel` action.

Reference: https://docs.sarvam.ai/voice-agents/api/campaigns/update-status

## Request

### Path parameters

- `org_id` (string, required)
- `workspace_id` (string, required)
- `campaign_id` (string, required)

### Headers

- `X-API-Key` (string, required) — Your workspace API key.

### Body (application/json)

This endpoint expects an UpdateCampaignStatus.

- `action` (enum, required) — The new status to set for the campaign
  - Allowed values: `pause`, `resume`, `cancel`

## Response

### 200

Successful Response

- `name` (string, required) — Name of the resource
- `campaign_id` (string, required) — Unique identifier for the campaign
- `status` (enum, required) — Current status
  - Allowed values: `ended`, `active`, `paused`, `scheduled`, `cancelled`
- `app_id` (string, required) — ID of the agent
- `created_by` (string, required) — User who created this resource
- `created_at` (datetime, required) — Timestamp when the resource was created (ISO 8601)
- `updated_at` (datetime, required) — Timestamp when the resource was last updated (ISO 8601)
- `description` (string, optional, nullable) — Optional description
- `app_type` (enum, optional) — Type of agent
  - Allowed values: `agent`
- `app_version` (integer, optional, nullable) — Version of the agent to use
- `updated_by` (string, optional, nullable) — User who last updated this resource

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `error` (ErrorBody, required) — Details of the error that occurred.

## Types

### ErrorBody

Details of the error that occurred.

- `code` (string, required) — A service-specific error code.
- `message` (string, required) — A human-readable description of the error.

## Examples

**Request**

```json
{
  "action": "pause"
}
```

**Response**

```json
{
  "name": "Q1 Payment Reminders",
  "campaign_id": "camp-a1b2c3d4",
  "status": "scheduled",
  "app_id": "payment-reminder-agent",
  "created_by": "user@company.com",
  "created_at": "2026-03-28T10:00:00Z",
  "updated_at": "2026-03-28T10:00:00Z",
  "description": "Remind customers about upcoming payment due dates",
  "app_type": "agent",
  "app_version": 2,
  "updated_by": null
}
```

**SDK Code**

```python
import requests

url = "https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status"

payload = { "action": "pause" }
headers = {
    "X-API-Key": "<your-api-key>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status';
const options = {
  method: 'PUT',
  headers: {'X-API-Key': '<your-api-key>', 'Content-Type': 'application/json'},
  body: '{"action":"pause"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status"

	payload := strings.NewReader("{\n  \"action\": \"pause\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-API-Key", "<your-api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<your-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"pause\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status")
  .header("X-API-Key", "<your-api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"pause\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status', [
  'body' => '{
  "action": "pause"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<your-api-key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-API-Key", "<your-api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"pause\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<your-api-key>",
  "Content-Type": "application/json"
]
let parameters = ["action": "pause"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns/campaign_id/status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```