# List campaigns (/en/api-reference/api-ref/conversational-ai/platform/list-campaigns)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI API.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-api-v2.txt).


Retrieves the campaigns in your project.

- OpenAPI: /openapi/conversational-ai/rest-api-platform.en.yaml
- Operation ID: list-campaigns
- Method: GET
- Path: /v1/projects/{appid}/campaigns
- Endpoint: https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/campaigns

## Servers

- https://preview.ai.agora.io/conversational-ai

## Authorization

This endpoint requires authentication.

- `tokenAuth`
- `basicAuth`

## Parameters

- `appid` (path, required, string) - The App ID of your project.
- `status` (query, optional, string) - Return only campaigns with this status.
  - Allowed: `scheduled` | `running` | `paused` | `completed` | `canceled` | `failed`
- `limit` (query, optional, integer) - The maximum number of campaigns to return on each page.
  - Minimum: `1`
- `cursor` (query, optional, string) - The `next_cursor` value from the previous page of results. Omit it to get the first page. The cursor is opaque, so pass it back unchanged.
- `order` (query, optional, string) - The sort order of the results:

- `create_ts.desc`: Newest first.
- `create_ts.asc`: Oldest first.
  - Allowed: `create_ts.desc` | `create_ts.asc`
  - Default: `create_ts.desc`

## Request body

No request body.

## Responses

### 200

The request was successful. The response body contains a page of campaigns.

- `has_more` (boolean) - Whether more results are available after this page.
- `next_cursor` (string | null | null) - The cursor for the next page. Pass it in the `cursor` query parameter of your next request. `null` on the last page.
- `data` (object)
  - `data.count` (integer) - The number of campaigns on this page.
  - `data.list` (array) - The campaigns on this page.
    - `data.list.items` (object)
      - `data.list.items.campaign_id` (string) - The ID of the campaign, a UUID.
        - Format: `uuid`
      - `data.list.items.name` (string) - The name of the campaign.
      - `data.list.items.status` (string) - The status of the campaign:

