Prerequisites
- Organization owner role — Required to create, edit, or revoke API clients and their key pairs.
- HTTPS client — e.g.,
curlor any HTTP library.
Create an API Client
1
Open the API Clients section
Click your profile in the upper-right corner of the Console, then click Organizations. Select the organization you want to manage. Locate the API Clients section on the organization page.
2
Create the client
Click Create. Enter a Name (required) and an optional Description (e.g., “CI deploy bot”). Click Create to save.
3
Add a key pair
With the API client settings open, click Add Key Pair. The Console generates a key pair on the server, displays the fingerprint, and prompts you to download the private key as a PEM file.
4
Download and store the private key
Click Download Private Key, then click Done to close the modal. Store the file securely — treat it like any other production secret.
Obtain an Access Token
API clients authenticate to the token endpoint using the OAuth 2.0 client credentials grant (RFC 6749 §4.4) with a JWT client assertion (RFC 7523). The assertion proves possession of the client’s private key without transmitting it.Discover the Token Endpoint
The auth endpoint is region-specific. Discover it from the OpenID Connect discovery document for your environment:
Read the
token_endpoint field from the discovery response and use its value as the destination for all token requests. Always take the endpoint from discovery rather than hardcoding the path, as it is the authoritative source.
Build the Client Assertion
Construct a JWT signed with your client’s private key using theES256 algorithm.
JWS header:
JWT claims:
Send the Token Request
POST the assertion to the token endpoint with form-encoded parameters:Authorization header for subsequent API calls:
Example code
Each tab builds a client assertion and exchanges it for an access token. Replace the placeholders with your client ID, private key path, and token endpoint.- Go
- Python
- TypeScript
- Rust
Common Errors
Rotate or Revoke
- Rotate — Add a new key pair while the existing one is still active, switch your client to the new private key, then revoke the old key pair.
- Revoke a key pair — Open the client drawer and click the revoke icon next to the key pair. Tokens issued before revocation remain valid until they expire.
- Delete the client — Removes the client and all of its key pairs. The platform will begin rejecting new token requests for the deleted client.
Related Pages
- User Management — Organization roles required to administer API clients.
- Audit Logs — API client lifecycle events appear in the audit log.