Plan availability
Advertiser APIs are available only for Awin Accelerate and Advanced customers.
Overview
Awin’s APIs let your own tools connect to your Awin accounts. For example, you can pull performance data or validate transactions without logging in to the Awin website.
To keep your data safe, every API request needs an API token. A token is a long code that works like a password for your tools.
This page shows you how to:
Get your token
Add your token to your API requests
Renew or revoke your token if you need to
Note
We’re introducing a new generation of APIs, that will gradually replace our legacy APIs.
Our new APIs require a new type of credential called Personal Cccess token (PAT). Your existing legacy API authentication will continue to work, and the PAT can work with the legacy APIs too.
Which credential works with which API
API Section | Base URL | Credential |
|---|---|---|
Our APIs |
| Personal Access Token (PAT) |
Legacy APIs |
| Your classic API token or a PAT |
How your token works
Your token belongs to you, not to an individual advertiser or partner account. It gives access to every account you can see when you log in to Awin.
For example, if you can see 10 partner accounts on the Awin website, your token gives access to data from all 10.
Note
Not all APIs may be available to you, based on your account permission level. Check each API article to find out which level is required.
Keep your token secret. Anyone who has it can get your data. They don’t need your username or password. If you think someone else has your token, revoke it right away.
Get your token
Personal Access Token (PAT)
A PAT is the successor to the classic API token, and the only credential Our APIs accept. Each PAT expires on a date you choose when you create it, and it’s shown only once, so copy it and store it securely.
Benefits of PAT
Works with both sets of APIs.
Allows you to have multiple tokens at the same time (up to 50).
You can name each token so you know which tool uses it.
Expiry date provides more control.
Create a PAT
You create and manage PATs on the API credentials page:
In the platform click on Settings icon in the top-right navigation.
Go to User settings > API credentials.
Choose Personal Access Token tab, and click Create token.
Follow the instructions shown to create the new token.
Copy your new Personal Access Token by clicking the clipboard icon and store it somewhere safe.
Important
If you lose the token, you can’t view it again. You’ll need to revoke it and create a new one.
Classic APIs token
Your existing Classic Token will keep working with the Legacy APIs, but we recommend switching to a PAT.
Create a Classic Token
You create and manage Classic Tokens on the API credentials page:
In the platform click on Settings icon in the top-right navigation.
Go to User settings > API credentials.
Choose Classic Token tab.
Click the Show token button.
Copy your Classic Token by clicking the clipboard icon and store it somewhere safe.
Add your token to your API requests
When your tool sends a request to an Awin API, it must include your token in a header. A header is a piece of extra information sent with each request.
The header you use depends on the API:
API | Method | Header to add |
|---|---|---|
All Awin APIs except the two below | Bearer token (PAT or classic) |
|
Conversion API and Proof of Purchase Publisher Transaction API | API key |
|
The page for each API also tells you which method it uses.
Send your PAT or legacy token in the Authorization header of every request. This works for Our APIs and the Legacy APIs.
Here are examples in curl, Postman and JavaScript:
Curl example
curl -H "Authorization: Bearer <your_token>" \
"https://api.awin.com/public/v1/..."Replace your_token with your token and the path with the endpoint you are calling. Every Our APIs path starts with a version, such as /v1; see the article on API versioning for how versions work.
Postman example
Open the Authorization tab.
Set Type to
Bearer Token.Paste your token in the Token field.
Postman will add the header for you. You can also add the header yourself on the Headers tab:
.png)
JavaScript example
fetch('https://api.awin.com/public/v1/...', {
headers: {
'Authorization': 'Bearer your_token'
}
The Conversion API and Proof of Purchase Publisher Transaction API authenticate with a key sent in the x-api-key header. Using your Legacy API token as the key is recommended for these APIs as it doesn’t expire.
Here are examples in curl, Postman and JavaScript:
Curl example
curl -H "x-api-key: your_API_key" \
"https://api.awin.com/..."Replace your_API_key with your token and the path with the endpoint you are calling.
Postman example
Go to the Headers tab.
Add a new header:
Key:
x-api-keyValue: your API key

JavaScript example
fetch('https://api.awin.com/...', {
headers: {
'x-api-key': 'your_API_key'
}
})Renew your Personal Access Token
If your PAT expired you can renew it if you still need it.
To renew a PAT:
In the platform click on Settings icon in the top-right navigation.
Go to User settings > API credentials.
Choose Personal Access Token tab.
Locate the token on the list and click the renew icon.
Select a new expiry date and click Renew token to confirm.
You Classic Token doesn’t expire so you don’t need to renew it.
Rotate your Personal Access Token
Personal Access Tokens have an expiry date, and an expired token stops working. To keep your integration running, create a new token before the old one expires, switch your integration over to it, then delete the old token. Build your integration so the token can be swapped without downtime, for example by reading it from a configuration setting or secrets store instead of hard-coding it.
Revoke your token
If someone you don’t trust gets your token, revoke it. This stops the token from working.
In the platform click on Settings icon in the top-right navigation.
Go to User settings > API credentials.
Choose the tab for your token type.
Personal Access Token tab: find the token in the list and click the remove icon.
Classic Token tab: click Revoke token.
Confirm in the pop-up.
Any integration using that token will stop working immediately.
Common errors
401 - Request is rejected due to a missing, invalid or expired token.
403 - Request uses a valid token, but without permission for that account or action.
To avoid issues with your PAT, pay attention to its expiry date, and renew it if needed.