OAuth client credentials
If your security policy requires OAuth 2.0, your systems can call the APIs with an access token instead of an API key. Your system holds a client ID and secret, exchanges them for an access token that lasts one hour, and sends that token on each call. This is the client credentials grant of RFC 6749 §4.4.
Your own identity provider is not involved: emtelligent issues the credentials.
Creating a client
Anyone in your organization who can create API keys can create an OAuth client. Members see and manage the clients they created; owners and admins see and manage all of them. You choose:
- A label, such as
claims pipeline. - Scopes: the APIs the client may call. They are the same four scopes an API key has, with the same rule: one for each API your own code calls.
- How the client authenticates to the token endpoint:
The client authenticates only by the method it was created with. A
client_secret_post client that sends a Basic header is refused.
The platform then shows the client ID (oac_…), the client secret
(cs-emt-…) and the token URL. The secret is shown once and emtelligent
stores only a hash of it, so store it in your secret manager straight away.
Getting an access token
Set the three values the platform showed you in your environment rather than putting them in code:
Then exchange them for a token:
scope is optional. Without it, the token carries every scope the client was
given. Asking for a scope the client was not given returns invalid_scope.
For client_secret_post, send the credentials as form fields instead:
-d client_id=$EMT_CLIENT_ID -d client_secret=$EMT_CLIENT_SECRET.
Calling an API with the token
Send the access token wherever the API’s quickstart sends an API key. The token lasts one hour, and one token serves every call in that hour, so request a new one shortly before it expires rather than for every call.
This example keeps one token and replaces it a minute before it expires, then submits a document to the OCR API:
Libraries that implement the client credentials grant, such as
requests-oauthlib and authlib, work as well. Point them at the token URL.
Rotating and revoking
- Rotate the secret when your policy calls for it. The old secret stops working at the token endpoint immediately. Tokens it already obtained keep working until they expire, which is at most an hour later.
- Revoke the client if the secret may have leaked. Its tokens are refused within a minute, and it can obtain no new ones.
When a member is removed, the OAuth clients they created can be revoked at the same time, as their API keys can. See Accounts and sign-in.
Usage and billing
Work done with a client’s tokens is billed to your organization in the same way as work done with an API key. Usage by credential shows it against the client ID. See Billing and usage.

