docs(api): document audit events and fix the private key update path

- Add the OpenAPI attribute for GET /audit-events
- Document PATCH /security/keys/{uuid} with its uuid parameter instead
  of /security/keys
This commit is contained in:
Andras Bacsai
2026-10-05 21:24:20 +02:00
parent e11be922b4
commit 111ff9adae
5 changed files with 490 additions and 105 deletions
+254 -64
View File
@@ -5732,6 +5732,178 @@
]
}
},
"\/audit-events": {
"get": {
"tags": [
"Audit Events"
],
"summary": "List",
"description": "List audit events of the team. Only team admins and owners can view audit events. Actor e-mail, token, metadata, changes, IP address, and user agent are returned only for tokens with the read:sensitive or root permission.",
"operationId": "list-audit-events",
"parameters": [
{
"name": "per_page",
"in": "query",
"description": "Items per page.",
"required": false,
"schema": {
"type": "integer",
"default": 25,
"maximum": 100,
"minimum": 1
}
},
{
"name": "page",
"in": "query",
"description": "Page number.",
"required": false,
"schema": {
"type": "integer",
"default": 1,
"minimum": 1
}
},
{
"name": "search",
"in": "query",
"description": "Search text.",
"required": false,
"schema": {
"type": "string",
"maxLength": 255
}
},
{
"name": "action",
"in": "query",
"description": "Filter by action. Use all for every action.",
"required": false,
"schema": {
"type": "string",
"maxLength": 255
}
},
{
"name": "source",
"in": "query",
"description": "Filter by source.",
"required": false,
"schema": {
"type": "string",
"enum": [
"all",
"ui",
"api",
"mcp",
"webhook",
"system",
"scheduler"
]
}
}
],
"responses": {
"200": {
"description": "A page of audit events, newest first.",
"content": {
"application\/json": {
"schema": {
"properties": {
"current_page": {
"type": "integer"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"team_id": {
"type": "integer",
"nullable": true
},
"event": {
"type": "string"
},
"source": {
"type": "string"
},
"action": {
"type": "string"
},
"level": {
"type": "string"
},
"actor_type": {
"type": "string",
"nullable": true
},
"actor_id": {
"type": "integer",
"nullable": true
},
"actor_name": {
"type": "string",
"nullable": true
},
"resource_type": {
"type": "string",
"nullable": true
},
"resource_uuid": {
"type": "string",
"nullable": true
},
"resource_name": {
"type": "string",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time"
}
}
}
},
"per_page": {
"type": "integer"
},
"last_page": {
"type": "integer"
},
"total": {
"type": "integer"
}
},
"type": "object"
}
}
}
},
"401": {
"$ref": "#\/components\/responses\/401"
},
"403": {
"description": "Only team admins and owners can view audit logs."
},
"422": {
"$ref": "#\/components\/responses\/422"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"\/cloud-init-scripts": {
"get": {
"tags": [
@@ -15231,70 +15403,6 @@
"bearerAuth": []
}
]
},
"patch": {
"tags": [
"Private Keys"
],
"summary": "Update",
"description": "Update a private key.",
"operationId": "update-private-key",
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"required": [
"private_key"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"private_key": {
"type": "string"
}
},
"type": "object",
"additionalProperties": false
}
}
}
},
"responses": {
"201": {
"description": "The updated private key's UUID.",
"content": {
"application\/json": {
"schema": {
"properties": {
"uuid": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"401": {
"$ref": "#\/components\/responses\/401"
},
"400": {
"$ref": "#\/components\/responses\/400"
},
"422": {
"$ref": "#\/components\/responses\/422"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"\/security\/keys\/{uuid}": {
@@ -15409,6 +15517,84 @@
"bearerAuth": []
}
]
},
"patch": {
"tags": [
"Private Keys"
],
"summary": "Update",
"description": "Update a private key.",
"operationId": "update-private-key",
"parameters": [
{
"name": "uuid",
"in": "path",
"description": "Private Key UUID",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"required": [
"private_key"
],
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"private_key": {
"type": "string"
}
},
"type": "object",
"additionalProperties": false
}
}
}
},
"responses": {
"201": {
"description": "The updated private key's UUID.",
"content": {
"application\/json": {
"schema": {
"properties": {
"uuid": {
"type": "string"
}
},
"type": "object"
}
}
}
},
"401": {
"$ref": "#\/components\/responses\/401"
},
"400": {
"$ref": "#\/components\/responses\/400"
},
"404": {
"description": "Private Key not found."
},
"422": {
"$ref": "#\/components\/responses\/422"
}
},
"security": [
{
"bearerAuth": []
}
]
}
},
"\/servers\/{uuid}\/cloudflare-tunnel": {
@@ -24606,6 +24792,10 @@
"name": "Secret Managers",
"description": "Secret Managers"
},
{
"name": "Audit Events",
"description": "Audit Events"
},
{
"name": "Cloud-init Scripts",
"description": "Cloud-init Scripts"