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

# Campaign Settings

> Update CPC campaign settings.

Partial update: send only the settings you want to change. Pause and resume a campaign through `status` (`paused` / `active`). `blocked_placements` replaces the whole list; `date_end: null` clears the end date and `link_name_prefix: null` resets the prefix to `CPC`.

Only `active` and `paused` campaigns can be edited. A `completed` campaign (budget or end date reached) cannot be re-activated; create a new one instead. The daily budget must stay within the total budget and `date_end` must stay after `date_start` after the change is merged.


## OpenAPI

````yaml POST /cpc/campaigns/{public_id}/settings
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/{public_id}/settings:
    post:
      tags:
        - CPC
      summary: Update CPC campaign settings.
      description: Update CPC campaign settings.
      operationId: updateCpcCampaignSettings
      parameters:
        - $ref: '#/components/parameters/PublicIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CpcCampaignSettingsRequest'
      responses:
        '200':
          description: Updated.
          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'
        '404':
          description: Campaign not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Campaign is frozen (`campaign_completed`, `campaign_archived`), the
            body changes nothing (`nothing_to_update`), validation failed, or
            the merged 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 action on this campaign 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'
components:
  parameters:
    PublicIdPath:
      name: public_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9_]+$
      description: >-
        Resource public id. Format varies by endpoint: `cplo_xxxxxxx` for CPL
        orders, `cpco_xxxxxxx` for CPC orders, `swpo_xxxxxxx` for swap orders,
        `cpcr_xxxxxxx` for CPC creatives, `revi_xxxxxxx` for RevShare invoices.
      example: cplo_xxxxxxx
  schemas:
    CpcCampaignSettingsRequest:
      type: object
      description: >-
        Send only the settings you want to change. Everything else keeps its
        current value. `null` is a real value here: it clears `date_end` and
        resets `link_name_prefix`.
      properties:
        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. A bare date is read in
            the Studio timezone; 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`. Pass `null` to clear
            the end date.
          example: null
        status:
          type: string
          enum:
            - active
            - paused
          description: '`paused` pauses the campaign, `active` resumes it.'
          example: 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
        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
          maxItems: 500
          description: >-
            Replaces the whole list of excluded placements. Pass an empty array
            to unblock everything.
          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. Pass
            `null` to reset it to `CPC`.
          example: CPC
          nullable: 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

````