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

# List Campaigns

> Retrieve campaigns across all connected ad platforms with optional filtering and pagination.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.adrelay.dev/v1/campaigns?platform=google_ads&status=ACTIVE&limit=25" \
    -H "X-API-Key: $ADRELAY_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({
    platform: "google_ads",
    status: "ACTIVE",
    limit: "25",
  });

  const response = await fetch(
    `https://api.adrelay.dev/v1/campaigns?${params}`,
    {
      headers: { "X-API-Key": process.env.ADRELAY_API_KEY },
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.adrelay.dev/v1/campaigns",
      headers={"X-API-Key": "your-api-key-here"},
      params={"platform": "google_ads", "status": "ACTIVE", "limit": 25},
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "unified": [
      {
        "id": "camp_abc123",
        "platform": "google_ads",
        "remote_id": "123456789",
        "name": "Summer Sale 2026",
        "status": "ACTIVE",
        "goal": "CONVERSIONS",
        "budget_amount": 50.00,
        "budget_period": "DAILY",
        "currency": "USD",
        "created_at": "2026-03-01T12:00:00Z",
        "updated_at": "2026-03-15T08:30:00Z"
      }
    ],
    "pagination": {
      "next_cursor": "eyJpZCI6ImNhbXBfYWJjMTIzIn0=",
      "has_more": true
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Invalid or missing API key.",
    "code": "UNAUTHORIZED",
    "timestamp": 1711036800,
    "request_id": "req_abc123"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/campaigns
openapi: 3.1.0
info:
  title: Adrelay API
  version: 0.1.0
  description: >-
    Unified Ad Platform API — proxy and normalize campaigns across Google Ads,
    Meta, TikTok, and more.
servers:
  - url: https://api.adrelay.dev/v1
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
paths:
  /v1/campaigns:
    get:
      summary: List campaigns
      description: Returns a paginated list of campaigns from connected ad platforms.
      parameters:
        - schema:
            $ref: '#/components/schemas/Platform'
          required: false
          name: platform
          in: query
        - schema:
            type: string
          required: false
          name: organization_id
          in: query
        - schema:
            $ref: '#/components/schemas/AdsStatus'
          required: false
          name: status
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          required: false
          name: limit
          in: query
      responses:
        '200':
          description: Paginated list of campaigns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - apiKey: []
components:
  schemas:
    Platform:
      type: string
      enum:
        - GOOGLE
        - META
        - TIKTOK
        - LINKEDIN
        - PINTEREST
        - REDDIT
    AdsStatus:
      type: string
      enum:
        - UNSPECIFIED
        - ACTIVE
        - PAUSED
        - ARCHIVED
        - DRAFT
        - SCHEDULED_FOR_DELETION
    CampaignListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AdsCampaign'
        pagination:
          type: object
          properties:
            cursor:
              type:
                - string
                - 'null'
            hasMore:
              type: boolean
            limit:
              type: number
          required:
            - cursor
            - hasMore
            - limit
      required:
        - data
        - pagination
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/ErrorCode'
            message:
              type: string
            platform:
              type: string
            retryable:
              type: boolean
            requestId:
              type: string
              format: uuid
            platformError:
              $ref: '#/components/schemas/PlatformErrorDetail'
          required:
            - code
            - message
            - retryable
            - requestId
      required:
        - error
    AdsCampaign:
      type: object
      properties:
        id:
          type: string
        platform:
          $ref: '#/components/schemas/Platform'
        organization_id:
          type: string
        name:
          type: string
        status:
          $ref: '#/components/schemas/AdsStatus'
        goal:
          $ref: '#/components/schemas/AdsCampaignGoalType'
        budget_amount:
          type: number
        budget_period:
          $ref: '#/components/schemas/AdsBudgetPeriod'
        currency:
          type: string
        total_spend_amount:
          type: number
        start_at:
          type:
            - string
            - 'null'
        end_at:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
        raw:
          type: object
          additionalProperties: {}
      required:
        - id
        - platform
        - organization_id
        - name
        - status
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - UNAUTHORIZED
        - FORBIDDEN
        - NOT_FOUND
        - CONFLICT
        - RATE_LIMITED
        - RATE_LIMIT_EXCEEDED
        - PLATFORM_ERROR
        - NOT_SUPPORTED
        - TOKEN_EXPIRED
        - INTERNAL_ERROR
    PlatformErrorDetail:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - message
    AdsCampaignGoalType:
      type: string
      enum:
        - UNSPECIFIED
        - BRAND_AWARENESS
        - REACH
        - WEBSITE_TRAFFIC
        - LEADS
        - SALES
        - APP_PROMOTION
    AdsBudgetPeriod:
      type: string
      enum:
        - DAILY
        - MONTHLY
        - TOTAL
        - LIFETIME
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````