Authentication
Every call carries an API key in the Authorization header. There are no sessions, cookies or sign-in calls.
Sending the key
curl "https://YOUR-NETWORK-DOMAIN/api/v1/me" \
-H "Authorization: Bearer lnk_your_key_here"
Use HTTPS. A call without the header, or with anything other than Bearer followed by a key, answers 401 invalid_token.
What a key is
A key is the prefix lnk_ followed by 43 characters, for example lnk_9fQ2…. Keys created before the product was called Linknetik start with atp_ and keep working. You create keys under My profile → API keys on your network.
The platform stores a hash of the key, not the key. That is why a key is shown only once, when it is created, and why nobody, the network included, can read it back for you. The list of keys shows the first characters so you can tell them apart.
What a key can do
A key acts as the user who created it. It sees what that user's role sees: a Network key sees the whole instance, an affiliate or advertiser key sees that account's own data and nothing else.
Inside that, scopes say which groups of endpoints the key may call. When you create a key you can leave it at * (everything you are allowed) or pick a narrower set. Give each integration the least it needs.
For affiliate and advertiser keys the network decides the upper limit: a key can never do more than the network granted to your account. Access and scopes has the details.
GET /me returns the scopes a key really has in token.scopes.
Expiry and revoking
- A key can be given an expiry date when it is created. Without one it does not expire.
- You can switch a key off and on again from the list of keys.
- Revoking a key deletes it for good. Create a new one to replace it.
All three apply on the very next call. There is nothing cached to wait for.
An affiliate or advertiser user can hold a limited number of keys; the network sets how many. Every key counts, switched on or off, so revoke the ones you no longer use. All your keys share one rate limit.
When a key is refused
| Answer | Why |
|---|---|
401 invalid_token | No Authorization header; or the key is unknown, switched off, expired or revoked; or the user it belongs to is no longer active. |
403 access_not_approved | Affiliate or advertiser key whose account has no approved API access, or whose access was revoked. |
403 feature_unavailable | The network's plan does not include the API. |
403 insufficient_scope | The key is valid but lacks the scope this endpoint needs. The message names the scope. |
The full list is in Errors.
Keeping keys safe
- Call the API from your server. A key in a web page or a mobile app can be read by anyone who has the app.
- Use one key per integration, labelled for what it does, so you can revoke one without stopping the others.
- Keep keys out of source control. Load them from the environment or a secrets store.
- If a key may have leaked, revoke it and create a new one. The old one stops working at once.