Create a key

This operation generates an API key for the specified consumer. The key is returned only at the time of creation
and will not be retrievable in any subsequent GET requests on the entity.

The API supports two key creation types: new and legacy.

  • new: The recommended and more efficient option. The API automatically generates the key and returns it during
    this operation.
  • legacy: Allows you to provide your own secret. This approach has a performance impact when proxying requests, as it involves
    additional processing and resource usage.

Note: Regardless of the type selected, the key is only returned by the API when a key is created. It is not retrievable in the future.

post

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

Body

application/json

CreateApiKeyPayload

CreateApiKeyPayload
One Of
typestringrequired

Allowed values:new

Default:new

tagsarray[string]unique-items

Response

application/json

success

CreateApiKeyResult

idstringrequired
typestringrequired

Allowed values:legacynew

secretstringrequired
created_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

updated_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity update date.

Example:2022-11-04T20:10:06.927Z

tagsarray[string]requiredunique-items
post/realms/{realmId}/consumers/{consumerId}/keys

Body

{ "type": "new" }
 
application/json

Get a key

Returns the key entity. This operation does NOT return the key itself. The key is only available at the time of creation.

get

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

keyIdstringrequired

ID of the key

Response

application/json

success

ApiKey

idstringrequired
created_atstring(date-time)requiredread-only

An ISO-8601 timestamp representation of entity creation date.

Example:2022-11-04T20:10:06.927Z

tagsarray[string]requiredunique-items
typestringrequired

Allowed values:legacynew

get/realms/{realmId}/consumers/{consumerId}/keys/{keyId}
 
application/json

Delete a key

Delete a key. This operation removes the key from the system, causing all future authentication
requests using this key to fail. However, it does not immediately invalidate any
cached keys stored in the gateway’s state. These keys may remain usable until the cache expires, based on the
TTL (Time-To-Live) configured for the realm.

delete

Path Parameters

realmIdstring(uuid)required

ID of the realm

consumerIdstringrequired

ID of the of the consumer

keyIdstringrequired

ID of the key

Response

success

delete/realms/{realmId}/consumers/{consumerId}/keys/{keyId}
 

RealmConsumerFilterParameters

object
custom_id

Filter using one of the following operators: eq

Show Child Parameters
username

Filter using one of the following operators: eq

Show Child Parameters
Example

ConsumerFilterParameters

object
custom_id

Filter using one of the following operators: eq

Show Child Parameters
username

Filter using one of the following operators: eq

Show Child Parameters
Example