API Keys
List all API keys for the current user or specified user (admin)
Authorizations
Query parameters
userIdstring · uuidOptional
Filter API keys by user ID (admin only)
Responses
200
List of API keys
application/json
403
Forbidden
application/json
500
Server error
application/json
get
GET /api/api-keys HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*
[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"permissions": [
"text"
],
"lastUsed": "2025-07-06T07:26:26.651Z",
"expiresAt": "2025-07-06T07:26:26.651Z",
"keyPreview": "text",
"createdAt": "2025-07-06T07:26:26.651Z",
"updatedAt": "2025-07-06T07:26:26.651Z"
}
]
Create a new API key
Authorizations
Body
namestring · min: 1 · max: 100Required
permissionsstring[]Required
expiresAtstring · date-timeOptional
Responses
201
API key created successfully
application/json
Responseall of
400
Invalid request
application/json
403
Forbidden
application/json
500
Server error
application/json
post
POST /api/api-keys HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"name": "text",
"permissions": [
"text"
],
"expiresAt": "2025-07-06T07:26:26.651Z"
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"permissions": [
"text"
],
"lastUsed": "2025-07-06T07:26:26.651Z",
"expiresAt": "2025-07-06T07:26:26.651Z",
"keyPreview": "text",
"createdAt": "2025-07-06T07:26:26.651Z",
"updatedAt": "2025-07-06T07:26:26.651Z",
"keyFull": "text"
}
Get API key details by ID
Authorizations
Path parameters
idstring · uuidRequired
Responses
200
API key details
application/json
403
Forbidden
application/json
404
API key not found
application/json
500
Server error
application/json
get
GET /api/api-keys/{id} HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"permissions": [
"text"
],
"lastUsed": "2025-07-06T07:26:26.651Z",
"expiresAt": "2025-07-06T07:26:26.651Z",
"keyPreview": "text",
"createdAt": "2025-07-06T07:26:26.651Z",
"updatedAt": "2025-07-06T07:26:26.651Z"
}
Delete an API key
Authorizations
Path parameters
idstring · uuidRequired
Responses
204
API key deleted successfully
403
Forbidden
application/json
404
API key not found
application/json
500
Server error
application/json
delete
DELETE /api/api-keys/{id} HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*
No content
Update API key details
Authorizations
Path parameters
idstring · uuidRequired
Body
namestring · min: 1 · max: 100Optional
permissionsstring[]Optional
expiresAtstring · date-time | nullableOptional
Responses
200
API key updated successfully
application/json
400
Invalid request
application/json
403
Forbidden
application/json
404
API key not found
application/json
500
Server error
application/json
patch
PATCH /api/api-keys/{id} HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 77
{
"name": "text",
"permissions": [
"text"
],
"expiresAt": "2025-07-06T07:26:26.651Z"
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"permissions": [
"text"
],
"lastUsed": "2025-07-06T07:26:26.651Z",
"expiresAt": "2025-07-06T07:26:26.651Z",
"keyPreview": "text",
"createdAt": "2025-07-06T07:26:26.651Z",
"updatedAt": "2025-07-06T07:26:26.651Z"
}
Regenerate the secret value of an API key
Authorizations
Path parameters
idstring · uuidRequired
Responses
200
API key regenerated successfully
application/json
Responseall of
403
Forbidden
application/json
404
API key not found
application/json
500
Server error
application/json
post
POST /api/api-keys/{id}/regenerate HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"userId": "123e4567-e89b-12d3-a456-426614174000",
"permissions": [
"text"
],
"lastUsed": "2025-07-06T07:26:26.651Z",
"expiresAt": "2025-07-06T07:26:26.651Z",
"keyPreview": "text",
"createdAt": "2025-07-06T07:26:26.651Z",
"updatedAt": "2025-07-06T07:26:26.651Z",
"keyFull": "text"
}
Was this helpful?