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

# Campaigns

> Your CPC campaigns.



## OpenAPI

````yaml GET /cpc/campaigns
openapi: 3.0.3
info:
  title: OnlyTraffic Studio API
  version: 1.0.0
  description: >-
    External API for OnlyTraffic Studio. Manage and retrieve data about your
    subscribers, CPL orders, and CPC orders.
servers:
  - url: https://studio-api.onlytraffic.com/api/external/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    description: API key holder's wallet, profile, and aggregate state.
  - name: Accounts
    description: OnlyFans accounts attached to the API key holder.
  - name: Agencies
    description: Agency CRUD and image management. All edits stage in moderation.
  - name: CPL
    description: >-
      Cost-per-lead orders: place, list, cancel, manage settings, browse partner
      offers.
  - name: CPC
    description: Cost-per-click campaigns, orders and creative management.
  - name: RevShare
    description: Revenue-share campaigns and invoices.
  - name: Swaps
    description: Two-sided traffic swap orders and offers.
  - name: Subscribers
    description: Per-fan delivery feed (cursor-paginated).
  - name: Transactions
    description: Per-transaction OF revenue feed (cursor-paginated).
paths:
  /cpc/campaigns:
    get:
      tags:
        - CPC
      summary: Campaigns
      description: Your CPC campaigns.
      operationId: getCpcCampaigns
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - name: campaign_id
          in: query
          schema:
            type: string
            maxLength: 32
          description: Filter to a single campaign by its public id.
          example: cpcp_a1b2c3d4
        - name: creative_public_id
          in: query
          schema:
            type: string
            maxLength: 32
          description: Only campaigns running the given creative.
          example: cpcr_p1bzku7u
        - name: of_account_id
          in: query
          schema:
            type: integer
            minimum: 1
          description: Only campaigns whose creative sits on this OnlyFans account.
          example: 123456
        - name: status
          in: query
          schema:
            type: string
            enum:
              - active
              - paused
              - completed
              - archived
          description: Defaults to all statuses.
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - created_at_desc
              - created_at_asc
              - budget_desc
              - spend_desc
              - clicks_desc
              - impressions_desc
            default: created_at_desc
          description: |-
            Sort order.
            - `created_at_desc`: newest campaigns first (default).
            - `created_at_asc`: oldest campaigns first.
            - `budget_desc`: largest total budget first.
            - `spend_desc`: highest lifetime spend first.
            - `clicks_desc`: most unique clicks first.
            - `impressions_desc`: most impressions first.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CpcCampaign'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Server error. Body always reads `{success:false,
            error:"server_error", message:"Server error"}` (no internal details
            leak).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number, 1-indexed.
      example: 1
    PageSize:
      name: page_size
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
      description: Items per page. Default 50, max 100.
      example: 50
  schemas:
    CpcCampaign:
      type: object
      properties:
        campaign_id:
          type: string
          description: >-
            Stable public id of the campaign. Use it as the `{public_id}` path
            segment on the stats endpoint.
          example: cpcp_a1b2c3d4
        campaign_number:
          type: integer
          description: >-
            Sequential campaign number within your account, mirrors the number
            shown in Studio.
          example: 42
        name:
          type: string
          description: Campaign name you set in Studio.
          example: Reddit push - May
        status:
          type: string
          enum:
            - active
            - paused
            - completed
            - archived
            - unknown
          description: >-
            Campaign state. `completed` means the total budget or the end date
            was reached; `archived` is a manual stop. `unknown` is returned for
            a state that is not part of the public contract yet.
          example: active
        of_account_id:
          type: integer
          nullable: true
          description: >-
            OnlyFans account the campaign's creative runs on. Matches
            `of_account_id` from `/accounts`. `null` if the creative was
            deleted.
          example: 123456
        max_bid_cents:
          type: integer
          description: Maximum bid per click, in cents.
          example: 55
        budget_daily_cents:
          type: integer
          description: Daily budget cap, in cents.
          example: 5000
        budget_total_cents:
          type: integer
          description: >-
            Lifetime budget cap, in cents. The campaign flips to `completed`
            when spend reaches it.
          example: 100000
        freq_cap:
          type: integer
          description: >-
            Maximum impressions shown to the same visitor within
            `freq_cap_days`. `0` means uncapped.
          example: 3
        freq_cap_days:
          type: integer
          enum:
            - 1
            - 3
            - 7
          description: Window the frequency cap is measured over, in days.
          example: 3
        blocked_placements:
          type: array
          description: >-
            Placement keys excluded from serving. Same `site-xxxxxxxx` keys the
            stats endpoint returns.
          items:
            type: string
            example: site-1f4c9ab2
        link_name_prefix:
          type: string
          description: Prefix applied to the tracking-link names minted for this campaign.
          example: CPC
        date_start:
          type: string
          format: date-time
          description: Scheduled start (ISO 8601, UTC).
          example: '2026-05-01T00:00:00Z'
        date_start_ts:
          type: integer
          description: Scheduled start as a Unix timestamp.
          example: 1777593600
        date_end:
          type: string
          format: date-time
          nullable: true
          description: >-
            Scheduled end (ISO 8601, UTC). `null` runs until the budget is
            exhausted.
          example: null
        date_end_ts:
          type: integer
          nullable: true
          description: Scheduled end as a Unix timestamp.
          example: null
        created_at:
          type: string
          format: date-time
          description: Creation date (ISO 8601, UTC).
          example: '2026-04-28T09:12:44Z'
        created_at_ts:
          type: integer
          description: Creation date as a Unix timestamp.
          example: 1777367564
        creative:
          type: object
          nullable: true
          description: Creative the campaign serves. `null` if it was deleted.
          properties:
            public_id:
              type: string
              description: >-
                Creative public id. Pass it as `creative_public_id` to filter
                this list.
              example: cpcr_p1bzku7u
            display_name:
              type: string
              nullable: true
              description: Name shown on the ad.
              example: Bella
            images:
              type: array
              description: Creative images, 200 px webp.
              items:
                type: object
                properties:
                  hash:
                    type: string
                    nullable: true
                    description: >-
                      Stable 6-char hex id of the image. `null` for legacy rows
                      that pre-date the multi-image carousel.
                    example: d3e401
                  url:
                    type: string
                    format: uri
                    description: CDN URL of the image.
                    example: https://cdn.otsync.com/creatives/d3e401_200.webp
        link:
          type: object
          nullable: true
          description: >-
            OnlyFans link the campaign sends traffic to. `null` if no link was
            minted.
          properties:
            url:
              type: string
              format: uri
              description: Destination URL.
              example: https://onlyfans.com/action/trial/xxxxxxxx
            trial_days:
              type: integer
              nullable: true
              description: >-
                Trial length in days for a trial link. `null` for tracking and
                manual links.
              example: null
            guests:
              type: integer
              nullable: true
              description: >-
                Visits recorded on the link. `null` for a manual link, which
                carries no tracking.
              example: 1840
        stats:
          type: object
          description: Lifetime counters plus today's delta (UTC day).
          properties:
            impressions:
              type: integer
              example: 412330
            clicks:
              type: integer
              example: 5120
            unique_clicks:
              type: integer
              example: 4380
            spend_cents:
              type: integer
              description: Amount spent so far, in cents.
              example: 24090
            fans:
              type: integer
              nullable: true
              description: >-
                Fans attributed to the campaign's tracking links. `null` when
                the campaign has no tracking link, so fans are not measurable at
                all — distinct from `0`, which means measured and none yet.
              example: 214
            revenue_cents:
              type: integer
              nullable: true
              description: >-
                Revenue from those fans, in cents. `null` under the same
                condition as `fans`.
              example: 138750
            today:
              type: object
              description: Deltas for the current UTC day.
              properties:
                impressions:
                  type: integer
                  example: 8120
                unique_clicks:
                  type: integer
                  example: 96
                fans:
                  type: integer
                  nullable: true
                  example: 4
    Pagination:
      type: object
      description: >-
        Page-based pagination, returned by every list endpoint that isn't a
        cursor feed.
      properties:
        page:
          type: integer
          description: Current page number (1-indexed).
          example: 1
        page_size:
          type: integer
          description: Number of items per page. Default 50, max 100.
          example: 50
        total:
          type: integer
          description: Total number of records matching the filters.
          example: 150
        total_pages:
          type: integer
          description: Total pages available.
          example: 3
        has_next:
          type: boolean
          description: >-
            `true` when `page < total_pages` (i.e. there is at least one more
            page to fetch).
          example: true
    ErrorResponse:
      type: object
      description: Standard error envelope for all 4xx/5xx responses.
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always false on error responses.
        error:
          type: string
          description: Stable snake_case machine-readable error code. Branch on this.
          example: validation_failed
        message:
          type: string
          description: >-
            Human-friendly text. For 5xx this is always the literal `Server
            error`. For 4xx an actionable validation/auth message is returned.
        details:
          type: object
          nullable: true
          description: >-
            Optional per-field diagnostic information. On 422 carries `{<field>:
            ["error_code", ...]}`. On 402 (`insufficient_balance`) carries
            `{required, current}`. On 426 (`unpaid_invoices`) carries `{count,
            total, oldest_date_ts}`. Absent on most other errors.
          additionalProperties: true
        retry_after:
          type: integer
          nullable: true
          description: >-
            Seconds until the next request will succeed. Present only on 429
            responses (rate limit). Mirrors the `Retry-After` HTTP header.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key from the Studio Dashboard

````