> ## Documentation Index
> Fetch the complete documentation index at: https://agents.docs.timepay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Campaigns

> Get a paginated list of campaigns for the organization.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication (e.g., `Bearer <your_token>`).
</ParamField>

### Query Parameters

<ParamField query="page" type="integer" default={1}>
  The page number for pagination.
</ParamField>

<ParamField query="status" type="string">
  Filter campaigns by status.

  <Expandable title="options">
    * `active`
    * `paused`
    * `completed`
    * `draft`
  </Expandable>
</ParamField>

<ParamField query="campaign_type" type="string">
  Filter by the type of campaign.

  <Expandable title="options">
    * `emi`
    * `edi`
  </Expandable>
</ParamField>

<ParamField query="search" type="string">
  Search term to filter campaigns by name.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful.
</ResponseField>

<ResponseField name="data" type="array">
  The list of campaign objects.
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination details.

  <Expandable title="properties">
    <ResponseField name="page" type="integer">
      Current page number.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Items per page.
    </ResponseField>

    <ResponseField name="total" type="integer">
      Total number of campaigns found.
    </ResponseField>

    <ResponseField name="totalPages" type="integer">
      Total number of pages available.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string">
  The error type or code (Error responses only).
</ResponseField>

<ResponseField name="message" type="string">
  A descriptive message explaining the error (Error responses only).
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "QSoSyUUwwhwEiFhXJIUlhYxOh",
        "tableId": "campaign_jyyrsvgpynmxetfiuiba_kiwwhjupmwyjabnrlillydlsw",
        "rowsLen": 1,
        "createdAt": "2026-01-05T14:44:15",
        "updatedAt": "2026-01-05T14:44:51",
        "org_id": "JYYrSvGpyNMxetfiuiBa",
        "name": "Campaign 1",
        "description": "Q1 debt collection campaign for overdue accounts",
        "startDate": "2025-12-31",
        "startTime": "09:00",
        "endDate": "2025-12-31",
        "endTime": "19:00",
        "collection_type": "emi",
        "region": "north",
        "tags": [
          "priority",
          "q1"
        ],
        "languages": [
          "hindi",
          "english"
        ]
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 50,
      "totalPages": 5
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "error": "Unauthorized",
    "message": "Missing or invalid authorization header"
  }

  ```

  ```json 403 Forbidden theme={null}
  {
    "success": false,
    "error": "Forbidden",
    "message": "You don't have the required permission to perform this action"
  }

  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "error": "NotFound",
    "message": "Campaign not found"
  }

  ```

  ```json 500 Server Error theme={null}
  {
    "success": false,
    "error": "InternalServerError",
    "message": "An unexpected error occurred"
  }

  ```
</ResponseExample>
