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

# Проверить пиксель

> Sends one check to the platform with the stored token, same as **Check** in Tools -> Pixels. The check is queued: the answer is the pixel as it is now, and `health`, `health_error` and `health_checked_at` change within a minute. Read the pixel list to see the outcome.

At most one check a minute per pixel: a second call inside that minute answers `Checked less than a minute ago, showing the latest result`.

Meta: the check is a test event, visible in Events Manager -> Test Events when the pixel has a test event code. TikTok: a check needs a test event code on the pixel; without one `health` stays `unknown` until a campaign sends its first event.

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

- `404` `Pixel not found`: unknown id or not your pixel.
- `422` `pixel_id is required`.
- `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, read the pixel list before repeating it.

То же, что **Send test** в строке пикселя в **Tools -> Pixels**. Мы отправляем на платформу одну проверку с сохранённым токеном и записываем результат в пиксель.

## Как прочитать результат

Проверка ставится в очередь. Ответ этого запроса показывает пиксель таким, какой он сейчас; результат появляется в течение минуты. Читайте его в [списке пикселей](https://onlytraffic.com/docs/ru/partners/api/pixels.md):

| Поле | После проверки |
| - | - |
| `health` | `healthy`, если платформа приняла проверку, `error`, если отклонила |
| `health_error` | Ответ самой платформы при `health` = `error`, например про неверный токен |
| `health_checked_at` | Время проверки |

Повторный запрос в течение минуты новую проверку не отправляет и отвечает `Checked less than a minute ago, showing the latest result`.

## Что получает платформа

| Платформа | Проверка |
| - | - |
| Meta | Одно тестовое событие `PageView`. Если у пикселя задан тестовый код, оно видно в Events Manager на вкладке **Test events** |
| TikTok | Одно тестовое событие `HealthCheck`, только если у пикселя задан тестовый код. Без кода ничего не отправляется, и `health` остаётся `unknown` до первого события кампании |

Такая же проверка сама запускается после [создания](https://onlytraffic.com/docs/ru/partners/api/pixel-create.md) и [изменения](https://onlytraffic.com/docs/ru/partners/api/pixel-update.md) пикселя и раз в сутки для пикселей, которые ничего не отправляли. Каждое боевое событие тоже обновляет `health`.

## Проверка до запуска рекламы

1. Возьмите код в инструменте Test Events платформы и сохраните его через [изменение пикселя](https://onlytraffic.com/docs/ru/partners/api/pixel-update.md) в поле `test_event_code`.
2. Вызовите этот метод и смотрите тестовую вкладку платформы: событие появится в течение минуты.
3. До запуска рекламы уберите код запросом с `"test_event_code": ""`.

## Ошибки

| Сообщение | Значение |
| - | - |
| `Pixel not found` | Неизвестный `pixel_id` или не ваш пиксель (`404`) |
| `pixel_id is required` | Не передан id (`422`) |


## OpenAPI

````yaml api/openapi-partners.json POST /api/marketer/pixels/check
openapi: 3.0.2
info:
  title: OnlyTraffic Marketer API
  version: 2.5.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, create / update / archive / check
      pixels (same key, same rules as the cabinet)
paths:
  /api/marketer/pixels/check:
    post:
      tags:
        - Write
      summary: Check a pixel
      description: >-
        Sends one check to the platform with the stored token, same as **Check**
        in Tools -> Pixels. The check is queued: the answer is the pixel as it
        is now, and `health`, `health_error` and `health_checked_at` change
        within a minute. Read the pixel list to see the outcome.


        At most one check a minute per pixel: a second call inside that minute
        answers `Checked less than a minute ago, showing the latest result`.


        Meta: the check is a test event, visible in Events Manager -> Test
        Events when the pixel has a test event code. TikTok: a check needs a
        test event code on the pixel; without one `health` stays `unknown` until
        a campaign sends its first event.


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


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

        - `422` `pixel_id is required`.

        - `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, read the pixel list
        before repeating it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pixel_id
              properties:
                pixel_id:
                  type: string
                  format: uuid
                  description: >-
                    Pixel id in OnlyTraffic: `pixel_id` from the pixel list. Not
                    the Pixel ID of the ad platform.
            example:
              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:
                        $ref: '#/components/schemas/Pixel'
                  - $ref: '#/components/schemas/ErrorResponse'
              examples:
                success:
                  summary: Success
                  value:
                    status: success
                    message: Health check queued, the result appears within a minute
                    data:
                      pixel_id: 0b9f6c1e-7a52-4d0e-9a3b-2f1c8e5d4a67
                      platform: facebook
                      platform_pixel_id: '1234567890123456'
                      pixel_name: Main pixel
                      events:
                        - event: new_subscriber
                          platform_event: Subscribe
                        - event: new_transaction
                          platform_event: Purchase
                        - event: new_renewal
                          platform_event: Purchase
                      status: active
                      event_source_url: https://yourdomain.com
                      test_mode: false
                      health: healthy
                      health_error: null
                      health_checked_at: '2026-11-23T17:14:09+03:00'
                      health_checked_at_ts: 1795443249
                      campaigns: 12
                      active_campaigns: 8
                      created_at: '2026-09-03T12:40:00+03:00'
                      created_at_ts: 1788428400
                error:
                  summary: Error
                  value:
                    status: error
                    error_code: 404
                    message: Pixel not found
      security:
        - api_key: []
components:
  schemas:
    Pixel:
      type: object
      description: One of your ad-platform pixels.
      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: >-
            Event mapping of the pixel: which platform event each campaign event
            becomes. Events that are switched off are not listed. Renewals are
            their own entry (`new_renewal`): unless set otherwise they are sent
            as the same platform event as `new_transaction`.
        status:
          type: string
          enum:
            - active
            - archived
          description: >-
            `active` pixels can be attached to campaigns. An `archived` pixel
            sends nothing and is attached to no campaign.
        event_source_url:
          type: string
          nullable: true
          description: >-
            Meta only: your own landing page address sent as the event source of
            every event; null when not set.
        test_mode:
          type: boolean
          description: >-
            `true` when a test event code is set on the pixel: its events land
            in the platform's Test Events tool.
        health:
          type: string
          enum:
            - healthy
            - error
            - unknown
          description: >-
            Outcome of the latest send or check of the pixel: `healthy`,
            `error`, or `unknown` when nothing was sent or checked yet.
        health_error:
          type: string
          nullable: true
          description: >-
            What the platform answered when `health` is `error`, for example an
            expired access token; null otherwise.
        health_checked_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Time of the latest send or check, ISO 8601; null when there was
            none.
        health_checked_at_ts:
          type: integer
          nullable: true
        campaigns:
          type: integer
          description: Campaigns the pixel is attached to, completed ones included.
        active_campaigns:
          type: integer
          description: Active campaigns the pixel is attached to.
        created_at:
          type: string
          format: date-time
        created_at_ts:
          type: integer
    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.
    PixelEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - smartlink_click
            - new_subscriber
            - new_transaction
            - new_renewal
            - new_dialog
          description: >-
            What happened on the campaign: `new_subscriber` (a fan subscribed),
            `new_transaction` (a fan paid: tip, message, post, subscription,
            stream), `new_renewal` (a renewal: a recurring subscription
            payment), `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 or with the pixel
            write endpoints.
  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.