Api-key

Create a new API key for a user

post/api-key/create

Request body

configIdstring nullable

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

namestring nullable

Name of the Api Key

expiresInstring required
prefixstring nullable

Prefix of the Api Key

remainingstring required
metadatastring nullable
refillAmountnumber nullable

Amount to refill the remaining count of the Api Key. server-only. Eg: 100

refillIntervalnumber nullable

Interval to refill the Api Key in milliseconds. server-only. Eg: 1000

rateLimitTimeWindownumber nullable

The duration in milliseconds where each request is counted. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 1000

rateLimitMaxnumber nullable

Maximum amount of requests allowed within a window. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 100

rateLimitEnabledboolean nullable

Whether the key has rate limiting enabled. server-only. Eg: true

permissionsstring nullable

Permissions of the Api Key.

userIdstring nullable

User Id of the user that the Api Key belongs to. server-only. Eg: "user-id"

organizationIdstring nullable

Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'

Response

API key created successfully

idstring required

Unique identifier of the API key

createdAtstring date-time required

Creation timestamp

updatedAtstring date-time required

Last update timestamp

namestring nullable

Name of the API key

prefixstring nullable

Prefix of the API key

startstring nullable

Starting characters of the key (if configured)

keystring required

The full API key (only returned on creation)

enabledboolean required

Whether the key is enabled

expiresAtstring date-time nullable

Expiration timestamp

referenceIdstring required

ID of the reference owning the key

lastRefillAtstring date-time nullable

Last refill timestamp

lastRequeststring date-time nullable

Last request timestamp

metadataobject nullable

Metadata associated with the key

rateLimitMaxnumber nullable

Maximum requests in time window

rateLimitTimeWindownumber nullable

Rate limit time window in milliseconds

remainingnumber nullable

Remaining requests

refillAmountnumber nullable

Amount to refill

refillIntervalnumber nullable

Refill interval in milliseconds

rateLimitEnabledboolean required

Whether rate limiting is enabled

requestCountnumber required

Current request count in window

permissionsobject nullable

Permissions associated with the key

Changes