Api-key

Create a new API key for a user

post/api-key/create

Request body

{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:configId","oasType":"schema","type":"unknown","description":"The configuration ID to use for the API key. If not provided, the default configuration will be used."}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:name","oasType":"schema","type":"unknown","description":"Name of the Api Key"}
expiresInstring required
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:prefix","oasType":"schema","type":"unknown","description":"Prefix of the Api Key"}
remainingstring required
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:metadata","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:refillAmount","oasType":"schema","type":"unknown","description":"Amount to refill the remaining count of the Api Key. server-only. Eg: 100"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:refillInterval","oasType":"schema","type":"unknown","description":"Interval to refill the Api Key in milliseconds. server-only. Eg: 1000"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:rateLimitTimeWindow","oasType":"schema","type":"unknown","description":"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"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:rateLimitMax","oasType":"schema","type":"unknown","description":"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"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:rateLimitEnabled","oasType":"schema","type":"unknown","description":"Whether the key has rate limiting enabled. server-only. Eg: true"}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:permissions","oasType":"schema","type":"unknown","description":"Permissions of the Api Key."}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:userId","oasType":"schema","type":"unknown","description":"User Id of the user that the Api Key belongs to. server-only. Eg: \"user-id\""}
{"stackTrail":"paths:/api-key/create:post:requestBody:content:application/json:schema:properties:organizationId","oasType":"schema","type":"unknown","description":"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