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

# Отвязать пиксель от кампании

> Detaches one of your pixels from a campaign. Same as clearing the pixel under **Ad platforms** in the campaign's Postbacks window. The campaign stops sending new events to that pixel.

Only this pixel changes: custom postbacks and other pixels of the campaign stay as they are. Detaching a pixel that is not attached is not an error.

`campaign_id` is a `revc_…` RevShare campaign id or a `cplo_…` CPL campaign id (the campaign behind that order).

Returns the campaign row with its new `ad_pixels`: the shape of `revshare/campaigns` for a `revc_…` id, of `cpl/campaigns` for a `cplo_…` id.

**Errors** (`status: "error"`, HTTP 200):

- `404` `Campaign not found`: unknown id or not your campaign.
- `404` `Pixel not found`: unknown id or not your pixel.
- `422` `campaign_id is required` or `pixel_id is required`.
- `409` `The campaign postbacks are being changed right now, try again`: someone is saving the same campaign at this moment.
- `403` Access denied: missing / unknown key, or the account is not an active partner.
- `429` Rate limit exceeded (30 writes per minute per key, see the `Retry-After` header).
- `503` Service is temporarily unavailable: the platform did not answer in time. The action may still have been applied, check `ad_pixels` of the campaign before repeating it.

То же, что снять отметку с пикселя в блоке **Ad platforms** окна **Postbacks** кампании. Кампания перестаёт отправлять новые события в этот пиксель. `pixel_id` берите из `ad_pixels` кампании или из [списка пикселей](https://onlytraffic.com/docs/ru/partners/api/pixels.md).

## Что меняется

Только названный пиксель. Кастомные постбэки кампании и её остальные пиксели остаются как были. Сам пиксель не меняется: он остаётся в **Tools -> Pixels** и продолжает работать на других кампаниях.

Отвязка пикселя, который не привязан, отвечает успехом, поэтому запрос можно безопасно повторять. В ответе приходит строка кампании с новым `ad_pixels`: в формате [RevShare-кампаний](https://onlytraffic.com/docs/ru/partners/api/campaigns.md) для id `revc_…` и в формате [CPL-кампаний](https://onlytraffic.com/docs/ru/partners/api/cpl-campaigns.md) для id `cplo_…`.

Чтобы остановить пиксель сразу на всех кампаниях, заархивируйте его в **Tools -> Pixels**.

## Ошибки

| Сообщение | Значение |
| - | - |
| `Campaign not found` | Неизвестный id, не ваша кампания или числовой внутренний id (`404`) |
| `Pixel not found` | Неизвестный `pixel_id` или не ваш пиксель. Pixel ID платформы здесь не принимается (`404`) |
| `campaign_id is required`, `pixel_id is required` | Не передано обязательное поле (`422`) |
| `The campaign postbacks are being changed right now, try again` | Эту кампанию прямо сейчас сохраняют. Повторите запрос (`409`) |


## OpenAPI

````yaml api/openapi-partners.json POST /api/marketer/campaigns/pixels/detach
openapi: 3.0.2
info:
  title: OnlyTraffic Marketer API
  version: 2.4.0
  description: >-
    Partner (marketer) API for OnlyTraffic.


    **Authentication:** pass your API key in the `Authorization` header
    (`Authorization: your-api-key` or `Authorization: Bearer your-api-key`).
    Create keys in the partner cabinet: Tools -> API
    (https://partners.onlytraffic.com/tools/api). Up to 5 named keys per
    account, each **Full** or **Read-only**, with an optional expiry. Keys start
    with `ot_partners_` and are shown once, at creation. Read-only keys cannot
    call the `POST` endpoints (`error_code` 403, message `This API key is
    read-only`). An older legacy key keeps working with full access until you
    delete it on the same page.


    **Pagination:** all list endpoints accept `offset` (default 0) and `limit`
    (default 50, max 1000) as query parameters or JSON body fields.


    **Dates:** every timestamp field has two variants — an ISO 8601 string
    (`*_at`) and a Unix timestamp integer (`*_at_ts` / `*_ts`).


    **Writes:** a Full-access key reads and writes. Write endpoints are `POST`
    with a JSON body, accept public ids only (`revc_…`, `cplo_…`) and answer
    with the updated object in `data`. Rate limit: 120 requests per minute for
    reads, 30 per minute for writes, per account (shared by all its keys).
servers:
  - url: https://partners.onlytraffic.com
security: []
tags:
  - name: RevShare
    description: RevShare campaigns and financial data
  - name: CPL
    description: Cost-Per-Lead orders placed against your offers
  - name: CPC
    description: Cost-Per-Click orders and the category catalog
  - name: Subscribers
    description: Fans acquired through your campaigns
  - name: Stats
    description: Dashboard-style statistics widgets (fans, income, conversion)
  - name: Pixels
    description: >-
      Ad-platform pixels (Meta Ads, TikTok Ads) and the campaigns they are
      attached to
  - name: Write
    description: >-
      Write API: start / stop / update campaigns, accept / reject / stop CPL
      campaigns, attach / detach pixels (same key, same rules as the cabinet)
paths:
  /api/marketer/campaigns/pixels/detach:
    post:
      tags:
        - Write
      summary: Detach a pixel from a campaign
      description: >-
        Detaches one of your pixels from a campaign. Same as clearing the pixel
        under **Ad platforms** in the campaign's Postbacks window. The campaign
        stops sending new events to that pixel.


        Only this pixel changes: custom postbacks and other pixels of the
        campaign stay as they are. Detaching a pixel that is not attached is not
        an error.


        `campaign_id` is a `revc_…` RevShare campaign id or a `cplo_…` CPL
        campaign id (the campaign behind that order).


        Returns the campaign row with its new `ad_pixels`: the shape of
        `revshare/campaigns` for a `revc_…` id, of `cpl/campaigns` for a
        `cplo_…` id.


        **Errors** (`status: "error"`, HTTP 200):


        - `404` `Campaign not found`: unknown id or not your campaign.

        - `404` `Pixel not found`: unknown id or not your pixel.

        - `422` `campaign_id is required` or `pixel_id is required`.

        - `409` `The campaign postbacks are being changed right now, try again`:
        someone is saving the same campaign at this moment.

        - `403` Access denied: missing / unknown key, or the account is not an
        active partner.

        - `429` Rate limit exceeded (30 writes per minute per key, see the
        `Retry-After` header).

        - `503` Service is temporarily unavailable: the platform did not answer
        in time. The action may still have been applied, check `ad_pixels` of
        the campaign before repeating it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - campaign_id
                - pixel_id
              properties:
                campaign_id:
                  type: string
                  description: >-
                    Campaign public id (`revc_…`) or CPL campaign public id
                    (`cplo_…`).
                pixel_id:
                  type: string
                  format: uuid
                  description: >-
                    Pixel id in OnlyTraffic: `pixel_id` from the pixel list or
                    from `ad_pixels` of a campaign. Not the Pixel ID of the ad
                    platform.
            example:
              campaign_id: revc_k3m9x2
              pixel_id: 0b9f6c1e-7a52-4d0e-9a3b-2f1c8e5d4a67
      responses:
        '200':
          description: Success (check `status`; errors are also HTTP 200)
          content:
            application/json:
              schema:
                oneOf:
                  - title: Success
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - success
                      message:
                        type: string
                      data:
                        description: >-
                          The campaign after the change: a RevShare campaign row
                          for a `revc_…` id, a CPL campaign row for a `cplo_…`
                          id. Its `ad_pixels` is the new pixel list.
                        oneOf:
                          - $ref: '#/components/schemas/RevShareCampaign'
                          - $ref: '#/components/schemas/CplCampaign'
                  - $ref: '#/components/schemas/ErrorResponse'
              examples:
                success:
                  summary: Success
                  value:
                    status: success
                    message: Pixel detached
                    data:
                      campaign_id: revc_k3m9x2
                      of_account_id: 456789
                      of_username: modelname
                      name: Meta ads, US
                      url: https://ofprofile.com/cpg?hash=4f7c2a9e61b3&click_id=
                      type: smartlink_tracking
                      status: active
                      revshare_percent: 40
                      visits: 1200
                      subscribers: 85
                      subscribers_today: 3
                      income: 542.3
                      income_today: 12.5
                      revenue: 216.92
                      onlyfans_account:
                        name: Model Name
                        username: modelname
                        about: About text
                        tags:
                          - brunette
                        avatar:
                          original: https://cdn.example.com/avatar.jpg
                          thumbnail: https://cdn.example.com/avatar_thumb.jpg
                          thumbnail_640: https://cdn.example.com/avatar_640.jpg
                        demo_content: []
                        regular_price: 9.99
                        promotions: []
                        blocked_countries: []
                        subscribers_count: 3400
                        likes_count: 87000
                        posts_count: 560
                        photos_count: 420
                        videos_count: 140
                        performer_top: 5
                      tags:
                        - test-tag
                      ad_pixels: []
                      created_at: '2024-01-01T00:00:00+00:00'
                      created_at_ts: 1704067200
                      finished_at: null
                      finished_at_ts: null
                      changed_at: '2024-06-01T12:00:00+00:00'
                      changed_at_ts: 1717243200
                error:
                  summary: Error
                  value:
                    status: error
                    error_code: 422
                    message: pixel_id is required
      security:
        - api_key: []
components:
  schemas:
    RevShareCampaign:
      type: object
      properties:
        campaign_id:
          type: string
          description: Campaign public id.
        of_account_id:
          type: integer
        of_username:
          type: string
        name:
          type: string
        url:
          type: string
          format: uri
          nullable: true
          description: Active OnlyFans campaign/trial URL.
        type:
          type: string
          enum:
            - date
            - link
            - trial
            - smartlink
            - smartlink_trial
            - smartlink_tracking
            - shared_link
            - shared_trial
            - unknown
        status:
          type: string
          enum:
            - active
            - completed
        revshare_percent:
          type: number
          description: Your revenue share percentage.
        visits:
          type: integer
          description: Total click/visit count from the tracking stats.
        subscribers:
          type: integer
          description: Total subscribers acquired.
        subscribers_today:
          type: integer
        earnings:
          type: number
          description: >-
            Your earned share, all time (USD). The Earnings figure of the
            cabinet.
        earnings_today:
          type: number
          description: Your earned share added by the latest daily stats row (USD).
        fan_spend:
          type: number
          description: >-
            What the fans spent on the creator through this campaign, all time
            (USD), before your share.
        fan_spend_today:
          type: number
          description: >-
            Fan spend added by the latest daily stats row (USD): the creator's
            net after the OnlyFans 20% fee, before your share.
        income:
          type: number
          deprecated: true
          description: >-
            Legacy name of fan_spend: what the fans spent, all time, before your
            share. Kept for existing integrations; use earnings for your income.
        income_today:
          type: number
          deprecated: true
          description: Legacy name of fan_spend_today. Use earnings_today for your income.
        revenue:
          type: number
          deprecated: true
          description: >-
            Legacy name of earnings: your earned share, all time. Kept for
            existing integrations.
        onlyfans_account:
          $ref: '#/components/schemas/OnlyfansAccount'
        tags:
          type: array
          items:
            type: string
        ad_pixels:
          type: array
          items:
            $ref: '#/components/schemas/AdPixel'
          description: >-
            Ad-platform pixels attached to the campaign; an empty array when
            there are none. Pixels work on OT tracking-link campaigns only.
        created_at:
          type: string
          format: date-time
        created_at_ts:
          type: integer
        finished_at:
          type: string
          format: date-time
          nullable: true
        finished_at_ts:
          type: integer
          nullable: true
        changed_at:
          type: string
          format: date-time
        changed_at_ts:
          type: integer
    CplCampaign:
      type: object
      properties:
        order_id:
          type: string
          description: CPL campaign public id (prefix `cplo_`).
        offer_id:
          type: integer
          description: Partner offer id. `0` for client-offer campaigns.
        client_offer_id:
          type: integer
          nullable: true
          description: >-
            Client offer id for client-offer campaigns; `null` for partner-offer
            campaigns.
        is_client_offer:
          type: boolean
          description: '`true` when the campaign was placed against a client offer.'
        of_account_id:
          type: integer
        of_username:
          type: string
        url:
          type: string
          format: uri
          nullable: true
          description: >-
            Promotion URL (OnlyFans campaign/trial link). Available once the
            campaign has been accepted; `null` otherwise.
        source:
          type: string
          nullable: true
          description: >-
            Traffic source (from the running campaign, falling back to the
            offer). `null` until the campaign is accepted.
        quantity_ordered:
          type: integer
        quantity_delivered:
          type: integer
          description: >-
            Delivered actions counted against the campaign's target action
            (subscriptions, messages, purchases, or paid subscriptions).
        price_per_subscriber:
          type: number
        total_earned:
          type: number
          description: >-
            billable × price_per_subscriber, where billable = min(ordered,
            delivered), or all delivered actions when the campaign is open-ended
            (quantity = 0).
        status:
          type: string
          enum:
            - waiting
            - accepted
            - rejected
            - completed
            - cancelled
            - paused
        queue_position:
          type: integer
          nullable: true
          description: >-
            `waiting` campaigns only: `0` means the campaign is with you and can
            be accepted, a higher number means it still waits behind other
            partners' campaigns for the same client (accept answers `409` until
            then). `null` for other statuses.
        onlyfans_account:
          $ref: '#/components/schemas/OnlyfansAccount'
        auto_renewal:
          type: object
          properties:
            enabled:
              type: boolean
            quantity:
              type: integer
              description: Repeat quantity when the campaign completes.
            max_price:
              type: number
              description: Maximum payout per subscriber you may charge on a renewal.
            next_price:
              type: number
              description: >-
                Your payout per subscriber for the next cycle, resolved from the
                offer price steps for the repeat quantity.
            can_renew:
              type: boolean
              description: >-
                Whether the renewal will actually go through: client account
                active, offer available, price within the cap and enough balance
                for the next cycle.
        ad_pixels:
          type: array
          items:
            $ref: '#/components/schemas/AdPixel'
          description: >-
            Ad-platform pixels attached to the campaign; an empty array when
            there are none. Pixels work on OT tracking-link campaigns only.
        created_at:
          type: string
          format: date-time
        created_at_ts:
          type: integer
        changed_at:
          type: string
          format: date-time
        changed_at_ts:
          type: integer
        completed_at:
          type: string
          format: date-time
          nullable: true
        completed_at_ts:
          type: integer
          nullable: true
    ErrorResponse:
      title: Error
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Human-readable error description.
        error_code:
          type: integer
          description: >-
            403: access denied (missing / unknown / expired / revoked key, or
            the account is not an active partner: `Error! Access denied`; a
            Read-only key calling a write endpoint: `This API key is
            read-only`). 404: not found. 422: bad request params (message says
            what is wrong). 429: rate limit exceeded (a `Retry-After` header is
            set) or another campaign start is still running. 500: server error.
            503: the platform did not answer a write in time, retry later.
    OnlyfansAccount:
      type: object
      description: Cached snapshot of the OnlyFans model profile.
      properties:
        name:
          type: string
        username:
          type: string
        about:
          type: string
        tags:
          type: array
          items:
            type: string
        avatar:
          type: object
          properties:
            original:
              type: string
              format: uri
            thumbnail:
              type: string
              format: uri
            thumbnail_640:
              type: string
              format: uri
        demo_content:
          type: array
          description: >-
            Model's demo photos/videos. Empty for finished campaigns and for
            completed/rejected CPL campaigns.
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - photo
                  - video
              url:
                type: string
                format: uri
              thumbnail:
                type: string
                format: uri
        regular_price:
          type: number
        promotions:
          type: array
        blocked_countries:
          type: array
          items:
            type: string
        subscribers_count:
          type: integer
        likes_count:
          type: integer
        posts_count:
          type: integer
        photos_count:
          type: integer
        videos_count:
          type: integer
        performer_top:
          type: number
          description: Top percentage among all performers (e.g. 5 = top 5%).
    AdPixel:
      type: object
      description: An ad-platform pixel attached to a campaign.
      properties:
        pixel_id:
          type: string
          format: uuid
          description: >-
            Pixel id in OnlyTraffic. This is the id the attach and detach
            endpoints take.
        platform:
          type: string
          enum:
            - facebook
            - tiktok
          description: 'Ad platform: `facebook` (Meta Ads) or `tiktok` (TikTok Ads).'
        platform_pixel_id:
          type: string
          description: >-
            The pixel on the platform side: Pixel ID from Meta Events Manager or
            Pixel Code from TikTok Events Manager.
        pixel_name:
          type: string
          description: >-
            Pixel name from Tools -> Pixels; an empty string when the pixel has
            no name.
        events:
          type: array
          items:
            $ref: '#/components/schemas/PixelEvent'
          description: Events this campaign sends to the pixel.
        enabled:
          type: boolean
          description: '`true` while the pixel is active and the events are sent.'
        health:
          type: string
          enum:
            - healthy
            - error
            - unknown
          description: >-
            Outcome of the latest send or check of the pixel on any campaign:
            `healthy`, `error`, or `unknown` when nothing was sent or checked
            yet. The error text is in the pixel list.
        last_event_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Time of the latest event of this campaign the platform accepted, ISO
            8601; null when there was none.
        last_event_at_ts:
          type: integer
          nullable: true
        last_error:
          type: string
          nullable: true
          description: >-
            What the platform answered to the latest failed send of this
            campaign, for example an expired access token; null when no send
            failed. Compare `last_error_at` with `last_event_at` to tell whether
            the problem is still there.
        last_error_at:
          type: string
          format: date-time
          nullable: true
          description: Time of that failed send, ISO 8601; null when no send failed.
        last_error_at_ts:
          type: integer
          nullable: true
        events_sent_today:
          type: integer
          description: >-
            Events of this campaign the platform accepted today. The day follows
            the API time zone (UTC+03:00).
    PixelEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - smartlink_click
            - new_subscriber
            - new_transaction
            - new_dialog
          description: >-
            What happened on the campaign: `new_subscriber` (a fan subscribed),
            `new_transaction` (a fan paid), `new_dialog` (a fan sent the model 3
            or more messages), `smartlink_click` (a click on the tracking link,
            TikTok pixels only).
        platform_event:
          type: string
          nullable: true
          description: >-
            Event name the ad platform receives, for example `Subscribe` or
            `Purchase`. Set per pixel in Tools -> Pixels.
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        API key from the partner cabinet, Tools -> API
        (https://partners.onlytraffic.com/tools/api): up to 5 named keys per
        account, each Full or Read-only, `ot_partners_` prefix, shown once at
        creation. Raw value or `Bearer` form. Read-only keys cannot call the
        `POST` endpoints (403 `This API key is read-only`); expired or revoked
        keys get 403 `Error! Access denied`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.