- `scheduled`: The campaign is waiting for its start time.
- `running`: The campaign is dialing, or can dial during its schedule.
- `paused`: You paused the campaign.
- `completed`: The campaign has finished.
- `canceled`: You canceled the campaign.
- `failed`: The campaign failed. The details are in `failure`.
        - Allowed: `scheduled` | `running` | `paused` | `completed` | `canceled` | `failed`
      - `data.list.items.agent_id` (string) - The ID of the agent that makes the calls.
        - Format: `uuid`
      - `data.list.items.transport` (object)
        - `data.list.items.transport.type` (string) - Always `telephony`.
        - `data.list.items.transport.from` (array) - The `number_id` values of the numbers the campaign calls from.
          - `data.list.items.transport.from.items` (string)
        - `data.list.items.transport.call_policy` (object) - Limits and behavior for each call the campaign places. Each limit you omit adds no limit.
          - `data.list.items.transport.call_policy.max_ring_duration_ms` (integer) - The maximum time in milliseconds from starting the dial until the call is answered. If the call isn't answered in time, the dial attempt ends.
            - Range: `[1, 259200000]`
          - `data.list.items.transport.call_policy.max_call_duration_seconds` (integer) - The maximum length of the call in seconds, measured from when it's answered. The session's `lifecycle` limits can end the call earlier.
            - Range: `[1, 259200]`
          - `data.list.items.transport.call_policy.max_silence_duration_ms` (integer) - Hang up when nobody on the call has spoken for this many milliseconds. This is separate from `pipeline.silence_config`, which only prompts the user.
            - Range: `[30000, 259200000]`
          - `data.list.items.transport.call_policy.end_call` (object) - Conditions under which the agent can end the call itself. Every condition is off unless you set it to `true`.
            - `data.list.items.transport.call_policy.end_call.on_user_request` (boolean) - End the call when the caller clearly says goodbye or asks to hang up.
              - Default: `false`
            - `data.list.items.transport.call_policy.end_call.on_voicemail` (boolean) - End the call when the agent reaches voicemail, such as a "please leave a message after the tone" announcement.
              - Default: `false`
            - `data.list.items.transport.call_policy.end_call.on_ai_assistant` (boolean) - End the call when the call is answered by an AI assistant, a voice secretary, or another automated answering system.
              - Default: `false`
      - `data.list.items.lifecycle` (object) - When each session the campaign starts ends on its own.
        - `data.list.items.lifecycle.idle_timeout_ms` (integer) - How long in milliseconds the session continues with no participant present: after the subscribed user leaves the RTC channel, or after the other side of a phone call hangs up. It isn't silence detection. Set to `0` to turn off the idle timer. Can't be greater than `max_duration_ms`.
          - Default: `30000`
          - Range: `[0, 3600000]`
        - `data.list.items.lifecycle.max_duration_ms` (integer) - The maximum length of each session in milliseconds, measured from `start_ts`. Defaults to 5 minutes. The maximum is 1 hour.
          - Default: `300000`
          - Range: `[1000, 3600000]`
        - `data.list.items.lifecycle.graceful_stop` (object) - How the agent finishes when you stop the session, or when the idle timer expires. It doesn't extend `max_duration_ms`, and it doesn't add a farewell message.
          - `data.list.items.lifecycle.graceful_stop.enabled` (boolean) - Whether the agent finishes what it's saying before it leaves.
            - Default: `false`
          - `data.list.items.lifecycle.graceful_stop.timeout_ms` (integer) - The longest time in milliseconds the agent can take to finish.
            - Default: `30000`
            - Range: `[0, 120000]`
      - `data.list.items.schedule` (object) - When the campaign dials. Pass the fields of one schedule mode only.
        - `data.list.items.schedule.mode` (string, required) - `immediate`: The campaign starts dialing as soon as it's created.
        - `data.list.items.schedule.timezone` (string, required) - The IANA time zone for `days`, for example `America/New_York`. Daylight saving time is handled automatically. Required when you pass `days`.
          - Min length: `1`
          - Max length: `255`
        - `data.list.items.schedule.start` (string, required) - When the campaign can start dialing, as a local date and time in `YYYY-MM-DDTHH:MM` format with no offset, for example `2026-11-02T09:00`. A local time that doesn't exist or occurs twice because of a daylight saving change is rejected.
        - `data.list.items.schedule.end` (string, required) - When the campaign stops placing new calls, as a local date and time in `YYYY-MM-DDTHH:MM` format, later than `start`. Calls in progress continue. A local time that doesn't exist or occurs twice because of a daylight saving change is rejected.
        - `data.list.items.schedule.days` (array) - The weekly hours when new calls can start. Outside these hours, no new calls start. A day you don't list has no dialing. Omit `days` to dial at any time.
          - Min items: `1`
          - Max items: `7`
          - `data.list.items.schedule.days.items` (object)
            - `data.list.items.schedule.days.items.weekday` (string, required) - The day of the week. Each day can appear only once.
              - Allowed: `mon` | `tue` | `wed` | `thu` | `fri` | `sat` | `sun`
            - `data.list.items.schedule.days.items.ranges` (array, required) - One to 10 windows on this day, which can't overlap.
              - Min items: `1`
              - Max items: `10`
              - `data.list.items.schedule.days.items.ranges.items` (object)
                - `data.list.items.schedule.days.items.ranges.items.start` (string, required) - The start of the window, as a local time in 24-hour `HH:MM` format.
                - `data.list.items.schedule.days.items.ranges.items.end` (string, required) - The end of the window, as a local time in `HH:MM` format, later than `start`. Use `24:00` for the end of the day.
      - `data.list.items.counts` (object) - The number of contacts in each state. Retrieve the campaign to get current counts.
        - `data.list.items.counts.contacts` (integer) - The total number of contacts.
        - `data.list.items.counts.pending` (integer) - Contacts not called yet, or waiting for a retry.
        - `data.list.items.counts.calling` (integer) - Contacts in a call now.
        - `data.list.items.counts.completed` (integer) - Contacts whose call has finished.
        - `data.list.items.counts.failed` (integer) - Contacts not reached after all attempts.
        - `data.list.items.counts.canceled` (integer) - Contacts that won't be called because the campaign was canceled.
      - `data.list.items.create_ts` (integer) - The time the campaign was created, as a Unix timestamp in seconds.
      - `data.list.items.start_ts` (integer | null | null) - The time the campaign started dialing, as a Unix timestamp in seconds. `null` before it starts.
      - `data.list.items.complete_ts` (integer | null | null) - The time the campaign finished, as a Unix timestamp in seconds. `null` until it finishes.
      - `data.list.items.failure` (object) - Details of the failure when `status` is `failed`. Otherwise `null`.
        - `data.list.items.failure.code` (string, required) - A stable runtime error code, for example `provider_error`.
        - `data.list.items.failure.provider` (string) - The model provider that caused the failure, for example `openai`.
        - `data.list.items.failure.message` (string, required) - A human-readable explanation.
        - `data.list.items.failure.ts` (integer, required) - The time the failure occurred, as a Unix timestamp in seconds.
### 401

Authentication is missing or invalid. The reason is `InvalidPermission`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### default

The request failed. The response body contains the `reason` and `detail` of the failure. For possible reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

## Response examples

### 200

```json
{
  "data": {
    "count": 1,
    "list": [
      {
        "campaign_id": "b4f0581e-f138-43a2-851c-a8f8d228bb37",
        "name": "q3-renewals",
        "status": "running",
        "agent_id": "3f6c2a9e-8d1b-4e7a-9c55-0b2f7d1e4a10",
        "transport": {
          "type": "telephony",
          "from": [
            "92e68758-3d3a-4f27-8b93-3fd8d834467c"
          ]
        },
        "schedule": {
          "mode": "immediate"
        },
        "counts": {
          "contacts": 120,
          "pending": 84,
          "calling": 6,
          "completed": 27,
          "failed": 3,
          "canceled": 0
        },
        "create_ts": 1787673602,
        "start_ts": 1787673602,
        "complete_ts": null,
        "failure": null
      }
    ]
  },
  "has_more": false,
  "next_cursor": null
}
```
