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

# List campaigns

> Outbound campaigns you own. Default is API / Custom CRM only.

Read-only. Does **not** create or start a campaign.

Use **Try it** on the endpoint bar. Copy a `campaignId` into Get campaign or `POST /leads`.


## OpenAPI

````yaml /openapi.json get /api/v1/campaigns
openapi: 3.0.3
info:
  title: Ondial Public API
  version: 1.0.0
  description: >-
    Tenant API-key surface for lead ingest, contacts (including dial
    conversation + analysis), events, inbound agents, company profiles, and
    knowledge-base documents.


    **Campaign definition is UI-only** — create and start an API-ingest campaign
    in the dashboard, then push leads here.


    **Auth:** `Authorization: Bearer ond_live_…` or `ond_test_…` (or
    `X-API-Key`). Keys are requested in **API Access** with a friendly **key
    name**, then approved by Super Admin (not self-serve). Tenants can rename
    keys later without rotating the secret.


    **Scopes:** Company and knowledge-base routes require opt-in scopes
    (`companies:read`, `companies:write`, `knowledge:read`, `knowledge:write`)
    granted at key approval. Missing scope → `403 forbidden`.


    **Sandbox** keys never place PSTN dials or live WhatsApp/email and do not
    burn credits (KB upload skips debit).


    **Security:** Company responses never include SMTP/WhatsApp credentials. KB
    v1 is metadata-only — no file download.


    **Kill switch:** Super Admin can disable all `/api/v1/*` (`503` /
    `api_globally_disabled`) without stopping UI CSV campaigns.


    **Compliance:** Call channel requires `consent.outboundCall: true` and phone
    not on tenant/platform DNC.
servers:
  - url: https://dashboard.ondial.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security:
  - BearerAuth: []
tags:
  - name: Core
    description: Auth check and lead ingest
  - name: Contacts
    description: Status, dials/conversation/analysis, cancel, delete, follow-ups, list
  - name: Events
    description: ERP event bus slice — eventType → campaign
  - name: Outbound
    description: >-
      Read-only campaign lookup for API / Custom CRM. Create and start campaigns
      in the dashboard.
  - name: Inbound agents
    description: Configure inbound agents; list/buy pool numbers; read credits
  - name: Companies
    description: >-
      Company profile CRUD (requires companies:read / companies:write scopes).
      Never returns SMTP or WhatsApp credentials.
  - name: Knowledge bases
    description: >-
      Knowledge document upload/list/delete (requires knowledge:read /
      knowledge:write scopes). Metadata only — no file download via API.
paths:
  /api/v1/campaigns:
    get:
      tags:
        - Outbound
      summary: List outbound campaigns
      description: >-
        Campaigns you own. Default `dataSource=api` (API / Custom CRM only).
        Pass `dataSource=all` for every outbound campaign. Create / start /
        pause stays dashboard-only.
      operationId: listCampaigns
      parameters:
        - in: query
          name: dataSource
          schema:
            type: string
            enum:
              - api
              - all
            default: api
          example: api
          description: >-
            api = API / Custom CRM ingest only. all = every outbound campaign
            you own.
        - in: query
          name: status
          schema:
            type: string
          example: active
          description: Filter by campaign status.
        - in: query
          name: limit
          schema:
            type: integer
            default: 50
            maximum: 100
          example: 50
        - in: query
          name: cursor
          schema:
            type: string
      responses:
        '200':
          description: Page of campaigns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundCampaignList'
              example:
                campaigns:
                  - campaignId: 6a7afae1e1cf2999568febc4
                    name: TEst API
                    status: active
                    apiIngest: true
                    dataSourceType: api
                    phone: '+919484357189'
                    timezone: Asia/Kolkata
                    followup: false
                    followupChannels: []
                    createdAt: '2026-08-11T11:39:00.000Z'
                nextCursor: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ApiDisabled'
      security:
        - BearerAuth: []
components:
  schemas:
    OutboundCampaignList:
      type: object
      properties:
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/OutboundCampaign'
        nextCursor:
          type: string
          nullable: true
    OutboundCampaign:
      type: object
      properties:
        campaignId:
          type: string
        name:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        apiIngest:
          type: boolean
        dataSourceType:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        timezone:
          type: string
          nullable: true
        followup:
          type: boolean
        followupChannels:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          nullable: true
        email:
          type: object
          description: Only on GET /campaigns/{id}
          additionalProperties: true
        whatsapp:
          type: object
          description: Only on GET /campaigns/{id}
          additionalProperties: true
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        reasonCode:
          type: string
        missing:
          type: array
          items:
            type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or inactive API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            error: Invalid or inactive API key
            reasonCode: unauthorized
    ApiDisabled:
      description: Global kill switch or insufficient credits
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          examples:
            killSwitch:
              value:
                error: API temporarily disabled
                reasonCode: api_globally_disabled
            credits:
              value:
                error: Insufficient credits
                reasonCode: insufficient_credits
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ond_live | ond_test
      description: >-
        Paste only your API key (`ond_live_…` or `ond_test_…`). Do not type the
        word Bearer — the playground adds it.

````