client_credentials grant. No client secret is ever transmitted.
You need:
- Your
OAuthClientIdandKIDfrom your onboarding pack. - The private key (
es256-private.pem) matching the public key you registered. See Key pair setup.
Step 1: Build the client assertion
Build a JWT and sign it with your private ES256 key. HeaderStep 2: Exchange it for an access token
POST the assertion to the token endpoint as application/x-www-form-urlencoded. See the endpoint reference for the full schema.
accessToken field, valid for 30 minutes (expiresIn: 1800). No refresh token is issued to M2M clients, so refreshToken is always null.
Step 3: Call the API
Send the token as a bearer token on every request:
Request a fresh token when it expires rather than caching it long-term.
Full example
See Sample scripts for runnable TypeScript and Python versions of the full flow. Your onboarding pack includes the same scripts with your details filled in.Troubleshooting
401 from the token endpoint
The token endpoint returns the same empty401 for every rejected assertion. Check each of these:
- The header
algisES256andkidis theKIDof a key that is registered and not revoked. issis exactly yourOAuthClientId. We look up your public key byissandkid.audis exactlycb-gateway-m2m-blue.expis present and in the future. We allow 30 seconds of clock skew, so check the machine clock if failures persist.jtiis present and new. Ajticannot be reused within 10 minutes.- The assertion is signed with the private key that matches the public key you registered.
401 “Unauthorized to access.” from API routes
The access token has expired (tokens last 30 minutes), or the route is not covered by your entitlements. Request a new token, and contact your Credit Benchmark administrator if the error continues.A key is missing, revoked or rotated
Contact your Credit Benchmark administrator.Security notes
- Never share your private key with anyone, including Credit Benchmark. Only the public key should leave your systems.
- Generate a new client assertion for every token request.
- If a private key is ever compromised, ask us to revoke the key immediately and follow key rotation.

