> ## Documentation Index
> Fetch the complete documentation index at: https://developers.tapfiliate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> Base URL, versioning, pagination, rate limits and errors of the Tapfiliate REST API.

The Tapfiliate REST API has resource-oriented URLs, accepts and returns JSON, and uses standard HTTP methods and status codes.

```
https://api.tapfiliate.com/1.6
```

Every request needs your API key in the `X-Api-Key` header, see [Authentication](/authentication). Also send `Accept: application/json`, so errors come back as JSON too.

## Versions

This reference describes version **1.6**. The version is part of the path of every request.

[Server-to-server postbacks](/tracking/server-to-server) use the `/1.7/pb/` endpoints.

## Pagination

Endpoints that return lists are paginated, 25 items per page. Ask for further pages with the `page` parameter; numbering starts at 1.

```bash theme={null}
curl "https://api.tapfiliate.com/1.6/conversions/?page=2" \
  -H "X-Api-Key: YOUR_API_KEY"
```

Links to other pages come in the `Link` header:

```
Link: <https://api.tapfiliate.com/1.6/conversions/?page=3>; rel="next",
      <https://api.tapfiliate.com/1.6/conversions/?page=51>; rel="last"
```

| `rel` | Page |
| - | - |
| `next` | The next page |
| `prev` | The previous page |
| `first` | The first page |
| `last` | The last page |

To read a whole list, follow `rel="next"` until it is absent.

## Rate limits

Limits apply per API key and per endpoint, in a fixed window that starts with your first request.

| Limit | Endpoints |
| - | - |
| 10 per minute | List all balances |
| 100 per minute | Get detailed information about a click |
| 900 per minute | List all conversions, list all clicks |
| 1,500 per 5 minutes | Affiliates, affiliate prospects and programs; list customers and commissions; retrieve a customer or a conversion |
| 300 per 15 minutes | Meta data and notes, affiliate groups, payments |

Responses of limited endpoints carry these headers:

| Header | Meaning |
| - | - |
| `X-RateLimit-Limit` | Requests allowed in the current window |
| `X-RateLimit-Remaining` | Requests left in the current window |
| `X-RateLimit-Reset` | When the window resets, as a Unix timestamp in seconds |

Over the limit, the API answers `429 Too Many Requests` with a plain-text body and no `Retry-After` header. Wait until `X-RateLimit-Reset`, then continue.

Other endpoints, such as creating conversions and customers, have no fixed limit today. Handle `429` everywhere anyway, so your integration keeps working if limits change.

## Errors

The API uses standard HTTP status codes and returns a JSON body explaining the error. [Errors](/api-reference/errors) lists the formats and the messages integrations run into most often.

## Conventions

* Timestamps are ISO 8601 with a UTC offset, for example `2021-03-03T12:39:19+0000`.
* Properties without a value are returned as `null`, not omitted.
* IDs of affiliates and programs are strings, for example `janejameson` or `johns-affiliate-program`.


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