Skip to content

Upload a public key

Request

Early Access

Uploads a public key in JWK format to the application's JWKS.

After you upload the new key, both the existing and new keys are active. This allows you to rotate keys without downtime by migrating clients to the new key before revoking the old one with the Revoke a Public Key endpoint.

Note: This API is available in a Limited Early Access program and may be updated or changed based on feedback. Be aware that the API may change.

Path
applicationIdstring, (uuid)required

Identifier of the application

Bodyapplication/jsonrequired
algstringrequired

The algorithm that's used to sign tokens. RS256 uses RSA with SHA-256.

Value:"RS256"
estringrequired

The base64url-encoded exponent of the RSA public key

kidstringrequired

A unique identifier for this key. It's used to select the correct key when multiple keys are present, such as during key rotation.

ktystringrequired

The cryptographic algorithm family for this key. RSA indicates an RSA key pair.

Value:"RSA"
nstringrequired

The base64url-encoded modulus of the RSA public key

usestringrequired

The intended use of this key. sig indicates that the key is used for signing tokens.

Value:"sig"
curl -i -X POST \
  'https://oag.domain.tld/api/v2/apps/{applicationId}/credentials/keys' \
  -H 'Content-Type: application/json' \
  -d '{
    "alg": "RS256",
    "e": "string",
    "kid": "string",
    "kty": "RSA",
    "n": "string",
    "use": "sig"
  }'

Responses

Public key added successfully

Bodyapplication/json
keysArray of objects(JSONWebKey)

The list of JSON Web Keys

Response
{ "keys": [ { … } ] }