> ## 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 Click Log

> Raw click log of an **OT smart link** campaign (campaign `type` `smartlink_tracking` / `smartlink_trial` on `revshare/campaigns`, or the OT tracking link behind a CPL campaign): the same rows as the Click log modal and its CSV export in the cabinet. Clicks are kept for 180 days; older rows are gone and `from` cannot reach them. Newest first. `campaign_id` is required: a `revc_…` RevShare campaign id or a `cplo_…` CPL campaign id (the campaign behind that order). Campaigns of other types answer `error_code` 422 `Click log is available for OT smart link campaigns only`.



## OpenAPI

````yaml api/openapi-partners.json GET /api/marketer/campaigns/clicks
openapi: 3.0.2
info:
  title: OnlyTraffic Marketer API
  version: 2.2.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: Write
    description: >-
      Write API: start / stop / update campaigns and accept / reject / stop CPL
      campaigns (same key, same rules as the cabinet)
paths:
  /api/marketer/campaigns/clicks:
    get:
      tags:
        - RevShare
      summary: Campaign click log
      description: >-
        Raw click log of an **OT smart link** campaign (campaign `type`
        `smartlink_tracking` / `smartlink_trial` on `revshare/campaigns`, or the
        OT tracking link behind a CPL campaign): the same rows as the Click log
        modal and its CSV export in the cabinet. Clicks are kept for 180 days;
        older rows are gone and `from` cannot reach them. Newest first.
        `campaign_id` is required: a `revc_…` RevShare campaign id or a `cplo_…`
        CPL campaign id (the campaign behind that order). Campaigns of other
        types answer `error_code` 422 `Click log is available for OT smart link
        campaigns only`.
      parameters:
        - name: campaign_id
          in: query
          required: true
          schema:
            type: string
            example: revc_k3m9x2
          description: >-
            Campaign public id (`revc_…`) or CPL campaign public id (`cplo_…`).
            Required.
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/limit'
        - name: from
          in: query
          schema:
            type: string
            format: date
            example: '2026-10-01'
          description: >-
            Start date (inclusive), format Y-m-d. Clicks older than 180 days are
            not stored.
        - name: to
          in: query
          schema:
            type: string
            format: date
            example: '2026-10-21'
          description: End date (inclusive), format Y-m-d.
        - name: country
          in: query
          schema:
            type: string
            minLength: 2
            maxLength: 2
            example: US
          description: Filter by visitor country, ISO 3166-1 alpha-2 (case-insensitive).
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                oneOf:
                  - title: Success
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - success
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/CampaignClick'
                  - $ref: '#/components/schemas/ErrorResponse'
              example:
                status: success
                data:
                  - campaign_id: revc_k3m9x2
                    date: '2026-10-20T14:03:11+03:00'
                    date_ts: 1760954591
                    country: US
                    ip: 203.0.113.42
                    referer: https://t.co/abc123
                    user_agent: >-
                      Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)
                      AppleWebKit/605.1.15
                    click_id: clk_7f3a9
                    params:
                      sub1: reddit
                      utm_campaign: oct
      security:
        - api_key: []
components:
  parameters:
    offset:
      name: offset
      in: query
      schema:
        type: integer
        default: 0
        minimum: 0
      description: Number of records to skip.
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 1000
      description: Number of records to return.
  schemas:
    CampaignClick:
      type: object
      properties:
        campaign_id:
          type: string
          description: Public id of the campaign the click belongs to (`revc_…`).
        date:
          type: string
          format: date-time
          description: Click time, ISO 8601.
        date_ts:
          type: integer
          description: Click time, unix timestamp.
        country:
          type: string
          nullable: true
          description: Visitor country, ISO 3166-1 alpha-2; null when unknown.
        ip:
          type: string
          description: Visitor IP address (IPv4 or IPv6).
        referer:
          type: string
          nullable: true
          description: HTTP Referer of the click; null when the browser sent none.
        user_agent:
          type: string
          nullable: true
          description: Visitor User-Agent, truncated to 255 characters; null when absent.
        click_id:
          type: string
          nullable: true
          description: >-
            External click id of the visit: the link's `click_id` parameter, or
            the Facebook `fbc` value built from `fbclid`. Use it to match the
            click with your tracker; null when absent.
        params:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom query parameters of the link (sub1…sub5, utm_*), lower-case
            names. Empty object when none.
    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.
  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.