API Keys

Get all API keys

get

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
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 API key

post

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
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

get

Get API key details by ID

Authorizations
Path parameters
idstring · uuidRequired
Responses
200
API key details
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 API key

delete

Delete an API key

Authorizations
Path parameters
idstring · uuidRequired
Responses
204
API key deleted successfully
delete
DELETE /api/api-keys/{id} HTTP/1.1
Host: localhost:3000
Authorization: Bearer JWT
Accept: */*

No content

Update API key

patch

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
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 API key

post

Regenerate the secret value of an API key

Authorizations
Path parameters
idstring · uuidRequired
Responses
200
API key regenerated successfully
application/json
Responseall of
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?