> For the complete documentation index, see [llms.txt](https://help.theaffiliateplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.theaffiliateplatform.com/apis-and-configurations/api-keys-and-url.md).

# API Keys and URL

TheAffiliatePlatform (TAP) has two kinds of API keys:

* **Affiliate API key**: an affiliate uses it to get reports on their own traffic. See [Reporting API](https://help.theaffiliateplatform.com/apis-and-configurations/reporting-api.md).
* **Operator API key**: the operator uses it to get data on all affiliates: [Reporting API](https://help.theaffiliateplatform.com/apis-and-configurations/reporting-api.md), [Balance and Payment API](https://help.theaffiliateplatform.com/apis-and-configurations/balance-and-payment-api.md), [Deals management API](https://help.theaffiliateplatform.com/apis-and-configurations/deals-management-api.md) and [More API methods](https://help.theaffiliateplatform.com/apis-and-configurations/more-api-methods.md).

Send the key in the `authorization` header of every API call. The API host depends on your setup, so always use the host that is shown next to the key (see below).

### **Obtaining API key for Affiliate**

The API must be enabled for the affiliate first. To enable it and create a key in the TAP BackOffice:

1. Open the affiliate and go to the **Overview** tab.
2. In the **API** block, turn the switch on (**Enabled**).
3. Click **Save & Create API key**.
4. Confirm the action. A new key cancels all earlier keys of this affiliate.
5. The **API key Created!** window shows the key. Copy it and give it to the affiliate in a safe way.

{% hint style="danger" %}
The full key is shown only once. After you close the window, the **API** block shows only the start and the end of the key. If the key is lost, create a new one. The old key then stops working.
{% endhint %}

<figure><img src="https://2789002490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkbip9hFgRFwIv4mXJPnz%2Fuploads%2F5UVV5boE4rwk3bB6C1j6%2Fimage.png?alt=media&amp;token=c19d8d8f-6dcc-46e2-a832-db9ea5c819e3" alt=""><figcaption></figcaption></figure>

When the affiliate already has a key, the button is **+ Re-generate API key**. To cancel the key, turn the switch off and click **Save & Delete API key**.

#### Affiliates can create their own key

When the API is enabled for an affiliate, the **Account Settings** page of their affiliate account has an **API key** block. There the affiliate can:

* see the API host to use ("Important, your API host is: …");
* click **Create API Key** to make a new key.

The new key is also shown only once, and it cancels the earlier keys. The affiliate cannot see an existing key again. If they lose it, they create a new one, or you create one for them in the BackOffice.

### **Obtaining API key for Operator**

1. In the TAP BackOffice, go to **Settings** (in the **Configuration** menu).
2. Find the field **API Key to access Media reports, Balance API and Affiliates data**.
3. Click **Generate API Key** and confirm.

The key appears in the field and stays visible there. Under the field, the BackOffice shows your API host: "Important, your API host is: …". Use this host for all API calls.

{% hint style="danger" %}
A new operator key cancels the old one. If an integration already uses the operator key, it stops working until you put the new key into it.
{% endhint %}

{% hint style="info" %}
The field **API Key to submit registrations and activities** on the same page is a different key. It is used to send registrations, deposits, withdrawals and wagering activities to TAP. Ask your account manager for its documentation.
{% endhint %}

<figure><img src="https://2789002490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fkbip9hFgRFwIv4mXJPnz%2Fuploads%2FPRNZrMvmCQLBJFhCcS5N%2Fimage.png?alt=media&amp;token=22b45805-be19-48a2-a862-2ea7adec36f6" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.theaffiliateplatform.com/apis-and-configurations/api-keys-and-url.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
