OAuth and API keys
This page is for application creators who connect programs to Exponential. There are three credentials; choose by who the program acts for.
Contents
Which credential
| The program | Use | Read |
|---|---|---|
| acts for many users who sign in themselves (a mobile app) | OAuth2 | 3.1 OAuth2 tokens |
| is one user's own script | a personal API key | Personal API keys |
| drives admin services (apps, portals, shells) | an expservices token | Remote services and apps |
OAuth2 for third-party applications
- An administrator registers the client in Setup > oAuth admin (
/oauthadmin/list): identifier, secret, redirect address. - The app sends the user to
/oauth/authorize?client_id=...&redirect_uri=...&response_type=code&state=..., with PKCE alsocode_challenge=...&code_challenge_method=S256; the user signs in and allows it, and the site redirects back with the code and the samestate. The user needs the policyoauth/authorize(optionally limited by siteaccess); without it the site redirects witherror=access_denied(OAuth authorize policy). - The app exchanges the code at
POST /api/auth/v1/oauth/token(grant_type=authorization_code, andcode_verifierwhen it sent a challenge). - It sends
Authorization: OAuth <token>(a token in the address,?oauth_token=, is refused unlessrest.ini [OAuthSettings] AllowTokenInQuery=enabled); afterTokenTTL(one hour by default) it usesgrant_type=refresh_token. A refresh token lastsRefreshTokenTTL(30 days by default) from the refresh that issued it (OAuth token hardening).

The client secret belongs on a server. An app that cannot keep a secret (a mobile or browser app) is a public
client: it is stored without a secret, sends none and must use PKCE with S256
(PKCE and state). A page in a browser on another host reaches the API only when
CORS is switched on for its origin (CORS for the REST API; off by default).
Personal API keys
- A user with
apikey/createmakes keys in My account > API access (/apikey/list), with scopes and a lifetime; the keyexpk_...is shown once. - Requests with
Authorization: Bearer expk_...run as the owner, limited to the key's scopes and never beyond the owner's policies. - Only a salted HMAC of the secret is stored. Keys end when revoked, expired, or when the owner is disabled.
- Administrators see and revoke every key in Setup > oAuth admin > API keys; every make, revoke, first use and
refusal is in the audit trail as
access.apikey.*.
expservices tokens
expservices has its own personal tokens for its services, created per user; the guide walks through making one and calling services from shell and Python (Remote services and apps).
Good practice
- One credential per program, so one can be revoked alone.
- Smallest scope and role that works; a dedicated user for integrations, not the administrator.
- Secrets in environment variables or a secret store; never in a repository, a URL or a log.
- Short lifetimes, rotation, and a check of the audit trail for refusals.
Related pages
- REST API v1 and v2 for applications
- Access control in code
- API keys BC note
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.