Skip to main content
GET
Retrieve an existing API key by ID

Authorizations

Authorization
string
header
required

Bearer token authentication

Query Parameters

configId
string | null

The configuration ID to use for the API key lookup. If not provided, the default configuration will be used.

id
string

The id of the Api Key

Response

API key retrieved successfully

createdAt
string<date-time>
required

created at

enabled
boolean
default:true
required

Sets if key is enabled or disabled

id
string
required

ID

rateLimitEnabled
boolean
required

Whether the key has rate limiting enabled

requestCount
number
required

The number of requests made within the rate limit time window

updatedAt
string<date-time>
required

updated at

userId
string
required

The owner of the user id

expiresAt
string<date-time> | null

Expiry date of a key

lastRefillAt
string<date-time> | null

The last refill date

lastRequest
string<date-time> | null

When last request occurred

metadata
object | null

Extra metadata about the apiKey

name
string | null

The name of the key

permissions
string | null

Permissions for the api key (stored as JSON string)

prefix
string | null

The API Key prefix. Stored as plain text.

rateLimitMax
number | null

Maximum amount of requests allowed within a window

rateLimitTimeWindow
number | null

The duration in milliseconds

refillAmount
number | null

The amount to refill

refillInterval
number | null

The interval in milliseconds between refills of the remaining count. Example: 3600000 // refill every hour (3600000ms = 1h)

remaining
number | null

Remaining requests (every time api key is used this should updated and should be updated on refill as well)

start
string | null

Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.