> 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.

# List campaigns

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

List campaigns in the workspace with optional filtering by status, search, sorting, and pagination.

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

## Request

### Path parameters

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

### Query parameters

- `campaign_status` (enum, optional, nullable) — Campaign lifecycle status: `scheduled` → `active` → `ended`. Can be `paused` or `cancelled` at any point.
  - Allowed values: `ended`, `active`, `paused`, `scheduled`, `cancelled`
- `offset` (integer, optional, default: 0) — Number of records to skip
- `limit` (integer, optional, default: 10) — Number of records to return (max 100)
- `sort_by` (string, optional, nullable, default: created_at) — Field to sort by
- `sort_order` (string, optional, nullable, default: desc) — Sort order (asc or desc)
- `search` (string, optional, nullable) — Search query string

### Headers

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

## Response

### 200

Successful Response

- `items` (list of CampaignMetadata, required) — List of campaigns on this page
- `total` (integer, required) — Total number of campaigns matching the query
- `limit` (integer, required) — Maximum number of items per page
- `offset` (integer, required) — Number of items skipped
- `next_page_uri` (string, optional, nullable) — URI to fetch the next page, or null if this is the last page
- `prev_page_uri` (string, optional, nullable) — URI to fetch the previous page, or null if this is the first page

## Errors

### 422 Unprocessable Entity Error

Validation Error

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

## Types

### CampaignMetadata

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, 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

### 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

**Response**

```json
{
  "items": [
    {
      "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
    },
    {
      "name": "Q2 Loan Renewal Calls",
      "campaign_id": "camp-d4e5f6a7",
      "status": "active",
      "app_id": "payment-reminder-agent",
      "created_by": "user@company.com",
      "created_at": "2026-04-02T08:30:00Z",
      "updated_at": "2026-04-03T12:10:00Z",
      "description": "Follow up on expiring loans with renewal offers",
      "app_type": "agent",
      "app_version": 2,
      "updated_by": "user@company.com"
    }
  ],
  "total": 2,
  "limit": 10,
  "offset": 0,
  "next_page_uri": null,
  "prev_page_uri": null
}
```

**SDK Code**

```python
import requests

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

headers = {"X-API-Key": "<your-api-key>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns';
const options = {method: 'GET', headers: {'X-API-Key': '<your-api-key>'}};

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"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<your-api-key>")

	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")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<your-api-key>'

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.get("https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns")
  .header("X-API-Key", "<your-api-key>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://apps.sarvam.ai/api/scheduling/v1/orgs/org_id/workspaces/workspace_id/campaigns', [
  'headers' => [
    '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");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<your-api-key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<your-api-key>"]

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

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()
```