{
  "openapi": "3.0.3",
  "info": {
    "title": "Divinci Public/Customer API",
    "version": "1.0.0",
    "description": "Public API for managing whitelabels, RAG knowledge bases, releases, fine-tuning, transcripts, and more. This spec is auto-generated from the Express route definitions in workspace/servers/public-api/src/api/v1. Every path here is served; a small number of served routes are not yet extracted (see docs/api/openapi-coverage.md for the exact count).",
    "contact": {
      "name": "Divinci Support",
      "url": "https://divinci.ai/support"
    }
  },
  "servers": [
    {
      "url": "https://api.divinci.app",
      "description": "Production"
    },
    {
      "url": "https://api.stage.divinci.app",
      "description": "Staging"
    },
    {
      "url": "https://api.dev.divinci.app",
      "description": "Develop"
    }
  ],
  "tags": [
    {
      "name": "a2a"
    },
    {
      "name": "admin/rate-limit-requests"
    },
    {
      "name": "audio-transcripts"
    },
    {
      "name": "auth"
    },
    {
      "name": "byok"
    },
    {
      "name": "chat"
    },
    {
      "name": "compliance"
    },
    {
      "name": "config"
    },
    {
      "name": "connectors"
    },
    {
      "name": "divinci-agent"
    },
    {
      "name": "export"
    },
    {
      "name": "external-tools"
    },
    {
      "name": "fine-tune"
    },
    {
      "name": "groups"
    },
    {
      "name": "hermes-agent"
    },
    {
      "name": "html-pages"
    },
    {
      "name": "local-sync"
    },
    {
      "name": "mcp-config"
    },
    {
      "name": "mcp-servers"
    },
    {
      "name": "model-edits"
    },
    {
      "name": "notifications"
    },
    {
      "name": "onboarding"
    },
    {
      "name": "onboarding-webhook"
    },
    {
      "name": "permissions"
    },
    {
      "name": "qa"
    },
    {
      "name": "rag"
    },
    {
      "name": "releases"
    },
    {
      "name": "slack"
    },
    {
      "name": "terms"
    },
    {
      "name": "threads"
    },
    {
      "name": "training-data"
    },
    {
      "name": "transcripts"
    },
    {
      "name": "tts"
    },
    {
      "name": "users/me/slack-link"
    },
    {
      "name": "voiceprints"
    },
    {
      "name": "workspaces"
    },
    {
      "name": "workspaces/:workspaceId/api-keys"
    },
    {
      "name": "workspaces/:workspaceId/chat"
    },
    {
      "name": "workspaces/:workspaceId/rate-limit-requests"
    },
    {
      "name": "www-rag"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key with format `divinci_...` (91 chars). Permissions are attached to each key; an EMPTY permissions array means full access within the whitelabel."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Auth0 JWT token for workspace CRUD operations."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Validation or request format error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication required or API key invalid",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient permissions",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "Rate limit exceeded for this API key + feature",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "VALIDATION_ERROR"
              },
              "message": {
                "type": "string"
              },
              "documentation": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/auth/validate-key": {
      "post": {
        "operationId": "postAuthValidateKey",
        "tags": [
          "auth"
        ],
        "summary": "POST /api/v1/auth/validate-key Validates an API key and returns user context Protected by IP rate limiting + account lockout to prevent brute-force attacks",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/divinci-agent/health": {
      "get": {
        "operationId": "getDivinciAgentHealth",
        "tags": [
          "divinci-agent"
        ],
        "summary": "Health check - no auth required",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/divinci-agent/transcript": {
      "post": {
        "operationId": "postDivinciAgentTranscript",
        "tags": [
          "divinci-agent"
        ],
        "summary": "Create or get transcript for a session POST /api/v1/divinci-agent/transcript",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/divinci-agent/transcript/{transcriptId}/sync": {
      "post": {
        "operationId": "postDivinciAgentTranscriptByTranscriptIdSync",
        "tags": [
          "divinci-agent"
        ],
        "summary": "Sync messages to MongoDB POST /api/v1/divinci-agent/transcript/:transcriptId/sync",
        "security": [],
        "parameters": [
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/divinci-agent/transcript/{transcriptId}/messages": {
      "get": {
        "operationId": "getDivinciAgentTranscriptByTranscriptIdMessages",
        "tags": [
          "divinci-agent"
        ],
        "summary": "Get messages for session restoration GET /api/v1/divinci-agent/transcript/:transcriptId/messages",
        "security": [],
        "parameters": [
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/mcp-config/{whitelabelId}": {
      "get": {
        "operationId": "getMcpConfigByWhitelabelId",
        "tags": [
          "mcp-config"
        ],
        "summary": "GET /api/v1/mcp-config/:whitelabelId",
        "security": [],
        "parameters": [
          {
            "name": "whitelabelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/a2a/agent-card.json": {
      "get": {
        "operationId": "getA2aAgentCard.json",
        "tags": [
          "a2a"
        ],
        "summary": "GET /api/v1/a2a/agent-card.json — A2A discovery document (unsigned).",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/a2a": {
      "post": {
        "operationId": "postA2a",
        "tags": [
          "a2a"
        ],
        "summary": "POST /api/v1/a2a/ — JSON-RPC: message/stream (SSE) + message/send. Rate-limited per IP; the GET discovery card above is deliberately NOT limited (orchestrators poll it, it serves a static document and does no work).",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/transcripts": {
      "get": {
        "operationId": "getTranscripts",
        "tags": [
          "transcripts"
        ],
        "summary": "GET /api/v1/transcripts — List transcripts",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "A page of transcripts for the workspace the API key is scoped to.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transcripts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "locked": {
                            "type": "boolean"
                          },
                          "hideConversationStarters": {
                            "type": "boolean"
                          },
                          "metadata": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "messageCount": {
                            "type": "integer"
                          },
                          "lastMessageTimestamp": {
                            "type": "integer",
                            "description": "Epoch MILLISECONDS, not an ISO string. `0` when the transcript has no messages."
                          },
                          "childTranscripts": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "firstMessage": {
                            "type": "object",
                            "nullable": true,
                            "properties": {
                              "role": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "integer",
                                "description": "Epoch milliseconds."
                              },
                              "content": {
                                "type": "string"
                              }
                            },
                            "description": "Content is truncated, and only when it is a string."
                          },
                          "lastMessage": {
                            "type": "object",
                            "nullable": true,
                            "additionalProperties": true,
                            "description": "The most recent message, same shape as firstMessage."
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:read"
        ],
        "x-rate-limit-feature": "transcripts"
      },
      "post": {
        "operationId": "postTranscripts",
        "tags": [
          "transcripts"
        ],
        "summary": "POST /api/v1/transcripts — Create transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "The created transcript document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:write"
        ],
        "x-rate-limit-feature": "transcripts",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/transcripts/{transcriptId}": {
      "get": {
        "operationId": "getTranscriptsByTranscriptId",
        "tags": [
          "transcripts"
        ],
        "summary": "GET /api/v1/transcripts/:transcriptId — Get single transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One transcript with a page of its messages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "hideConversationStarters": {
                      "type": "boolean"
                    },
                    "childTranscripts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "role": {
                            "type": "string"
                          },
                          "content": {
                            "description": "String for ordinary turns; an object for structured/tool messages."
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "context": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Retrieved context, filtered by the viewer's policy."
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:read"
        ],
        "x-rate-limit-feature": "transcripts"
      },
      "delete": {
        "operationId": "deleteTranscriptsByTranscriptId",
        "tags": [
          "transcripts"
        ],
        "summary": "DELETE /api/v1/transcripts/:transcriptId — Delete transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:write"
        ],
        "x-rate-limit-feature": "transcripts"
      }
    },
    "/api/v1/transcripts/{transcriptId}/messages": {
      "post": {
        "operationId": "postTranscriptsByTranscriptIdMessages",
        "tags": [
          "transcripts"
        ],
        "summary": "POST /api/v1/transcripts/:transcriptId/messages — Add message",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Acknowledgement only — `{\"status\":\"ok\"}`. The stored message is not echoed back; read it with GET /api/v1/transcripts/{transcriptId}.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:write"
        ],
        "x-rate-limit-feature": "transcripts",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files": {
      "get": {
        "operationId": "getRagFiles",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/files — List RAG vector files",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "A bare ARRAY of file records — not an envelope, and not paginated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "chunksCount": {
                        "type": "integer",
                        "description": "ABSENT in lazy-count mode — fetch counts separately. Present means the count is real."
                      },
                      "ragVectors": {
                        "type": "array",
                        "description": "The vectors this file is referenced by.",
                        "items": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      },
      "post": {
        "operationId": "postRagFiles",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/files — Upload a new file for RAG indexing Rate-limit middleware chain: - fileUploadApiKeyRateLimit: applies if req.apikeyId is set (workspace api-key auth). Honors per-key `rateLimit.customLimits.fileUpload` from EmbedAPIKeyModel. - fileUploadRateLimit: applies otherwise (OAuth user), keyed by userId with per-user-tier defaults from RATE_LIMIT_CONFIGS.",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "202": {
            "description": "ACCEPTED, not completed. Returns the saved file records; chunking and embedding continue asynchronously. Poll the file's status before assuming it is retrievable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                      "_id": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "CastedBusBoy",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "chunkingTool": {
                    "type": "string"
                  },
                  "chunkingAuthId": {
                    "type": "string"
                  },
                  "chunkingToolConfig": {
                    "type": "string"
                  },
                  "cleaners": {
                    "type": "string"
                  },
                  "ragVectorId": {
                    "type": "string"
                  },
                  "ragVectorIds": {
                    "type": "string"
                  },
                  "sourceUrl": {
                    "type": "string"
                  },
                  "publishedDate": {
                    "type": "string"
                  },
                  "extractPublishedDate": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "title",
                  "description",
                  "chunkingTool",
                  "file"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/presigned": {
      "post": {
        "operationId": "postRagPresigned",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/presigned — Get presigned R2 upload URLs Body: array of { byteSize: number, filename: string } Returns: array of presigned results with upload URLs",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files/estimate-cost": {
      "post": {
        "operationId": "postRagFilesEstimateCost",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/files/estimate-cost — Dry-run processing cost estimate (chunker + cleaners + optional publish-date extraction). Read-only, no upload/transaction — see files/estimate-cost.ts for the body shape.",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files/audio": {
      "post": {
        "operationId": "postRagFilesAudio",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/files/audio — Upload audio from URL for transcription + RAG indexing Must be before /files/:fileId to avoid \"audio\" matching as a fileId",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files/audio-from-presigned": {
      "post": {
        "operationId": "postRagFilesAudioFromPresigned",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/files/audio-from-presigned — Finalize presigned audio upload",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files/{fileId}": {
      "get": {
        "operationId": "getRagFilesByFileId",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/files/:fileId — Get a specific file",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One file record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      },
      "delete": {
        "operationId": "deleteRagFilesByFileId",
        "tags": [
          "rag"
        ],
        "summary": "DELETE /api/v1/rag/files/:fileId — Delete a file",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag"
      },
      "patch": {
        "operationId": "patchRagFilesByFileId",
        "tags": [
          "rag"
        ],
        "summary": "PATCH /api/v1/rag/files/:fileId — Update file properties (rawFileKey, status, title, etc.)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rawFileKey": {
                    "type": "string"
                  },
                  "fileKey": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "sourceUrl": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/files/{fileId}/vectorize-status": {
      "get": {
        "operationId": "getRagFilesByFileIdVectorizeStatus",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/files/:fileId/vectorize-status — Definitive readiness check. Cloudflare Vectorize is eventually consistent (~10–60s); this endpoint directly verifies the file's chunks are queryable instead of relying on the file's status field, which can flip to \"completed\" before vectors are searchable.",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/files/{fileId}/chunks": {
      "get": {
        "operationId": "getRagFilesByFileIdChunks",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/files/:fileId/chunks — List paginated chunks for a file Query params: offset (default 0), limit (default 25, max 100)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/files/{fileId}/reindex": {
      "post": {
        "operationId": "postRagFilesByFileIdReindex",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/files/:fileId/reindex — Re-index a single file",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/targets": {
      "get": {
        "operationId": "getRagTargets",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/targets — List RAG vector indexes (upload targets)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      },
      "post": {
        "operationId": "postRagTargets",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/targets — Create a new RAG vector index Body: { title, vectorIndexTool, embeddingModel?, chunkingTool?, contextPerMessage?, minimumSimilarity?, ... }",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/targets/{collectionId}": {
      "patch": {
        "operationId": "patchRagTargetsByCollectionId",
        "tags": [
          "rag"
        ],
        "summary": "PATCH /api/v1/rag/targets/:collectionId — Update retrieval settings (minimumSimilarity, contextPerMessage, embeddingModel)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRagTargetsByCollectionId",
        "tags": [
          "rag"
        ],
        "summary": "DELETE /api/v1/rag/targets/:collectionId — Delete a RAG vector index and all its resources",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/targets/{collectionId}/migrate": {
      "post": {
        "operationId": "postRagTargetsByCollectionIdMigrate",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/targets/:collectionId/migrate — Clone index with new config + bulk reindex all files Body: { embeddingModel?, chunkingTool?, title?, contextPerMessage?, minimumSimilarity?, ... }",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/targets/{collectionId}/bulk-reindex": {
      "post": {
        "operationId": "postRagTargetsByCollectionIdBulkReindex",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/targets/:collectionId/bulk-reindex — Re-queue all files in this index Body: { chunkingTool?, fileIds? }",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/targets/{collectionId}/prune-ghost-refs": {
      "post": {
        "operationId": "postRagTargetsByCollectionIdPruneGhostRefs",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/targets/:collectionId/prune-ghost-refs — Remove ghost file refs",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/targets/{collectionId}/events": {
      "get": {
        "operationId": "getRagTargetsByCollectionIdEvents",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/targets/:collectionId/events — Phase C1 event-log timeline Read-only audit trail of what's happened to files in this vector. Filters: ?limit&fileId&action&actorType&since&includeBackfill",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/search": {
      "get": {
        "operationId": "getRagSearch",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/search — Search knowledge base using D1 full-text search Query params: q (required), limit/topK (default 10, max 100), fileId (optional filter), collectionId (optional filter)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/context": {
      "post": {
        "operationId": "postRagContext",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/context — Semantic vector similarity retrieval Body: { query, collectionId | groupId, topK? }",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Retrieved context. TWO SHAPES: querying a `groupId` returns `groupId`/`groupName`/`vectors`; querying a `collectionId` returns `collectionId`/`collectionTitle`. The common fields are `chunks`, `sources`, `query`, `total` and `retrievalMs`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chunks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "content": {
                            "type": "string",
                            "description": "Chunk text. Empty string when the source carried neither `text` nor `content`."
                          },
                          "score": {
                            "type": "number",
                            "nullable": true,
                            "description": "Similarity score, or null when the retriever did not supply one."
                          },
                          "source": {
                            "type": "string",
                            "nullable": true,
                            "description": "Filename or URL. Best-effort — prefer the response-level `sources`."
                          },
                          "fileId": {
                            "type": "string",
                            "nullable": true
                          },
                          "vectorId": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Source filenames/URLs for the whole result. Authoritative provenance — per-chunk `source` is best-effort and often null."
                    },
                    "query": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Chunks returned after topK, not the corpus size."
                    },
                    "retrievalMs": {
                      "type": "number"
                    },
                    "groupId": {
                      "type": "string",
                      "description": "Group queries only."
                    },
                    "groupName": {
                      "type": "string",
                      "description": "Group queries only."
                    },
                    "vectors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Group queries only — the vectors searched."
                    },
                    "collectionId": {
                      "type": "string",
                      "description": "Collection queries only."
                    },
                    "collectionTitle": {
                      "type": "string",
                      "description": "Collection queries only."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/groups": {
      "get": {
        "operationId": "getRagGroups",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/groups — List RAG vector groups",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      },
      "post": {
        "operationId": "postRagGroups",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/groups — Create a new group",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/groups/{groupId}": {
      "get": {
        "operationId": "getRagGroupsByGroupId",
        "tags": [
          "rag"
        ],
        "summary": "GET /api/v1/rag/groups/:groupId — Get a specific group",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag"
      },
      "patch": {
        "operationId": "patchRagGroupsByGroupId",
        "tags": [
          "rag"
        ],
        "summary": "PATCH /api/v1/rag/groups/:groupId — Update group (name, vectors, settings) Supports addVectorIds / removeVectorIds for incremental changes",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRagGroupsByGroupId",
        "tags": [
          "rag"
        ],
        "summary": "DELETE /api/v1/rag/groups/:groupId — Archive (soft-delete) a group",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag"
      }
    },
    "/api/v1/rag/{ragVectorId}/chunks/append": {
      "post": {
        "operationId": "postRagByRagVectorIdChunksAppend",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/:ragVectorId/chunks/append — Append a small text chunk synchronously with read-after-write semantics. Phase 2 of the as-above-so-below-rts integration. Returns 501 until cache+Vectorize lands.",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ragVectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The appended chunk's id and timing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chunkId": {
                      "type": "string"
                    },
                    "searchable": {
                      "type": "boolean",
                      "description": "Always true — the chunk is searchable on return."
                    },
                    "latencyMs": {
                      "type": "number",
                      "description": "Total handler time."
                    },
                    "mem0LatencyMs": {
                      "type": "number",
                      "description": "Time inside the memory backend."
                    },
                    "added": {
                      "type": "boolean",
                      "description": "False when the backend deduplicated the chunk away."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "502": {
            "description": "The memory backend rejected or failed the write."
          },
          "503": {
            "description": "The workspace has no enabled mem0 resource. Configure one before appending or searching chunks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "memory_not_configured"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/rag/{ragVectorId}/chunks/search": {
      "post": {
        "operationId": "postRagByRagVectorIdChunksSearch",
        "tags": [
          "rag"
        ],
        "summary": "POST /api/v1/rag/:ragVectorId/chunks/search — Semantic search with cache merge. Phase 2 of the as-above-so-below-rts integration. Returns 501 until cache+Vectorize lands.",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ragVectorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching chunks from one vector.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Backend-shaped match records — passed through from the memory backend."
                    },
                    "latencyMs": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "502": {
            "description": "The memory backend rejected or failed the search."
          },
          "503": {
            "description": "The workspace has no enabled mem0 resource. Configure one before appending or searching chunks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "memory_not_configured"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "rag",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/releases": {
      "get": {
        "operationId": "getReleases",
        "tags": [
          "releases"
        ],
        "summary": "GET /api/v1/releases — List all releases",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "A bare ARRAY of release documents — not an envelope, and not paginated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "ragIndexDocs": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "description": "The RAG vectors this release resolves to, joined in by the aggregation."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "releases"
      },
      "post": {
        "operationId": "postReleases",
        "tags": [
          "releases"
        ],
        "summary": "POST /api/v1/releases — Create a new release draft",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/{releaseId}": {
      "get": {
        "operationId": "getReleasesByReleaseId",
        "tags": [
          "releases"
        ],
        "summary": "GET /api/v1/releases/:releaseId — Get release by ID",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "releases"
      },
      "patch": {
        "operationId": "patchReleasesByReleaseId",
        "tags": [
          "releases"
        ],
        "summary": "PATCH /api/v1/releases/:releaseId — Update a release draft",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteReleasesByReleaseId",
        "tags": [
          "releases"
        ],
        "summary": "DELETE /api/v1/releases/:releaseId — Delete a release draft",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases"
      }
    },
    "/api/v1/releases/{releaseId}/publish": {
      "post": {
        "operationId": "postReleasesByReleaseIdPublish",
        "tags": [
          "releases"
        ],
        "summary": "POST /api/v1/releases/:releaseId/publish — Publish a release draft",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/{releaseId}/deprecate": {
      "post": {
        "operationId": "postReleasesByReleaseIdDeprecate",
        "tags": [
          "releases"
        ],
        "summary": "POST /api/v1/releases/:releaseId/deprecate — Take a PUBLISHED release out of service. The counterpart to /publish, which had no inverse on this surface: `DELETE /:releaseId` only removes DRAFTS, so an API-key client could publish a release and then had no way to withdraw it.  This is the withdrawal path for a rights refusal. WWW-RAG re-checks robots.txt before every crawl, but a host that ALLOWED AI use when we crawled it and refuses today was already published — and the only remedy is to stop serving it. Fifteen such sites were live on 2026-08-18 (Cloudflare's Managed robots.txt block names CloudflareBrowserRenderingCrawler, our exact crawler).  Deprecating rather than deleting is deliberate: the release stops serving (the public endpoint and the WWW-RAG directory both treat only `available` and `active` as live) while the record of what we published, and that we withdrew it, survives. A hard delete would destroy the evidence that the refusal was honoured.  ⚠️ Gated by `release:deprecate`, NOT `release:write`. Every other route on this surface acts on a DRAFT; this one retires a LIVE release, so a key that can publish must not be able to take a site down as a side effect. Pinned by scripts/ci/tests/test_release_auth_boundary.py.",
        "security": [
          {
            "ApiKeyAuth": [
              "release:deprecate"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:deprecate"
        ],
        "x-rate-limit-feature": "releases"
      }
    },
    "/api/v1/releases/{releaseId}/fork": {
      "post": {
        "operationId": "postReleasesByReleaseIdFork",
        "tags": [
          "releases"
        ],
        "summary": "POST /api/v1/releases/:releaseId/fork — Fork a (published) release into a new draft, carrying over its full config. Lets API-key clients (e.g. the local- inference extension's MCP tab) edit a live release's enabled tools: fork → PATCH the draft → publish. The handler enforces same-whitelabel ownership; the draft inherits skillConfig (catalogSkills/mcpSkills — see fork-as-draft model method).",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/{releaseId}/tools": {
      "patch": {
        "operationId": "patchReleasesByReleaseIdTools",
        "tags": [
          "releases"
        ],
        "summary": "PATCH /api/v1/releases/:releaseId/tools — Partial update of a draft release's enabled skills / MCP servers ONLY. Unlike PATCH /:releaseId (a full-object replace that wipes omitted fields), this touches just skillConfig.catalogSkills / skillConfig.mcpSkills — the toggle the local-inference extension's MCP tab needs.",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "catalogSkills": {
                    "type": "string"
                  },
                  "mcpSkills": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/releases/{releaseId}/enrichment": {
      "patch": {
        "operationId": "patchReleasesByReleaseIdEnrichment",
        "tags": [
          "releases"
        ],
        "summary": "PATCH /api/v1/releases/:releaseId/enrichment — Set the release's persona (threadPrefix), welcome message and conversation starters in one call, creating the three whitelabel-scoped resources on the way.  Like PATCH /:releaseId/tools this is a FOCUSED update, not the full-object replace PATCH /:releaseId performs — and unlike /tools it works on a PUBLISHED release, because the 4,687 releases that need it are published. See set-enrichment.ts for why that is the right posture here.  `release:write`, not `release:deprecate`: this changes how a release introduces itself, it cannot take a site out of service.",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "releases",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "persona": {
                    "type": "string"
                  },
                  "welcome": {
                    "type": "string"
                  },
                  "starters": {
                    "type": "string"
                  },
                  "overwrite": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/config": {
      "get": {
        "operationId": "getConfig",
        "tags": [
          "config"
        ],
        "summary": "GET /api/v1/config — Get whitelabel configuration",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:read"
        ],
        "x-rate-limit-feature": "config"
      }
    },
    "/api/v1/config/title": {
      "patch": {
        "operationId": "patchConfigTitle",
        "tags": [
          "config"
        ],
        "summary": "PATCH /api/v1/config/title — Update whitelabel title",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:write"
        ],
        "x-rate-limit-feature": "config",
        "requestBody": {
          "required": true,
          "x-schema-source": "CastedBusBoy",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "picture": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "picture"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/config/description": {
      "patch": {
        "operationId": "patchConfigDescription",
        "tags": [
          "config"
        ],
        "summary": "PATCH /api/v1/config/description — Update whitelabel description",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:write"
        ],
        "x-rate-limit-feature": "config",
        "requestBody": {
          "required": true,
          "x-schema-source": "CastedBusBoy",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "picture": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "picture"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/fine-tune/models": {
      "get": {
        "operationId": "getFineTuneModels",
        "tags": [
          "fine-tune"
        ],
        "summary": "GET /api/v1/fine-tune/models — List available fine-tuner tools/base models",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:read"
        ],
        "x-rate-limit-feature": "fine-tune"
      }
    },
    "/api/v1/fine-tune/jobs": {
      "get": {
        "operationId": "getFineTuneJobs",
        "tags": [
          "fine-tune"
        ],
        "summary": "--- Custom AI Models --- GET /api/v1/fine-tune/jobs — List custom AI models",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:read"
        ],
        "x-rate-limit-feature": "fine-tune"
      },
      "post": {
        "operationId": "postFineTuneJobs",
        "tags": [
          "fine-tune"
        ],
        "summary": "POST /api/v1/fine-tune/jobs — Create a new custom AI model",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/fine-tune/jobs/{customAiId}": {
      "get": {
        "operationId": "getFineTuneJobsByCustomAiId",
        "tags": [
          "fine-tune"
        ],
        "summary": "GET /api/v1/fine-tune/jobs/:jobId — Get a custom AI model",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customAiId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:read"
        ],
        "x-rate-limit-feature": "fine-tune"
      },
      "delete": {
        "operationId": "deleteFineTuneJobsByCustomAiId",
        "tags": [
          "fine-tune"
        ],
        "summary": "DELETE /api/v1/fine-tune/jobs/:jobId — Delete a custom AI model",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customAiId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune"
      }
    },
    "/api/v1/fine-tune/jobs/{customAiId}/start": {
      "post": {
        "operationId": "postFineTuneJobsByCustomAiIdStart",
        "tags": [
          "fine-tune"
        ],
        "summary": "--- Fine-Tune Operations --- POST /api/v1/fine-tune/jobs/:jobId/start — Start fine-tuning",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customAiId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/fine-tune/jobs/{customAiId}/status": {
      "get": {
        "operationId": "getFineTuneJobsByCustomAiIdStatus",
        "tags": [
          "fine-tune"
        ],
        "summary": "GET /api/v1/fine-tune/jobs/:jobId/status — Get fine-tune status",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customAiId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:read"
        ],
        "x-rate-limit-feature": "fine-tune"
      }
    },
    "/api/v1/fine-tune/jobs/{customAiId}/cancel": {
      "post": {
        "operationId": "postFineTuneJobsByCustomAiIdCancel",
        "tags": [
          "fine-tune"
        ],
        "summary": "POST /api/v1/fine-tune/jobs/:jobId/cancel — Cancel fine-tuning",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customAiId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune"
      }
    },
    "/api/v1/fine-tune/files/{fileId}/export-to-qa": {
      "post": {
        "operationId": "postFineTuneFilesByFileIdExportToQa",
        "tags": [
          "fine-tune"
        ],
        "summary": "--- FineTuneFile → QA Bridge --- POST /api/v1/fine-tune/files/:fileId/export-to-qa Sample N pairs from a FineTuneFile's JSONL and create ScoredQATest docs in the target suite(s). Body accepts targetSuiteIds[], maxTests, samplingStrategy, workspaceOverride — same shape as the internal route.",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/fine-tune/files/copy-from": {
      "post": {
        "operationId": "postFineTuneFilesCopyFrom",
        "tags": [
          "fine-tune"
        ],
        "summary": "POST /api/v1/fine-tune/files/copy-from Copy FineTuneFiles from a source whitelabel into the caller's workspace. Body: { sourceWhitelabelId, sourceFileIds?: string[], copyCachedIds?: boolean }",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "fine-tune",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/audio-transcripts": {
      "get": {
        "operationId": "getAudioTranscripts",
        "tags": [
          "audio-transcripts"
        ],
        "summary": "GET /api/v1/audio-transcripts — List audio transcripts",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "audio-transcripts"
      }
    },
    "/api/v1/audio-transcripts/url": {
      "post": {
        "operationId": "postAudioTranscriptsUrl",
        "tags": [
          "audio-transcripts"
        ],
        "summary": "POST /api/v1/audio-transcripts/url — Upload audio from URL",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "audio-transcripts",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/audio-transcripts/{audioId}/generate-rag": {
      "post": {
        "operationId": "postAudioTranscriptsByAudioIdGenerateRag",
        "tags": [
          "audio-transcripts"
        ],
        "summary": "POST /api/v1/audio-transcripts/:audioId/generate-rag — Generate RAG from completed transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "audioId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "audio-transcripts",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "speakers": {
                    "type": "string"
                  },
                  "chunkingTool": {
                    "type": "string"
                  },
                  "cleaners": {
                    "type": "string"
                  },
                  "ragVectors": {
                    "type": "string"
                  }
                },
                "required": [
                  "speakers",
                  "chunkingTool",
                  "ragVectors"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/audio-transcripts/{audioId}": {
      "get": {
        "operationId": "getAudioTranscriptsByAudioId",
        "tags": [
          "audio-transcripts"
        ],
        "summary": "GET /api/v1/audio-transcripts/:audioId — Get a specific transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "audioId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "audio-transcripts"
      },
      "delete": {
        "operationId": "deleteAudioTranscriptsByAudioId",
        "tags": [
          "audio-transcripts"
        ],
        "summary": "DELETE /api/v1/audio-transcripts/:audioId — Delete a transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "audioId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:write"
        ],
        "x-rate-limit-feature": "audio-transcripts"
      }
    },
    "/api/v1/connectors": {
      "get": {
        "operationId": "getConnectors",
        "tags": [
          "connectors"
        ],
        "summary": "GET /api/v1/connectors — List all connections",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Every connector connection in the workspace, with per-connection counts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "provider": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:read"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{provider}": {
      "get": {
        "operationId": "getConnectorsByProvider",
        "tags": [
          "connectors"
        ],
        "summary": "GET /api/v1/connectors/:provider — Get connection status for a specific provider",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:read"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{provider}/auth": {
      "post": {
        "operationId": "postConnectorsByProviderAuth",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/:provider/auth — Initiate OAuth or validate credentials",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{provider}/disconnect": {
      "post": {
        "operationId": "postConnectorsByProviderDisconnect",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/:provider/disconnect — Revoke connection",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/web-crawl/start": {
      "post": {
        "operationId": "postConnectorsWebCrawlStart",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/web-crawl/start — create (or update) a web_crawl connector and start a crawl into its target vector. Distinct literal path so the `/:provider/auth` and `/:connectionId/sync` param-routes cannot capture it.",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/wordpress/discover": {
      "post": {
        "operationId": "postConnectorsWordpressDiscover",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/wordpress/discover — inspect a WordPress site before connecting it. Returns the site's name, its UTC offset, and every REST-exposed post type. The most common reason a customer's content \"isn't there\" after a sync is a custom post type registered without `show_in_rest: true`, which makes it invisible to the REST API entirely — this is what surfaces that.",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/wordpress/start": {
      "post": {
        "operationId": "postConnectorsWordpressStart",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/wordpress/start — create (or update) a wordpress connector and sync it into its target vector.",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/stats/overview": {
      "get": {
        "operationId": "getConnectorsStatsOverview",
        "tags": [
          "connectors"
        ],
        "summary": "GET /api/v1/connectors/stats/overview — connection + sync statistics",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:read"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{provider}/settings": {
      "get": {
        "operationId": "getConnectorsByProviderSettings",
        "tags": [
          "connectors"
        ],
        "summary": "GET /api/v1/connectors/:provider/settings — provider settings + sync config",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:read"
        ],
        "x-rate-limit-feature": "connectors"
      },
      "put": {
        "operationId": "putConnectorsByProviderSettings",
        "tags": [
          "connectors"
        ],
        "summary": "PUT /api/v1/connectors/:provider/settings — update provider settings and/or sync config. `syncConfig.autoSync` is the flag both recurring-sync crons filter on, so this is the only way to put an existing connector on (or take it off) a schedule.",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{connectionId}/sync": {
      "post": {
        "operationId": "postConnectorsByConnectionIdSync",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/:connectionId/sync — trigger a sync now Supported for the durable providers (web_crawl, wordpress). Others must be synced from the app's Connectors page, which supplies the file selection and the user token their pipeline requires.",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "QUEUED, not synced. The response is sent BEFORE the sync is dispatched, so a 202 means the job was accepted, never that content changed. Poll GET .../sync for job state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "connectionId": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string",
                      "description": "Durable sync providers only: web_crawl or wordpress."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      },
      "get": {
        "operationId": "getConnectorsByConnectionIdSync",
        "tags": [
          "connectors"
        ],
        "summary": "GET /api/v1/connectors/:connectionId/sync — sync-job history (10 most recent)",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sync jobs for this connection — the poll target after a 202 from POST.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:read"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/connectors/{connectionId}/sync/cancel": {
      "post": {
        "operationId": "postConnectorsByConnectionIdSyncCancel",
        "tags": [
          "connectors"
        ],
        "summary": "POST /api/v1/connectors/:connectionId/sync/cancel — cancel in-flight syncs",
        "security": [
          {
            "ApiKeyAuth": [
              "connector:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "connector:write"
        ],
        "x-rate-limit-feature": "connectors"
      }
    },
    "/api/v1/hermes-agent/{agentId}/fleet/claims": {
      "get": {
        "operationId": "getHermesAgentByAgentIdFleetClaims",
        "tags": [
          "hermes-agent"
        ],
        "summary": "Reading the board is a read. Taking or releasing a lever changes what other agents are permitted to do, so it is a write.",
        "security": [
          {
            "ApiKeyAuth": [
              "config:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "config:read"
        ],
        "x-rate-limit-feature": "hermes-agent"
      }
    },
    "/api/v1/hermes-agent/{agentId}/fleet/claims/acquire": {
      "post": {
        "operationId": "postHermesAgentByAgentIdFleetClaimsAcquire",
        "tags": [
          "hermes-agent"
        ],
        "summary": "POST /api/v1/hermes-agent/:agentId/fleet/claims/acquire",
        "security": [
          {
            "ApiKeyAuth": [
              "config:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "config:write"
        ],
        "x-rate-limit-feature": "hermes-agent"
      }
    },
    "/api/v1/hermes-agent/{agentId}/fleet/claims/release": {
      "post": {
        "operationId": "postHermesAgentByAgentIdFleetClaimsRelease",
        "tags": [
          "hermes-agent"
        ],
        "summary": "POST /api/v1/hermes-agent/:agentId/fleet/claims/release",
        "security": [
          {
            "ApiKeyAuth": [
              "config:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "config:write"
        ],
        "x-rate-limit-feature": "hermes-agent"
      }
    },
    "/api/v1/html-pages": {
      "get": {
        "operationId": "getHtmlPages",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages — List HTML pages (supports ?urlHost= filter)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/count": {
      "get": {
        "operationId": "getHtmlPagesCount",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/count — Get total page count",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/by-url": {
      "get": {
        "operationId": "getHtmlPagesByUrl",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/by-url — Get page by URL (?url=...)",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/hosts": {
      "get": {
        "operationId": "getHtmlPagesHosts",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/hosts — List unique hosts",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/hosts/history": {
      "get": {
        "operationId": "getHtmlPagesHostsHistory",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/hosts/history — List crawl history for all hosts",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/hosts/{urlHost}/history": {
      "get": {
        "operationId": "getHtmlPagesHostsByUrlHostHistory",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/hosts/:urlHost/history — Get crawl history for a specific host",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "urlHost",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/html-pages/{pageId}": {
      "get": {
        "operationId": "getHtmlPagesByPageId",
        "tags": [
          "html-pages"
        ],
        "summary": "GET /api/v1/html-pages/:pageId — Get a specific page",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "pageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "html-pages"
      }
    },
    "/api/v1/notifications": {
      "get": {
        "operationId": "getNotifications",
        "tags": [
          "notifications"
        ],
        "summary": "GET /api/v1/notifications — List notifications Supports query params: page, limit, isRead, tags, notificationType, title, createdAfter, createdBefore",
        "security": [
          {
            "ApiKeyAuth": [
              "notification:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "notification:read"
        ],
        "x-rate-limit-feature": "notifications"
      }
    },
    "/api/v1/notifications/counts": {
      "get": {
        "operationId": "getNotificationsCounts",
        "tags": [
          "notifications"
        ],
        "summary": "GET /api/v1/notifications/counts — Get notification counts (total + unread)",
        "security": [
          {
            "ApiKeyAuth": [
              "notification:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "notification:read"
        ],
        "x-rate-limit-feature": "notifications"
      }
    },
    "/api/v1/notifications/{notificationId}/read": {
      "patch": {
        "operationId": "patchNotificationsByNotificationIdRead",
        "tags": [
          "notifications"
        ],
        "summary": "PATCH /api/v1/notifications/:notificationId/read — Mark notification as read/unread",
        "security": [
          {
            "ApiKeyAuth": [
              "notification:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "notification:write"
        ],
        "x-rate-limit-feature": "notifications"
      }
    },
    "/api/v1/threads": {
      "get": {
        "operationId": "getThreads",
        "tags": [
          "threads"
        ],
        "summary": "GET /api/v1/threads — List all threads for the whitelabel",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:read"
        ],
        "x-rate-limit-feature": "threads"
      }
    },
    "/api/v1/threads/{chatId}": {
      "get": {
        "operationId": "getThreadsByChatId",
        "tags": [
          "threads"
        ],
        "summary": "GET /api/v1/threads/:chatId — Get a specific thread with transcript",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "chatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:read"
        ],
        "x-rate-limit-feature": "threads"
      }
    },
    "/api/v1/voiceprints": {
      "get": {
        "operationId": "getVoiceprints",
        "tags": [
          "voiceprints"
        ],
        "summary": "GET /api/v1/voiceprints — List voiceprints for the whitelabel",
        "security": [
          {
            "ApiKeyAuth": [
              "rag:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "rag:read"
        ],
        "x-rate-limit-feature": "voiceprints"
      }
    },
    "/api/v1/export": {
      "get": {
        "operationId": "getExport",
        "tags": [
          "export"
        ],
        "summary": "GET /api/v1/export — Export whitelabel configuration (JSON or YAML)",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:read"
        ],
        "x-rate-limit-feature": "export"
      },
      "post": {
        "operationId": "postExport",
        "tags": [
          "export"
        ],
        "summary": "POST /api/v1/export — Import whitelabel configuration (JSON or YAML)",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:write"
        ],
        "x-rate-limit-feature": "export",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/tts/generate": {
      "post": {
        "operationId": "postTtsGenerate",
        "tags": [
          "tts"
        ],
        "summary": "POST /api/v1/tts/generate — Generate TTS audio from text",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:write"
        ],
        "x-rate-limit-feature": "tts",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/tts/settings": {
      "get": {
        "operationId": "getTtsSettings",
        "tags": [
          "tts"
        ],
        "summary": "GET /api/v1/tts/settings — Get TTS settings",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:read"
        ],
        "x-rate-limit-feature": "tts"
      },
      "patch": {
        "operationId": "patchTtsSettings",
        "tags": [
          "tts"
        ],
        "summary": "PATCH /api/v1/tts/settings — Update TTS settings",
        "security": [
          {
            "ApiKeyAuth": [
              "whitelabel:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "whitelabel:write"
        ],
        "x-rate-limit-feature": "tts",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/completions": {
      "post": {
        "operationId": "postChatCompletions",
        "tags": [
          "chat"
        ],
        "summary": "POST /api/v1/chat/completions — API-key authenticated (consumer path). whitelabelId + userId injected by injectWhitelabel from the key's target.",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "An OpenAI-compatible chat completion, plus the Divinci `transcriptId` extension.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "enum": [
                        "chat.completion"
                      ]
                    },
                    "created": {
                      "type": "integer",
                      "description": "Unix seconds."
                    },
                    "model": {
                      "type": "string",
                      "description": "The configured assistant name, or \"default\"."
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "message": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string",
                                "enum": [
                                  "assistant"
                                ]
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string",
                            "enum": [
                              "stop"
                            ]
                          }
                        }
                      },
                      "description": "Always exactly one choice. `n` is not supported."
                    },
                    "usage": {
                      "type": "object",
                      "description": "PRESENT BUT ALWAYS ZERO. Token accounting is not wired to this endpoint, so prompt_tokens/completion_tokens/total_tokens are hardcoded to 0. Do not meter on them.",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer"
                        },
                        "completion_tokens": {
                          "type": "integer"
                        },
                        "total_tokens": {
                          "type": "integer"
                        }
                      }
                    },
                    "transcriptId": {
                      "type": "string",
                      "description": "Divinci extension, not part of the OpenAI shape. The transcript this turn was written to — pass it to GET /api/v1/transcripts/{transcriptId} to read the thread."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:write"
        ],
        "x-rate-limit-feature": "chat"
      }
    },
    "/api/v1/training-data/estimate-cost": {
      "post": {
        "operationId": "postTrainingDataEstimateCost",
        "tags": [
          "training-data"
        ],
        "summary": "Training Data API v1 Generate supervised fine-tuning datasets from RAG files and audio transcripts. Export generated Q&A pairs to fine-tune files or QA test suites. Endpoints: POST   /estimate-cost                       — Estimate generation cost POST   /generate/from-rag/:ragFileId        — Generate from RAG file POST   /generate/from-audio/:audioId        — Generate from audio transcript GET    /jobs                                 — List generation jobs GET    /jobs/:jobId                          — Get job status and progress GET    /jobs/:jobId/results                  — Get generated Q&A pairs POST   /jobs/:jobId/export                   — Export to fine-tune file POST   /jobs/:jobId/export-to-qa             — Export to QA test suite DELETE /jobs/:jobId                          — Cancel/delete job --- Cost Estimation --- POST /api/v1/training-data/estimate-cost",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:read"
        ],
        "x-rate-limit-feature": "training-data",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/training-data/generate/from-rag/{ragFileId}": {
      "post": {
        "operationId": "postTrainingDataGenerateFromRagByRagFileId",
        "tags": [
          "training-data"
        ],
        "summary": "--- Generation --- POST /api/v1/training-data/generate/from-rag/:ragFileId",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ragFileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:write"
        ],
        "x-rate-limit-feature": "training-data",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/training-data/generate/from-audio/{audioId}": {
      "post": {
        "operationId": "postTrainingDataGenerateFromAudioByAudioId",
        "tags": [
          "training-data"
        ],
        "summary": "POST /api/v1/training-data/generate/from-audio/:audioId",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "audioId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:write"
        ],
        "x-rate-limit-feature": "training-data",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/training-data/jobs": {
      "get": {
        "operationId": "getTrainingDataJobs",
        "tags": [
          "training-data"
        ],
        "summary": "--- Job Management --- GET /api/v1/training-data/jobs",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:read"
        ],
        "x-rate-limit-feature": "training-data"
      }
    },
    "/api/v1/training-data/jobs/{jobId}": {
      "get": {
        "operationId": "getTrainingDataJobsByJobId",
        "tags": [
          "training-data"
        ],
        "summary": "GET /api/v1/training-data/jobs/:jobId",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:read"
        ],
        "x-rate-limit-feature": "training-data"
      },
      "delete": {
        "operationId": "deleteTrainingDataJobsByJobId",
        "tags": [
          "training-data"
        ],
        "summary": "--- Deletion --- DELETE /api/v1/training-data/jobs/:jobId",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:write"
        ],
        "x-rate-limit-feature": "training-data"
      }
    },
    "/api/v1/training-data/jobs/{jobId}/results": {
      "get": {
        "operationId": "getTrainingDataJobsByJobIdResults",
        "tags": [
          "training-data"
        ],
        "summary": "GET /api/v1/training-data/jobs/:jobId/results",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:read"
        ],
        "x-rate-limit-feature": "training-data"
      }
    },
    "/api/v1/training-data/jobs/{jobId}/export": {
      "post": {
        "operationId": "postTrainingDataJobsByJobIdExport",
        "tags": [
          "training-data"
        ],
        "summary": "--- Export --- POST /api/v1/training-data/jobs/:jobId/export — Export to fine-tune file",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:write"
        ],
        "x-rate-limit-feature": "training-data",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/training-data/jobs/{jobId}/export-to-qa": {
      "post": {
        "operationId": "postTrainingDataJobsByJobIdExportToQa",
        "tags": [
          "training-data"
        ],
        "summary": "POST /api/v1/training-data/jobs/:jobId/export-to-qa — Export to QA test suite",
        "security": [
          {
            "ApiKeyAuth": [
              "training-data:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "training-data:write"
        ],
        "x-rate-limit-feature": "training-data",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites": {
      "get": {
        "operationId": "getQaSuites",
        "tags": [
          "qa"
        ],
        "summary": "Quality Assurance API v1 Manage QA test suites and run post-fine-tune validation. Suites contain test prompts with expected responses, scored by configurable evaluation generators (LLM judges, Ragas, DeepEval, etc.) Endpoints: GET    /suites                    — List QA suites POST   /suites                    — Create QA suite GET    /suites/:suiteId           — Get suite details with tests PATCH  /suites/:suiteId           — Update suite (name, description, scorers) DELETE /suites/:suiteId           — Delete suite POST   /suites/:suiteId/run       — Run QA validation against a release GET    /score-generators          — List available score generators --- Suites --- GET /api/v1/qa/suites",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:read"
        ],
        "x-rate-limit-feature": "qa"
      },
      "post": {
        "operationId": "postQaSuites",
        "tags": [
          "qa"
        ],
        "summary": "POST /api/v1/qa/suites",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites/copy-from": {
      "post": {
        "operationId": "postQaSuitesCopyFrom",
        "tags": [
          "qa"
        ],
        "summary": "POST /api/v1/qa/suites/copy-from Copy a QASuite + tests from a source whitelabel into the caller's workspace. Body: { sourceWhitelabelId, sourceSuiteId, newSuiteName?, fineTuneFileIdMap? } Registered BEFORE /suites/:suiteId to avoid being shadowed.",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites/{suiteId}/multi-release-run": {
      "post": {
        "operationId": "postQaSuitesBySuiteIdMultiReleaseRun",
        "tags": [
          "qa"
        ],
        "summary": "POST /api/v1/qa/suites/:suiteId/multi-release-run Fan out the suite across multiple releases and return a comparison report. Body: { releaseIds: string[], testIds?, maxTestsPerRelease?, concurrency?, includeMarkdown? }",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "releaseIds": {
                    "type": "string"
                  },
                  "testIds": {
                    "type": "string"
                  },
                  "maxTestsPerRelease": {
                    "type": "string"
                  },
                  "perTestTimeoutMs": {
                    "type": "string"
                  },
                  "overallTimeoutMs": {
                    "type": "string"
                  },
                  "concurrency": {
                    "type": "string"
                  },
                  "includeMarkdown": {
                    "type": "string"
                  },
                  "ragGroupIds": {
                    "type": "string"
                  },
                  "judgeModelOverride": {
                    "type": "string"
                  },
                  "confirmCost": {
                    "type": "string"
                  },
                  "batchMode": {
                    "type": "string"
                  },
                  "batchThreshold": {
                    "type": "string"
                  }
                },
                "required": [
                  "releaseIds"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites/{suiteId}/arena-run": {
      "post": {
        "operationId": "postQaSuitesBySuiteIdArenaRun",
        "tags": [
          "qa"
        ],
        "summary": "POST /api/v1/qa/suites/:suiteId/arena-run Run the suite across every variant of an arena preset. Body: { arenaPresetId, testIds?, maxTestsPerVariant?, variantIndexes?, includeMarkdown? }",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "arenaPresetId": {
                    "type": "string"
                  },
                  "testIds": {
                    "type": "string"
                  },
                  "maxTestsPerVariant": {
                    "type": "string"
                  },
                  "perTestTimeoutMs": {
                    "type": "string"
                  },
                  "overallTimeoutMs": {
                    "type": "string"
                  },
                  "concurrency": {
                    "type": "string"
                  },
                  "variantIndexes": {
                    "type": "string"
                  },
                  "includeMarkdown": {
                    "type": "string"
                  },
                  "judgeModelOverride": {
                    "type": "string"
                  }
                },
                "required": [
                  "arenaPresetId"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites/{suiteId}": {
      "get": {
        "operationId": "getQaSuitesBySuiteId",
        "tags": [
          "qa"
        ],
        "summary": "GET /api/v1/qa/suites/:suiteId",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:read"
        ],
        "x-rate-limit-feature": "qa"
      },
      "patch": {
        "operationId": "patchQaSuitesBySuiteId",
        "tags": [
          "qa"
        ],
        "summary": "PATCH /api/v1/qa/suites/:suiteId",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pinned": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "pinned"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteQaSuitesBySuiteId",
        "tags": [
          "qa"
        ],
        "summary": "DELETE /api/v1/qa/suites/:suiteId",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa"
      }
    },
    "/api/v1/qa/suites/{suiteId}/run": {
      "post": {
        "operationId": "postQaSuitesBySuiteIdRun",
        "tags": [
          "qa"
        ],
        "summary": "--- QA Runs --- POST /api/v1/qa/suites/:suiteId/run — Run QA validation against a release Body: { releaseId, testIds?, concurrency?, maxTests? } Returns: { iterationResultId, overallScore, results[], delta?, previousScore? }",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "releaseId": {
                    "type": "string"
                  },
                  "testIds": {
                    "type": "string"
                  },
                  "concurrency": {
                    "type": "string"
                  },
                  "perTestTimeoutMs": {
                    "type": "string"
                  },
                  "overallTimeoutMs": {
                    "type": "string"
                  },
                  "maxTests": {
                    "type": "string"
                  }
                },
                "required": [
                  "releaseId"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/suites/{suiteId}/runs/{runResultId}/train": {
      "post": {
        "operationId": "postQaSuitesBySuiteIdRunsByRunResultIdTrain",
        "tags": [
          "qa"
        ],
        "summary": "POST /api/v1/qa/suites/:suiteId/runs/:runResultId/train One-click: export best-scoring pairs → FineTuneFile → kick off Modal LoRA training. Body: { provider?, modelName?, scoreThreshold?, includeLowScoreRejected?, autoReleaseOnCompletion?, title? } Returns 202: { fineTuneAIId, jobId, status: \"training\", pairCount, skipped, scoreThreshold, modelName }",
        "security": [
          {
            "ApiKeyAuth": [
              "finetune:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "suiteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "runResultId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "finetune:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/qa/tests/generate-from-rag-file": {
      "post": {
        "operationId": "postQaTestsGenerateFromRagFile",
        "tags": [
          "qa"
        ],
        "summary": "--- Tests --- POST /api/v1/qa/tests/generate-from-rag-file Generate Q/A test pairs from a RAG file and add them to one or more QA suites. Body: { ragFileId, suiteIds, releaseId, promptGenerator?, qaPerChunk?, preset?, noduplicateSources? } Returns: { testCount, testIds[], failedTests[], failedSuites[] }",
        "security": [
          {
            "ApiKeyAuth": [
              "qa:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "qa:write"
        ],
        "x-rate-limit-feature": "qa",
        "requestBody": {
          "required": true,
          "x-schema-source": "zod",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ragFileId": {
                    "type": "string"
                  },
                  "suiteIds": {
                    "type": "string"
                  },
                  "releaseId": {
                    "type": "string"
                  },
                  "promptGenerator": {
                    "type": "string"
                  },
                  "qaPerChunk": {
                    "type": "string"
                  },
                  "preset": {
                    "type": "string"
                  },
                  "noduplicateSources": {
                    "type": "string"
                  }
                },
                "required": [
                  "ragFileId",
                  "suiteIds",
                  "releaseId",
                  "qaPerChunk",
                  "preset",
                  "noduplicateSources"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/model-edits/describe": {
      "get": {
        "operationId": "getModelEditsDescribe",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/describe?entity=X — must be before /:id.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits": {
      "get": {
        "operationId": "getModelEdits",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits — list edits (newest first, max 100).",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      },
      "post": {
        "operationId": "postModelEdits",
        "tags": [
          "model-edits"
        ],
        "summary": "POST /api/v1/model-edits — create an edit. Body: { entity, relation, target, op }.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:write"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/probe": {
      "post": {
        "operationId": "postModelEditsProbe",
        "tags": [
          "model-edits"
        ],
        "summary": "POST /api/v1/model-edits/probe — top-k next tokens in the workspace overlay. Body: { prompt, top? }. Sent in the model's chat format; an added fact shows up as `override`.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/export": {
      "get": {
        "operationId": "getModelEditsExport",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/export — the receipt.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/versions": {
      "get": {
        "operationId": "getModelEditsVersions",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/versions — newest first.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      },
      "post": {
        "operationId": "postModelEditsVersions",
        "tags": [
          "model-edits"
        ],
        "summary": "POST /api/v1/model-edits/versions — freeze the active set. Body: { changelog? }.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:write"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/versions/{ref}": {
      "get": {
        "operationId": "getModelEditsVersionsByRef",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/versions/:ref — by id or number.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/versions/{ref}/restore": {
      "post": {
        "operationId": "postModelEditsVersionsByRefRestore",
        "tags": [
          "model-edits"
        ],
        "summary": "POST /api/v1/model-edits/versions/:ref/restore",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:write"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/versions/{ref}/qa-runs": {
      "get": {
        "operationId": "getModelEditsVersionsByRefQaRuns",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/versions/:ref/qa-runs",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/model-edits/{id}": {
      "get": {
        "operationId": "getModelEditsById",
        "tags": [
          "model-edits"
        ],
        "summary": "GET /api/v1/model-edits/:id — get one edit.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:read"
        ],
        "x-rate-limit-feature": "model-edits"
      },
      "delete": {
        "operationId": "deleteModelEditsById",
        "tags": [
          "model-edits"
        ],
        "summary": "DELETE /api/v1/model-edits/:id — revert an edit.",
        "security": [
          {
            "ApiKeyAuth": [
              "model-edits:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "model-edits:write"
        ],
        "x-rate-limit-feature": "model-edits"
      }
    },
    "/api/v1/compliance/annex-iv/{releaseId}": {
      "get": {
        "operationId": "getComplianceAnnexIvByReleaseId",
        "tags": [
          "compliance"
        ],
        "summary": "GET /api/v1/compliance/annex-iv/:releaseId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "compliance"
      }
    },
    "/api/v1/compliance/answers": {
      "get": {
        "operationId": "getComplianceAnswers",
        "tags": [
          "compliance"
        ],
        "summary": "GET /api/v1/compliance/answers",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "compliance"
      }
    },
    "/api/v1/compliance/answers/{gapId}": {
      "put": {
        "operationId": "putComplianceAnswersByGapId",
        "tags": [
          "compliance"
        ],
        "summary": "PUT /api/v1/compliance/answers/:gapId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "gapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "compliance"
      },
      "delete": {
        "operationId": "deleteComplianceAnswersByGapId",
        "tags": [
          "compliance"
        ],
        "summary": "DELETE /api/v1/compliance/answers/:gapId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "gapId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "compliance"
      }
    },
    "/api/v1/byok": {
      "post": {
        "operationId": "postByok",
        "tags": [
          "byok"
        ],
        "summary": "POST /api/v1/byok",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:write"
        ],
        "x-rate-limit-feature": "byok"
      },
      "get": {
        "operationId": "getByok",
        "tags": [
          "byok"
        ],
        "summary": "GET /api/v1/byok",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:read"
        ],
        "x-rate-limit-feature": "byok"
      }
    },
    "/api/v1/byok/{byokId}/wrapped-secret": {
      "get": {
        "operationId": "getByokByByokIdWrappedSecret",
        "tags": [
          "byok"
        ],
        "summary": "GET /api/v1/byok/:byokId/wrapped-secret",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:resolve"
            ]
          }
        ],
        "parameters": [
          {
            "name": "byokId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:resolve"
        ],
        "x-rate-limit-feature": "byok"
      }
    },
    "/api/v1/byok/{byokId}": {
      "get": {
        "operationId": "getByokByByokId",
        "tags": [
          "byok"
        ],
        "summary": "GET /api/v1/byok/:byokId",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "byokId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:read"
        ],
        "x-rate-limit-feature": "byok"
      },
      "patch": {
        "operationId": "patchByokByByokId",
        "tags": [
          "byok"
        ],
        "summary": "PATCH /api/v1/byok/:byokId",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "byokId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:write"
        ],
        "x-rate-limit-feature": "byok"
      },
      "delete": {
        "operationId": "deleteByokByByokId",
        "tags": [
          "byok"
        ],
        "summary": "DELETE /api/v1/byok/:byokId",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "byokId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:write"
        ],
        "x-rate-limit-feature": "byok"
      }
    },
    "/api/v1/byok/{byokId}/mark-stale": {
      "patch": {
        "operationId": "patchByokByByokIdMarkStale",
        "tags": [
          "byok"
        ],
        "summary": "PATCH /api/v1/byok/:byokId/mark-stale",
        "security": [
          {
            "ApiKeyAuth": [
              "byok:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "byokId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "byok:write"
        ],
        "x-rate-limit-feature": "byok"
      }
    },
    "/api/v1/terms/admin": {
      "get": {
        "operationId": "getTermsAdmin",
        "tags": [
          "terms"
        ],
        "summary": "--------------------------------------------------------------------------- Admin lifecycle (API-key surface for the SDK / MCP / CLI)  Mounted under /api/v1/terms/admin — the `/admin` segment keeps these unambiguous next to the consumer routes below (a bare GET /:tosId would otherwise collide with paths like /accept). Scopes mirror the release admin routes: reads need `release:read`, writes need `release:write` (a ToS is release-governing configuration; no new scope to provision).  Attaching a ToS to a release is a RELEASE update — PATCH /api/v1/releases/:releaseId with { termsOfService: { id } } (drafts), or the release /update path for active releases. --------------------------------------------------------------------------- GET /api/v1/terms/admin — list the workspace's ToS documents",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "terms"
      },
      "post": {
        "operationId": "postTermsAdmin",
        "tags": [
          "terms"
        ],
        "summary": "POST /api/v1/terms/admin — create a ToS document { title, draftContent? }",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "terms",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/terms/admin/{tosId}": {
      "get": {
        "operationId": "getTermsAdminByTosId",
        "tags": [
          "terms"
        ],
        "summary": "GET /api/v1/terms/admin/:tosId — fetch one (draft + published content)",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "tosId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "terms"
      },
      "patch": {
        "operationId": "patchTermsAdminByTosId",
        "tags": [
          "terms"
        ],
        "summary": "PATCH /api/v1/terms/admin/:tosId — update { title?, draftContent? } (draft only; never bumps the version)",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "tosId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "terms",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/terms/admin/{tosId}/publish": {
      "post": {
        "operationId": "postTermsAdminByTosIdPublish",
        "tags": [
          "terms"
        ],
        "summary": "POST /api/v1/terms/admin/:tosId/publish — publish the draft → bumps publishedVersion, forces re-acceptance",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "tosId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "terms"
      }
    },
    "/api/v1/terms/admin/{tosId}/restore": {
      "post": {
        "operationId": "postTermsAdminByTosIdRestore",
        "tags": [
          "terms"
        ],
        "summary": "POST /api/v1/terms/admin/:tosId/restore — restore a prior version into the draft",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "tosId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "terms",
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/terms/release/{releaseId}": {
      "get": {
        "operationId": "getTermsReleaseByReleaseId",
        "tags": [
          "terms"
        ],
        "summary": "GET /api/v1/terms/release/:releaseId Returns the Terms of Service gate for the calling identity against the given release: `{ required: false }` when no published ToS exists or the caller already accepted the current version; otherwise the full gate (tosId, version, title, markdown content).",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "terms"
      }
    },
    "/api/v1/terms/accept": {
      "post": {
        "operationId": "postTermsAccept",
        "tags": [
          "terms"
        ],
        "summary": "POST /api/v1/terms/accept Records acceptance of the CURRENT published ToS version for the API-key-resolved user. Body: { tosId, version, releaseId? } — all come from the 403 TERMS_NOT_ACCEPTED `details`. When releaseId is supplied, the tosId must be the document that release references (same cross-check as the public accept endpoint). Responds 409 when version is stale.",
        "security": [
          {
            "ApiKeyAuth": [
              "transcript:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "transcript:write"
        ],
        "x-rate-limit-feature": "terms"
      }
    },
    "/api/v1/mcp-servers": {
      "get": {
        "operationId": "getMcpServers",
        "tags": [
          "mcp-servers"
        ],
        "summary": "GET /api/v1/mcp-servers — list the workspace's configured servers (sanitized).",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "mcp-servers"
      },
      "post": {
        "operationId": "postMcpServers",
        "tags": [
          "mcp-servers"
        ],
        "summary": "POST /api/v1/mcp-servers — create { name, transport, url, authType?, authToken?, enabled? }",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "mcp-servers"
      }
    },
    "/api/v1/mcp-servers/{mcpServerId}": {
      "get": {
        "operationId": "getMcpServersByMcpServerId",
        "tags": [
          "mcp-servers"
        ],
        "summary": "GET /api/v1/mcp-servers/:mcpServerId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "mcpServerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "mcp-servers"
      },
      "patch": {
        "operationId": "patchMcpServersByMcpServerId",
        "tags": [
          "mcp-servers"
        ],
        "summary": "PATCH /api/v1/mcp-servers/:mcpServerId — update { name?, transport?, url?, authType?, authToken?, enabled? }",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "mcpServerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "mcp-servers"
      },
      "delete": {
        "operationId": "deleteMcpServersByMcpServerId",
        "tags": [
          "mcp-servers"
        ],
        "summary": "DELETE /api/v1/mcp-servers/:mcpServerId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "mcpServerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "mcp-servers"
      }
    },
    "/api/v1/external-tools": {
      "get": {
        "operationId": "getExternalTools",
        "tags": [
          "external-tools"
        ],
        "summary": "GET /api/v1/external-tools",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "external-tools"
      },
      "post": {
        "operationId": "postExternalTools",
        "tags": [
          "external-tools"
        ],
        "summary": "POST /api/v1/external-tools",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "external-tools"
      }
    },
    "/api/v1/external-tools/{externalToolId}": {
      "get": {
        "operationId": "getExternalToolsByExternalToolId",
        "tags": [
          "external-tools"
        ],
        "summary": "GET /api/v1/external-tools/:externalToolId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "externalToolId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:read"
        ],
        "x-rate-limit-feature": "external-tools"
      },
      "patch": {
        "operationId": "patchExternalToolsByExternalToolId",
        "tags": [
          "external-tools"
        ],
        "summary": "PATCH /api/v1/external-tools/:externalToolId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "externalToolId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "external-tools"
      },
      "delete": {
        "operationId": "deleteExternalToolsByExternalToolId",
        "tags": [
          "external-tools"
        ],
        "summary": "DELETE /api/v1/external-tools/:externalToolId",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "externalToolId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "external-tools"
      }
    },
    "/api/v1/external-tools/{externalToolId}/health-check": {
      "post": {
        "operationId": "postExternalToolsByExternalToolIdHealthCheck",
        "tags": [
          "external-tools"
        ],
        "summary": "release:WRITE, not read. It persists `health`, and it causes an outbound request to a third party — a read scope should not let a caller generate traffic against someone else's service.",
        "security": [
          {
            "ApiKeyAuth": [
              "release:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "externalToolId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "release:write"
        ],
        "x-rate-limit-feature": "external-tools"
      }
    },
    "/api/v1/groups": {
      "post": {
        "operationId": "postGroups",
        "tags": [
          "groups"
        ],
        "summary": "Mount routes",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      },
      "get": {
        "operationId": "getGroups",
        "tags": [
          "groups"
        ],
        "summary": "GET /api/v1/groups",
        "security": [
          {
            "ApiKeyAuth": [
              "group:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:read"
        ],
        "x-rate-limit-feature": "groups"
      }
    },
    "/api/v1/groups/{groupId}": {
      "get": {
        "operationId": "getGroupsByGroupId",
        "tags": [
          "groups"
        ],
        "summary": "GET /api/v1/groups/:groupId",
        "security": [
          {
            "ApiKeyAuth": [
              "group:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:read"
        ],
        "x-rate-limit-feature": "groups"
      },
      "patch": {
        "operationId": "patchGroupsByGroupId",
        "tags": [
          "groups"
        ],
        "summary": "PATCH /api/v1/groups/:groupId",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      },
      "delete": {
        "operationId": "deleteGroupsByGroupId",
        "tags": [
          "groups"
        ],
        "summary": "DELETE /api/v1/groups/:groupId",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      }
    },
    "/api/v1/groups/{groupId}/invite": {
      "post": {
        "operationId": "postGroupsByGroupIdInvite",
        "tags": [
          "groups"
        ],
        "summary": "POST /api/v1/groups/:groupId/invite",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      },
      "delete": {
        "operationId": "deleteGroupsByGroupIdInvite",
        "tags": [
          "groups"
        ],
        "summary": "DELETE /api/v1/groups/:groupId/invite",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      }
    },
    "/api/v1/groups/{groupId}/members": {
      "delete": {
        "operationId": "deleteGroupsByGroupIdMembers",
        "tags": [
          "groups"
        ],
        "summary": "DELETE /api/v1/groups/:groupId/members",
        "security": [
          {
            "ApiKeyAuth": [
              "group:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "group:write"
        ],
        "x-rate-limit-feature": "groups"
      }
    },
    "/api/v1/permissions": {
      "get": {
        "operationId": "getPermissions",
        "tags": [
          "permissions"
        ],
        "summary": "Mount routes",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:read"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/permissions/mine": {
      "get": {
        "operationId": "getPermissionsMine",
        "tags": [
          "permissions"
        ],
        "summary": "GET /api/v1/permissions/mine",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:read"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/permissions/users": {
      "post": {
        "operationId": "postPermissionsUsers",
        "tags": [
          "permissions"
        ],
        "summary": "POST /api/v1/permissions/users",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      },
      "delete": {
        "operationId": "deletePermissionsUsers",
        "tags": [
          "permissions"
        ],
        "summary": "DELETE /api/v1/permissions/users",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/permissions/groups": {
      "post": {
        "operationId": "postPermissionsGroups",
        "tags": [
          "permissions"
        ],
        "summary": "POST /api/v1/permissions/groups",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      },
      "delete": {
        "operationId": "deletePermissionsGroups",
        "tags": [
          "permissions"
        ],
        "summary": "DELETE /api/v1/permissions/groups",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/permissions/logged-in": {
      "post": {
        "operationId": "postPermissionsLoggedIn",
        "tags": [
          "permissions"
        ],
        "summary": "POST /api/v1/permissions/logged-in",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/permissions/anonymous": {
      "post": {
        "operationId": "postPermissionsAnonymous",
        "tags": [
          "permissions"
        ],
        "summary": "POST /api/v1/permissions/anonymous",
        "security": [
          {
            "ApiKeyAuth": [
              "permission:write"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "x-required-permissions": [
          "permission:write"
        ],
        "x-rate-limit-feature": "permissions"
      }
    },
    "/api/v1/workspaces/{workspaceId}/rate-limit-requests": {
      "post": {
        "operationId": "postWorkspacesByWorkspaceIdRateLimitRequests",
        "tags": [
          "workspaces/:workspaceId/rate-limit-requests"
        ],
        "summary": "POST /api/v1/workspaces/:workspaceId/rate-limit-requests",
        "security": [],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "get": {
        "operationId": "getWorkspacesByWorkspaceIdRateLimitRequests",
        "tags": [
          "workspaces/:workspaceId/rate-limit-requests"
        ],
        "summary": "GET /api/v1/workspaces/:workspaceId/rate-limit-requests",
        "security": [],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/slack/slash-command": {
      "post": {
        "operationId": "postSlackSlashCommand",
        "tags": [
          "slack"
        ],
        "summary": "POST /api/v1/slack/slash-command",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/slack/interactive": {
      "post": {
        "operationId": "postSlackInteractive",
        "tags": [
          "slack"
        ],
        "summary": "POST /api/v1/slack/interactive",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/preflight": {
      "post": {
        "operationId": "postOnboardingWebhookStepPreflight",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/preflight",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/recon": {
      "post": {
        "operationId": "postOnboardingWebhookStepRecon",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/recon",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/mark-ingesting": {
      "post": {
        "operationId": "postOnboardingWebhookStepMarkIngesting",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/mark-ingesting",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/crawl": {
      "post": {
        "operationId": "postOnboardingWebhookStepCrawl",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/crawl",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/process-media": {
      "post": {
        "operationId": "postOnboardingWebhookStepProcessMedia",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/process-media",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/enrich": {
      "post": {
        "operationId": "postOnboardingWebhookStepEnrich",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/enrich",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/finalize": {
      "post": {
        "operationId": "postOnboardingWebhookStepFinalize",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/finalize",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding-webhook/step/fail": {
      "post": {
        "operationId": "postOnboardingWebhookStepFail",
        "tags": [
          "onboarding-webhook"
        ],
        "summary": "POST /api/v1/onboarding-webhook/step/fail",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces": {
      "post": {
        "operationId": "postWorkspaces",
        "tags": [
          "workspaces"
        ],
        "summary": "Mount routes",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "get": {
        "operationId": "getWorkspaces",
        "tags": [
          "workspaces"
        ],
        "summary": "GET /api/v1/workspaces",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}": {
      "get": {
        "operationId": "getWorkspacesByWorkspaceId",
        "tags": [
          "workspaces"
        ],
        "summary": "GET /api/v1/workspaces/:workspaceId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "patch": {
        "operationId": "patchWorkspacesByWorkspaceId",
        "tags": [
          "workspaces"
        ],
        "summary": "PATCH /api/v1/workspaces/:workspaceId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspacesByWorkspaceId",
        "tags": [
          "workspaces"
        ],
        "summary": "DELETE /api/v1/workspaces/:workspaceId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/api-keys": {
      "post": {
        "operationId": "postWorkspacesByWorkspaceIdApiKeys",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "── Mount routes ────────────────────────────────────────────────────────",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "get": {
        "operationId": "getWorkspacesByWorkspaceIdApiKeys",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "GET /api/v1/workspaces/:workspaceId/api-keys",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/api-keys/{keyId}": {
      "get": {
        "operationId": "getWorkspacesByWorkspaceIdApiKeysByKeyId",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "GET /api/v1/workspaces/:workspaceId/api-keys/:keyId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "patch": {
        "operationId": "patchWorkspacesByWorkspaceIdApiKeysByKeyId",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "PATCH /api/v1/workspaces/:workspaceId/api-keys/:keyId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspacesByWorkspaceIdApiKeysByKeyId",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "DELETE /api/v1/workspaces/:workspaceId/api-keys/:keyId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/api-keys/{keyId}/rotate": {
      "post": {
        "operationId": "postWorkspacesByWorkspaceIdApiKeysByKeyIdRotate",
        "tags": [
          "workspaces/:workspaceId/api-keys"
        ],
        "summary": "POST /api/v1/workspaces/:workspaceId/api-keys/:keyId/rotate",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/workspaces/{workspaceId}/chat/completions": {
      "post": {
        "operationId": "postWorkspacesByWorkspaceIdChatCompletions",
        "tags": [
          "workspaces/:workspaceId/chat"
        ],
        "summary": "rateLimitByUser (per-userId) → requireWorkspaceOwner (authz + audit) → handler.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/page-status": {
      "get": {
        "operationId": "getWwwRagPageStatus",
        "tags": [
          "www-rag"
        ],
        "summary": "GET /api/v1/www-rag/page-status?url=&hash=",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/www-rag/page-context": {
      "post": {
        "operationId": "postWwwRagPageContext",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/page-context  { url, query, topK? }",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/theme": {
      "get": {
        "operationId": "getWwwRagTheme",
        "tags": [
          "www-rag"
        ],
        "summary": "GET /api/v1/www-rag/theme?host=<host>  — per-host brand theme the extension applies on landing (any authed user reads). The WRITE path is the HMAC-signed /api/v1/www-rag-webhook/theme ingest (mounted pre-auth; see ingestSiteTheme), since the crawler fleet is a headless service with no OAuth user.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/www-rag/submit-url": {
      "post": {
        "operationId": "postWwwRagSubmitUrl",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/submit-url  { url, reason? }  (P3 — contribute path)",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/site-audit": {
      "post": {
        "operationId": "postWwwRagSiteAudit",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/site-audit  { host }  — re-check + re-crawl a tracked site's changed pages (extension triggers on a content-hash mismatch).",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/crawl-connector/sync": {
      "post": {
        "operationId": "postWwwRagCrawlConnectorSync",
        "tags": [
          "www-rag"
        ],
        "summary": "Web-crawl connector (Phase 2 sync + Phase 4 refresh): run a crawl/feed into a chosen vector, tracked via RagVectorSource. Body: { settings, scope?, url? }.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/crawl-connector/refresh": {
      "post": {
        "operationId": "postWwwRagCrawlConnectorRefresh",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/crawl-connector/refresh",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/crawl-connector/poll": {
      "post": {
        "operationId": "postWwwRagCrawlConnectorPoll",
        "tags": [
          "www-rag"
        ],
        "summary": "Phase 3 recurrence tick — the connector-sync-worker cron calls this every 6h.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/claim/{host}/start": {
      "post": {
        "operationId": "postWwwRagClaimByHostStart",
        "tags": [
          "www-rag"
        ],
        "summary": "\"Claim your website\" (Yelp/Google-Maps-style) — DNS TXT verification, auto-migrates the site's vector/release into the claimant's own new whitelabel on success. See ./claim.ts.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/claim/{host}/verify": {
      "post": {
        "operationId": "postWwwRagClaimByHostVerify",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/claim/:host/verify",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/claim/{host}/status": {
      "get": {
        "operationId": "getWwwRagClaimByHostStatus",
        "tags": [
          "www-rag"
        ],
        "summary": "GET /api/v1/www-rag/claim/:host/status",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/www-rag/copy/{host}": {
      "post": {
        "operationId": "postWwwRagCopyByHost",
        "tags": [
          "www-rag"
        ],
        "summary": "\"Add to my workspace\" — copy a site's chunks + precomputed embeddings into a new RagVector under one of the caller's OWN whitelabels (Vectorize, no BYOK setup). Frozen snapshot — original stays in the shared directory. Body: { targetWhitelabelId }. See ./copy.ts.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/_admin/register-sites": {
      "post": {
        "operationId": "postWwwRagAdminRegisterSites",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/_admin/register-sites  { sites: [{host, vectorId}] } Platform-admin backfill: register host→vectorId for bulk-published vectors so host-scoped page-context retrieval can resolve their per-site turso vectors.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/_admin/capture-logo": {
      "post": {
        "operationId": "postWwwRagAdminCaptureLogo",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/_admin/capture-logo  { host | hosts[], force? } Re-host a site's favicon on our R2 and attach it to the directory card AND the release's chat avatar. Admin-gated because it makes the server fetch a third-party origin. The crawler fleet uses the HMAC twin at /api/v1/www-rag-webhook/capture-logo; both call one implementation.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/_admin/register-products": {
      "post": {
        "operationId": "postWwwRagAdminRegisterProducts",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/_admin/register-products  { whitelabelId, rootUrl, ragVectorId?, products: [...] } Local-inject: create/update a site's release product catalog from the local www-rag-router crawl's products.json sidecar. Platform-admin only.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/_admin/migrate-site": {
      "post": {
        "operationId": "postWwwRagAdminMigrateSite",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/_admin/migrate-site  { hosts: string[] } Platform-admin: give unclaimed sites their own dedicated whitelabel instead of sharing the shared WWW-RAG one. Resumable (no-op for already-migrated hosts). See ./migrate-site.ts.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/www-rag/_admin/revert-vector": {
      "post": {
        "operationId": "postWwwRagAdminRevertVector",
        "tags": [
          "www-rag"
        ],
        "summary": "POST /api/v1/www-rag/_admin/revert-vector  { whitelabelId, fromVectorId, toVectorId } Platform-admin escape hatch: manually repoint a release's ragIndexes back to a previously-live vector (e.g. after a bad/partial swapOnSuccess). See ./revert-vector.ts.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        },
        "requestBody": {
          "required": true,
          "x-schema-source": "jsonBody",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/onboarding/scan-website": {
      "post": {
        "operationId": "postOnboardingScanWebsite",
        "tags": [
          "onboarding"
        ],
        "summary": "POST /api/v1/onboarding/scan-website",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/scan-website/{jobId}": {
      "get": {
        "operationId": "getOnboardingScanWebsiteByJobId",
        "tags": [
          "onboarding"
        ],
        "summary": "GET /api/v1/onboarding/scan-website/:jobId",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/_admin/block": {
      "post": {
        "operationId": "postOnboardingAdminBlock",
        "tags": [
          "onboarding"
        ],
        "summary": "Admin block-list CRUD — \"we reserve the right not to scan certain sites\". Same requirePlatformAdmin gating as the other WWW-RAG `_admin/*` routes.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/_admin/block/{host}": {
      "delete": {
        "operationId": "deleteOnboardingAdminBlockByHost",
        "tags": [
          "onboarding"
        ],
        "summary": "DELETE /api/v1/onboarding/_admin/block/:host",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/upload-files/stage": {
      "post": {
        "operationId": "postOnboardingUploadFilesStage",
        "tags": [
          "onboarding"
        ],
        "summary": "Anonymous staging for the divinci.app landing page. IP rate limited on top of Turnstile: 12 staging batches per 15 min per IP, then a 15 min block.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/upload-files/claim": {
      "post": {
        "operationId": "postOnboardingUploadFilesClaim",
        "tags": [
          "onboarding"
        ],
        "summary": "POST /api/v1/onboarding/upload-files/claim",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/upload-files/presign": {
      "post": {
        "operationId": "postOnboardingUploadFilesPresign",
        "tags": [
          "onboarding"
        ],
        "summary": "POST /api/v1/onboarding/upload-files/presign",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/onboarding/upload-files": {
      "post": {
        "operationId": "postOnboardingUploadFiles",
        "tags": [
          "onboarding"
        ],
        "summary": "POST /api/v1/onboarding/upload-files",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/local-sync/{whitelabelId}/init": {
      "post": {
        "operationId": "postLocalSyncByWhitelabelIdInit",
        "tags": [
          "local-sync"
        ],
        "summary": "POST /api/v1/local-sync/:whitelabelId/init",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "whitelabelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/local-sync/{whitelabelId}/batch": {
      "post": {
        "operationId": "postLocalSyncByWhitelabelIdBatch",
        "tags": [
          "local-sync"
        ],
        "summary": "POST /api/v1/local-sync/:whitelabelId/batch",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "whitelabelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/local-sync/{whitelabelId}/finalize": {
      "post": {
        "operationId": "postLocalSyncByWhitelabelIdFinalize",
        "tags": [
          "local-sync"
        ],
        "summary": "POST /api/v1/local-sync/:whitelabelId/finalize",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "whitelabelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/local-sync/{whitelabelId}/group": {
      "post": {
        "operationId": "postLocalSyncByWhitelabelIdGroup",
        "tags": [
          "local-sync"
        ],
        "summary": "POST /api/v1/local-sync/:whitelabelId/group",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "whitelabelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/admin/rate-limit-requests": {
      "get": {
        "operationId": "getAdminRateLimitRequests",
        "tags": [
          "admin/rate-limit-requests"
        ],
        "summary": "GET /api/v1/admin/rate-limit-requests",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/admin/rate-limit-requests/{id}": {
      "patch": {
        "operationId": "patchAdminRateLimitRequestsById",
        "tags": [
          "admin/rate-limit-requests"
        ],
        "summary": "PATCH /api/v1/admin/rate-limit-requests/:id",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    },
    "/api/v1/users/me/slack-link": {
      "get": {
        "operationId": "getUsersMeSlackLink",
        "tags": [
          "users/me/slack-link"
        ],
        "summary": "GET /api/v1/users/me/slack-link",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "post": {
        "operationId": "postUsersMeSlackLink",
        "tags": [
          "users/me/slack-link"
        ],
        "summary": "POST /api/v1/users/me/slack-link",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      },
      "delete": {
        "operationId": "deleteUsersMeSlackLink",
        "tags": [
          "users/me/slack-link"
        ],
        "summary": "DELETE /api/v1/users/me/slack-link",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          }
        }
      }
    }
  }
}
