> ## 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.

# Create Campaign

> Create a CPC campaign.

A campaign serves one of your CPC creatives across partner placements at up to `max_bid_cents` per click, capped by the daily and total budgets. Pick the creative from [`GET /cpc/creatives`](/docs/api/cpc-creatives-list); it has to be `active` and belong to an active OnlyFans account.

Your wallet balance must cover `budget_total_cents` at creation. For tracking and trial creatives the OnlyFans link is minted first; if that fails, no campaign is created and the request answers `502 link_creation_failed`, safe to retry.

Money is integer cents everywhere on this resource: bids from 10 to 200 cents, daily budget from $20 to $50,000, total budget from $100 to $1,000,000. Dates without an offset are read in the Studio timezone.


## OpenAPI

````yaml POST /cpc/campaigns
openapi: 3.0.3
info:
  title: OnlyTraffic Studio API
  version: 1.1.0
  description: >-
    External API for OnlyTraffic Studio. Manage and retrieve data about your
    subscribers, CPL orders, CPC orders and CPC campaigns.
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 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:
    post:
      tags:
        - CPC
      summary: Create a CPC campaign.
      description: Create a CPC campaign.
      operationId: createCpcCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CpcCampaignCreateRequest'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      campaign_id:
                        type: string
                        example: cpcp_a1b2c3d4
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            Wallet balance is below the total budget (`insufficient_balance`,
            with `required_cents` and `balance_cents` in `details`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Creative not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Validation failed, the creative is not eligible
            (`creative_not_active`, `of_account_disabled`,
            `of_account_not_active`, `creative_has_no_url`), or the budgets and
            dates are inconsistent (`budget_daily_exceeds_total`,
            `date_end_before_start`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Rate limit exceeded, or another campaign request for this account is
            in progress.
          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'
        '502':
          description: >-
            The OnlyFans link could not be minted (`link_creation_failed`). No
            campaign was created; retry with back-off.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CpcCampaignCreateRequest:
      type: object
      required:
        - name
        - creative_public_id
        - max_bid_cents
        - budget_daily_cents
        - budget_total_cents
      properties:
        creative_public_id:
          type: string
          maxLength: 32
          description: >-
            Public id of one of your CPC creatives (`GET /cpc/creatives`). The
            creative must be `active` and sit on an active OnlyFans account.
          example: cpcr_p1bzku7u
        name:
          type: string
          maxLength: 100
          description: Campaign name shown in Studio.
          example: Reddit push September
        max_bid_cents:
          type: integer
          minimum: 10
          maximum: 200
          description: Maximum bid per click, in cents (10 to 200).
          example: 55
        budget_daily_cents:
          type: integer
          minimum: 2000
          description: >-
            Daily budget cap, in cents: at least 2000, at most 5000000
            ($50,000), and never above `budget_total_cents`.
          example: 5000
          maximum: 5000000
        budget_total_cents:
          type: integer
          minimum: 10000
          description: >-
            Lifetime budget cap, in cents: at least 10000, at most 100000000
            ($1,000,000). The campaign flips to `completed` when spend reaches
            it.
          example: 100000
          maximum: 100000000
        date_start:
          type: string
          format: date
          description: >-
            Scheduled start, `YYYY-MM-DD` or ISO 8601. Defaults to today in the
            Studio timezone when omitted; a value with an offset is converted.
          example: '2026-09-15'
        date_end:
          type: string
          format: date
          nullable: true
          description: >-
            Scheduled end, must be later than `date_start`. `null` runs the
            campaign until the total budget is spent.
          example: null
        status:
          type: string
          enum:
            - active
            - paused
          description: >-
            Initial state. `paused` creates the campaign without serving it;
            switch to `active` later through the settings endpoint.
          example: active
          default: active
        freq_cap:
          type: integer
          minimum: 0
          maximum: 100
          description: >-
            Maximum impressions shown to the same visitor within
            `freq_cap_days`. `0` means uncapped.
          example: 3
          default: 0
        freq_cap_days:
          type: integer
          enum:
            - 1
            - 3
            - 7
          description: Window the frequency cap is measured over, in days.
          example: 3
          default: 3
        blocked_placements:
          type: array
          maxItems: 500
          description: >-
            Placement keys excluded from serving. Same `site-xxxxxxxx` keys the
            stats endpoint returns.
          items:
            type: string
            pattern: ^site-[0-9a-f]{8}$
            example: site-1f4c9ab2
        link_name_prefix:
          type: string
          minLength: 2
          maxLength: 40
          pattern: ^[\w .\-]+$
          description: >-
            Prefix for the tracking-link names minted for this campaign.
            Defaults to `CPC`.
          example: CPC
    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

````