Authentication and API keys
Presenting the key
Every call carries the key in the Authorization header:
Authorization: Bearer fpk_9al41uPRzeglnYvHa3YfvsK86OfQwx6BmC2EKmI0Vhw
Beareris case-insensitive, and whitespace around the secret is ignored.- No login call, no session, no cookie, no signature. A dashboard session cookie is never accepted on
/v1.
| Situation | Answer |
|---|---|
| Header absent or empty | 401 API_KEY_MISSING, with WWW-Authenticate: Bearer realm="freshperf-api" |
| Secret not recognised | 401 API_KEY_INVALID |
Key passed as a query parameter (?api_key=, ?apikey=, ?key=, ?token=, ?access_token=) | 400 API_KEY_IN_QUERY |
X-Acting-Account header present | 400 API_HEADER_NOT_ALLOWED |
What a key is
| The key | Detail |
|---|---|
| Secret | fpk_ + 43 characters, 47 in total |
| Storage | only a digest is kept. The secret is shown once, at creation or rotation |
keyPrefix | the first 12 characters (fpk_ + 8), shown in the dashboard, the logs and the emails |
| Acts on | your own account, or an account shared with you (see below) |
| Ceiling | 25 usable keys per account (active and unexpired), keys on a shared account included |
A key cannot create, list or revoke other keys.
Status, expiry, address allowlist and the owning account are re-read on every call.
A key on an account shared with you
When someone gave you access to their account (Account > Account access) and turned "Allow API keys" on for it, you can create, from your account, a key acting on theirs. The choice is the first step of the creation.
| A key on a shared account | |
|---|---|
| Acts on | that account only, never yours. The X-Acting-Account header stays refused |
| Can do | at most what the shared access lets you do, service by service, sites included. A permission ticked on the key but not granted on the service answers 403 ACCOUNT_ACCESS_DENIED |
| Possible permissions | services.*, games.*, vps.*, web.*, and tickets:read / tickets:write when the access opens the tickets to you. Billing, orders, catalogue and account: 400 API_SCOPE_NOT_DELEGABLE:<scope> at creation |
| Services | the ones the access shares; any other service answers 404 SERVICE_NOT_FOUND |
| The owner | gets an email at each creation and each rotation, sees your keys (name, prefix, permissions, reach, last use, never your address) and can revoke each one |
| End | the access revoked or left, or "Allow API keys" turned off: the key is revoked (403 API_KEY_REVOKED). An access that no longer allows keys without having revoked them answers 403 API_KEY_DELEGATION_ENDED; a suspended owner, 403 API_ACCOUNT_DISABLED |
GET /me/key says delegated: true and actsForAccount, the account's display name. Rate limits and action budgets count against your account. Nothing is cached: a revocation or a tightened restriction lands on the next call.
Life cycle
All of it under Account > API keys.
| Action | Effect | Identity confirmation |
|---|---|---|
| Create | picks name, permissions, restrictions, expiry, cap. The secret is shown once | yes |
| Narrow | fewer permissions, fewer services, more address rules, earlier expiry, lower cap | no |
| Widen | the reverse of the line above | yes |
| Rotate | new secret, same settings, old secret killed at the same instant | yes |
| Revoke | the key dies. Later calls: 403 API_KEY_REVOKED | no |
| Expire | at the chosen date. Later calls: 403 API_KEY_EXPIRED | - |
A key may live without an expiry; the dashboard flags those. Deleting the account deletes all its keys.
Emails sent to the holder: creation, rotation, expiry in 7 days, revocation by an administrator, and a call refused from outside the address allowlist (at most one a day per key).
Confirming it is you
Creating, rotating or widening a key asks for one proof, the strongest the account has.
| Factor | Condition | Possible refusals |
|---|---|---|
| Two-factor code (or a recovery code) | 2FA enabled | 400 TOTP_REQUIRED if absent, 403 INVALID_2FA_CODE if wrong |
| Password | 2FA off, password set | 403 CURRENT_PASSWORD_INCORRECT |
| Six-digit code sent by email | account with neither password nor 2FA (Google sign-in or equivalent) | 400 EMAIL_CODE_REQUIRED, 403 EMAIL_CODE_INVALID, 410 EMAIL_CODE_EXPIRED, 429 EMAIL_CODE_LOCKED after five tries |
The email code lasts 15 minutes. Five wrong proofs in fifteen minutes, all factors counted together, lock the step: 429 STEP_UP_LOCKED.
Watching a key
The dashboard keeps, per key:
| Trail | Retention | Contents |
|---|---|---|
| Usage tab | 30 days | every call, counted hour by hour and grouped by route, status, refusal and address: number of calls, average and maximum duration, first and last call, X-Request-Id of the latest. Viewed over 24 h, 7 days or 30 days |
| Requests tab | the 500 most recent, over 30 days at most (the latest 100 are shown) | writes, errors and refusals, one by one: route, HTTP status, calling address, duration, X-Request-Id, and the reason for refusals. Successful reads (GET or HEAD answered below 400) are not listed, only counted in Usage |
| History tab | 1 year | creation, edit, rotation, revocation, expiry, and by whom |
The recorded route is the template (/v1/services/{code}/power), never the concrete path or the query string.
In Usage, the errors total counts every status from 400 up, refusals included. When a key is called from many different addresses in the same hour, the extra ones are grouped under Other addresses.
A call whose bearer matches no key is neither counted nor recorded. A burst of 403 API_KEY_IP_NOT_ALLOWED in Requests means the secret is being used somewhere other than where you installed it.