Requesting tokens
Exchange your application’s credentials for a short-lived access token, rotate those credentials safely, and revoke a token you no longer need.
Every call to the Partner API carries an access token. Your server gets one from the token endpoint with the OAuth 2.0 client_credentials grant, authenticating as the application with either a client secret or a private key (private_key_jwt).
There is no refresh token. When a token is about to expire, request a new one with the same credentials. The official SDKs do this for you.
The request
Send the parameters in the request body, as application/x-www-form-urlencoded (the OAuth standard) or as application/json with the same names.
The endpoint is strict about the shape of the request, and refuses it with invalid_request when:
- a recognised parameter appears more than once;
- a recognised parameter is sent in the URL query string — credentials never travel in a URL;
- the request uses more than one authentication method (for example an
Authorization: Basicheader and aclient_secretin the body); - the content type is neither of the two above.
Parameters the endpoint does not recognise are ignored, and a parameter sent with an empty value counts as not sent. Keep the body under 16 KiB.
Authenticating with a client secret
You get the client secret once, when the application is created or its secret is rotated in the Partner Hub. EVVA keeps only a digest of it and can never show it again.
There are two ways to present it:
Authenticating with a private key
With private_key_jwt no shared secret ever leaves your infrastructure. You register the public half of a key pair on the application, keep the private key on your server, and sign a short-lived JWT (the client assertion) for every token request.
1. Create a key pair and register the public key
EVVA accepts two algorithms:
In the Partner Hub, open Integrations → Applications → your application → Credentials, and under Public keys (private_key_jwt) use Add a public key: choose the algorithm, give a key ID (kid), paste the public key as a JWK, and optionally set Valid until.
- The key ID is 1–128 characters of
A–Z a–z 0–9 . _ -. Leave it empty to use the JWK’s ownkid. - A key ID is unique within the application, including keys you have revoked, so a revoked key’s ID cannot be reused.
- Upload only the public key. A JWK that carries private key material is refused outright.
- An application holds at most 5 active keys at a time, which leaves room for a rollover.
2. Build the assertion
The assertion is a compact JWS (three dot-separated parts) signed with your private key.
Header
Claims
EVVA tolerates 60 seconds of clock difference on exp, iat and nbf. Keep your servers’ clocks synchronised.
3. Request the token
The response
A successful request returns 200 with the token. Every response from the token endpoint — success or error — carries Cache-Control: no-store and Pragma: no-cache.
Send the token on every API call:
Narrowing a token
A token can only ever carry scopes the application is allowed. Use scope to ask for less than that — for example a worker that only reads conversations:
- Scopes are separated by spaces. Duplicates are merged.
- If any requested scope is not one the application is allowed, the whole request is refused with
invalid_scope. Nothing is silently dropped. - A token carries at most 64 scopes.
- Without
scope, the token carries every scope the application is allowed at that moment.
The SDKs take the same list as an option: scopes (TypeScript, Python, PHP) or Scopes (Go).
Holding a scope on the token is only one condition; what the application may actually do for each creator also depends on its grants and the creator’s consent. See Scopes and grants.
Errors
Errors follow RFC 6749 (section 5.2): a JSON body with error and error_description.
invalid_client deliberately does not say what was wrong. Check, in order: the client ID was copied whole, the secret is the current one, the key ID matches a registered active key, aud is the exact token endpoint URL, exp is no more than 5 minutes ahead, jti is new, and your server clock is synchronised.
Token lifetime
An access token lives 15 minutes (expires_in: 900). There is no refresh token: request a new token before the current one expires. The SDKs renew a token 60 seconds before it expires and share one request between concurrent callers.
A token stops working before its expiry when it is revoked, when the application is disabled or revoked, or when your agency is suspended. A request with a token that is expired, revoked or unknown gets:
Request a new token and retry. If the new token request is refused, its error tells you why.
Revoking a token
Revoke a token you no longer need — for example when a worker shuts down — at the revocation endpoint (RFC 7009):
The answer is 200 with an empty body whenever the request itself is valid — whether the token was revoked now, was already revoked or expired, is unknown, or belongs to another application (which is left untouched). An application can only revoke its own tokens, and can do so even while it is disabled. Errors are 400 invalid_request, 401 invalid_client and 503 temporarily_unavailable, as above.
Revocation takes effect from the next request. Realtime connections opened with the token are closed (SESSION_REVOKED, then close code 4401).
Rotating credentials
Credentials are managed in the Partner Hub under Integrations → Applications → your application → Credentials. Only the agency owner can change them; team leads can see them.
Client secret
Rotate secret creates a new secret, shows it once, and retires the current one after an overlap you choose under Keep the current secret working for: End it now, 1 hour, 24 hours (default), 3 days or 7 days (maximum).
At most two secrets work at once: rotating again during an overlap ends the older overlap immediately. After a secret is created, the Hub shows only its last four characters.
Public keys
Because an application can hold up to five active keys, you rotate a key with no downtime: add the new public key with a new key ID, switch your signer to the new private key and kid, then revoke the old key in the Hub. Assertions signed with a revoked key are refused from that moment. A key with Valid until set stops authenticating at that time.
Rotating a secret or revoking a key does not end access tokens already issued with it: they keep working until they expire, at most 15 minutes later. If a credential leaked, also revoke the tokens issued with it, or disable the application in the Hub, which revokes all of its tokens at once.
Can I send client_id together with an assertion?
Yes. With private_key_jwt the client_id parameter is optional; if you send it, it must equal the assertion’s sub, otherwise authentication fails. With HTTP Basic, a client_id in the body must equal the one in the header.
Why was my assertion refused the second time?
Each jti is accepted once per client for as long as the assertion could be valid. Sign a new assertion, with a new random jti, for every token request — including retries.
Does a sandbox client work for live creators?
No. A sandbox application’s client ID starts with evpc_test_ and its tokens with evpa_test_; it acts only in the sandbox. A live application uses evpc_live_ and evpa_live_.
Can I see my access tokens in the Partner Hub?
No. Access tokens are never shown in the Hub. To end one, revoke it with the revocation endpoint, or disable the application.
