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

# API Introduction

> OnlyTraffic Marketer API v2: get RevShare offers and campaigns, CPL campaigns, CPC orders, transactions, subscribers and dashboard statistics programmatically, and start, stop or update campaigns.

The OnlyTraffic Marketer API gives you access to the RevShare offer catalog and to data about your campaigns, CPC orders, transactions, subscribers and statistics. It also lets you start, stop and update campaigns and accept or reject CPL campaigns. Use it to build integrations, dashboards, and automated workflows.

## Base URL

```text theme={null}
https://partners.onlytraffic.com
```

## Authentication

All requests require the `Authorization` header with an API key. Create keys in the partner cabinet: **Tools -> API** ([partners.onlytraffic.com/tools/api](https://partners.onlytraffic.com/tools/api)). An account can have up to 5 named keys, each **Full** or **Read-only**; a key is shown once at creation, so copy it right away. See [Authentication](https://onlytraffic.com/docs/partners/api/authentication.md) for the details.

```bash theme={null}
curl "https://partners.onlytraffic.com/api/marketer/revshare/campaigns" \
  -H "Authorization: your-api-key-here"
```

> [!NOTE]
>
> See the [Authentication](https://onlytraffic.com/docs/partners/api/authentication.md) page for error codes and detailed setup.

## Endpoints

| Endpoint | Method | Description |
| - | - | - |
| `/api/marketer/revshare/offers` | GET | RevShare offer catalog: models available to promote |
| `/api/marketer/revshare/campaigns` | GET | List your RevShare campaigns |
| `/api/marketer/revshare/transactions` | GET | RevShare financial transactions |
| `/api/marketer/campaigns/clicks` | GET | Raw click log of an OT smart link campaign (same rows as the cabinet CSV export) |
| `/api/marketer/cpl/campaigns` | GET | CPL campaigns placed against your offers |
| `/api/marketer/cpc/orders` | GET | CPC (pay-per-click) orders |
| `/api/marketer/cpc/categories` | GET | CPC category catalog for widget targeting |
| `/api/marketer/subscribers` | GET | Fans acquired through all campaigns (RevShare + CPL) |
| `/api/marketer/stats/fans` | GET | Fans acquired, per pricing model and per day |
| `/api/marketer/stats/income` | GET | Earnings, per pricing model and per day |
| `/api/marketer/stats/conversion` | GET | Fan engagement (3+ messages, purchases, ARPU) per pricing model |
| `/api/marketer/revshare/campaigns/start` | POST | Start a RevShare campaign on a model |
| `/api/marketer/revshare/campaigns/stop` | POST | Stop a RevShare campaign |
| `/api/marketer/revshare/campaigns/update` | POST | Rename a campaign, change its note or tags |
| `/api/marketer/cpl/campaigns/accept` | POST | Accept a CPL campaign placed on your offer |
| `/api/marketer/cpl/campaigns/reject` | POST | Reject a CPL campaign |
| `/api/marketer/cpl/campaigns/stop` | POST | Stop an accepted CPL campaign |
| `/api/marketer/cpl/campaigns/start` | POST | Start delivering traffic to a client's CPL offer (Find Offers) |

## Writing data

A Full-access key reads and writes; Read-only keys get `403` on the write endpoints. Write endpoints do exactly what you can do in the cabinet, with the same validation messages. Identifiers in write requests are public ids (`revc_…` campaign ids, `cplo_…` CPL campaign ids); numeric internal ids are rejected with `404`. Every write answers with the updated object in `data`, in the same shape as the matching list endpoint.

> [!NOTE]
>
> See the [Write API](https://onlytraffic.com/docs/partners/api/write-api.md) page for the rules and the per-endpoint pages for request bodies.

## Pagination

All list endpoints accept `offset` and `limit` as query parameters. The Stats endpoints aren't paginated. They take a `from` / `to` period instead: a Unix timestamp or a `Y-m-d` date, at most 366 days apart. CPC Categories isn't paginated either: it returns the full catalog in one response.

| Parameter | Default | Max | Description |
| - | - | - | - |
| `offset` | 0 | - | Number of records to skip |
| `limit` | 50 | 1000 | Number of records to return |

## Date formats

Every timestamp field has two variants:

* **ISO 8601 string** (`*_at`) e.g. `"2024-06-01T12:00:00+00:00"`
* **Unix timestamp integer** (`*_at_ts` / `*_ts`) e.g. `1717243200`

## Response format

All responses return HTTP `200`. The actual status is in the `status` field.

```json Success theme={null}
{
  "status": "success",
  "data": [ ... ]
}
```

```json Error theme={null}
{
  "status": "error",
  "error_code": 422,
  "message": "Invalid parameters"
}
```

## Error codes

| Code | Meaning |
| - | - |
| `403` | Access denied: missing, unknown, expired or revoked key, the account is not an active partner, or a Read-only key called a write endpoint |
| `404` | Resource not found |
| `422` | Invalid request parameters (`message` says what is wrong) |
| `429` | Rate limit exceeded, or another campaign start is still running |
| `500` | Server error |
| `503` | Service temporarily unavailable, retry later |


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