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

# List campaigns



## OpenAPI

````yaml /openapi.yaml get /v1/campaigns
openapi: 3.1.0
info:
  title: Affixo API
  version: 1.0.0
  description: |
    The Affixo REST API for affiliate program management and server-to-server
    conversion tracking.

    There are two families of bearer tokens:

    - **Workspace keys** (`sa_live_…`) — full program access, scoped by
      `read` / `write` / `track`. Used for the management and tracking endpoints.
    - **Affiliate keys** (`refa_live_…`) — read-only, return **only the calling
      affiliate's own data**. Used for the `/v1/affiliate/*` endpoints.

    Tokens are sent as `Authorization: Bearer <token>`. Rate limit: 600 req/min
    per key (enforced at the edge).
servers:
  - url: https://go.affixo.dev
    description: Production
security: []
tags:
  - name: Affiliates
    description: Manage affiliates (workspace key)
  - name: Links
    description: Manage referral links (workspace key)
  - name: Resources
    description: Read campaigns, commissions, conversions, payouts (workspace key)
  - name: Tracking
    description: >-
      Server-to-server click & conversion tracking (workspace key, scope
      "track")
  - name: Affiliate
    description: Read-only, self-scoped endpoints (affiliate key)
paths:
  /v1/campaigns:
    get:
      tags:
        - Resources
      summary: List campaigns
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
      responses:
        '200':
          description: A page of campaigns
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ListEnvelope'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
      security:
        - WorkspaceKey: []
components:
  parameters:
    Limit:
      name: limit
      in: query
      description: Page size (1–200, default 50).
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 50
    Offset:
      name: offset
      in: query
      description: Rows to skip (default 0).
      schema:
        type: integer
        minimum: 0
        default: 0
  schemas:
    ListEnvelope:
      type: object
      properties:
        object:
          type: string
          example: list
        resource:
          type: string
          example: affiliates
        limit:
          type: integer
          example: 50
        offset:
          type: integer
          example: 0
        data:
          type: array
          items: {}
    Campaign:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          example: active
        cookie_window_days:
          type: integer
          example: 30
        attribution_model:
          type: string
          enum:
            - last_click
            - first_click
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
        need:
          type: string
          description: Present on insufficient_scope.
        detail:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid bearer token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
    InsufficientScope:
      description: The key lacks the required scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: insufficient_scope
            need: write
  securitySchemes:
    WorkspaceKey:
      type: http
      scheme: bearer
      description: 'Workspace API key, e.g. `sa_live_…`. Scopes: read / write / track / *.'

````