{
  "openapi": "3.0.3",
  "info": {
    "title": "4C:me Safe AI Platform — API Reference",
    "description": "REST API of the platform API forwarder. Authenticate with a personal API key in the `X-Api-Key` header (create keys under Settings → API Keys, or via the API Key Management endpoints below using an Azure AD bearer token). Every operation lists its required key scope.",
    "version": "2026-08-25"
  },
  "servers": [
    {
      "url": "https://api-forwarder-4cme.ashypond-98ad6468.germanywestcentral.azurecontainerapps.io"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Chat (divi)"
    },
    {
      "name": "Chat History"
    },
    {
      "name": "Agents & Knowledge Bases"
    },
    {
      "name": "Agent Search & Knowledge Graph"
    },
    {
      "name": "Speech to Text"
    },
    {
      "name": "Microsoft Graph Files"
    },
    {
      "name": "API Key Management"
    }
  ],
  "paths": {
    "/chat/messages": {
      "post": {
        "summary": "Create a new chat message",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId",
                  "userId",
                  "modelId",
                  "role",
                  "prompt"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string"
                  },
                  "userId": {
                    "type": "string"
                  },
                  "modelId": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "file"
                          ]
                        },
                        "content": {
                          "type": "string"
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mimeType": {
                          "type": "string"
                        },
                        "sender": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ],
                          "default": "user"
                        },
                        "size": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "ragDocuments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "originalFileName",
                        "displayFileName",
                        "downloadUrl",
                        "snippet"
                      ],
                      "properties": {
                        "originalFileName": {
                          "type": "string"
                        },
                        "displayFileName": {
                          "type": "string"
                        },
                        "score": {
                          "type": "number"
                        },
                        "downloadUrl": {
                          "type": "string"
                        },
                        "snippet": {
                          "type": "string"
                        },
                        "sharePointWebUrl": {
                          "type": "string"
                        },
                        "sourceType": {
                          "type": "string",
                          "enum": [
                            "rag",
                            "uploaded"
                          ]
                        },
                        "documentId": {
                          "type": "string"
                        },
                        "fileId": {
                          "type": "string"
                        },
                        "evidenceText": {
                          "type": "string"
                        },
                        "chunkIndex": {
                          "type": "number"
                        },
                        "startChar": {
                          "type": "number"
                        },
                        "endChar": {
                          "type": "number"
                        },
                        "startLine": {
                          "type": "number"
                        },
                        "endLine": {
                          "type": "number"
                        },
                        "blobExtractedTextPath": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "historyTruncated": {
                    "type": "boolean"
                  },
                  "historyCompacted": {
                    "type": "boolean"
                  },
                  "droppedMessageCount": {
                    "type": "number"
                  },
                  "contextUsage": {
                    "type": "object",
                    "properties": {
                      "modelTokenLimit": {
                        "type": "number"
                      },
                      "reservedCompletionTokens": {
                        "type": "number"
                      },
                      "usableInputTokens": {
                        "type": "number"
                      },
                      "inputTokens": {
                        "type": "number"
                      },
                      "availableInputTokens": {
                        "type": "number"
                      },
                      "overflowTokens": {
                        "type": "number"
                      },
                      "inputUtilizationPercentage": {
                        "type": "number"
                      },
                      "isOverflow": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New message added",
            "content": {
              "application/json": {
                "schema": {
                  "description": "New message added",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "modelId": {
                      "type": "string"
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "response": {
                      "type": "string"
                    },
                    "historyTruncated": {
                      "type": "boolean"
                    },
                    "historyCompacted": {
                      "type": "boolean"
                    },
                    "droppedMessageCount": {
                      "type": "number"
                    },
                    "contextUsage": {
                      "type": "object",
                      "properties": {
                        "modelTokenLimit": {
                          "type": "number"
                        },
                        "reservedCompletionTokens": {
                          "type": "number"
                        },
                        "usableInputTokens": {
                          "type": "number"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "availableInputTokens": {
                          "type": "number"
                        },
                        "overflowTokens": {
                          "type": "number"
                        },
                        "inputUtilizationPercentage": {
                          "type": "number"
                        },
                        "isOverflow": {
                          "type": "boolean"
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "image",
                              "file"
                            ]
                          },
                          "content": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sender": {
                            "type": "string",
                            "enum": [
                              "user",
                              "assistant"
                            ]
                          },
                          "size": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/messages/generate-title": {
      "post": {
        "summary": "Generate a concise title for a conversation history",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "history"
                ],
                "properties": {
                  "history": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/messages/conversation-title/{conversationId}": {
      "get": {
        "summary": "Get the current title for a conversation",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/conversations/{conversationId}/messages/latest-assistant/rag-documents": {
      "put": {
        "summary": "Update latest assistant message with RAG documents",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ragDocuments"
                ],
                "properties": {
                  "ragDocuments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "originalFileName",
                        "displayFileName",
                        "downloadUrl",
                        "snippet"
                      ],
                      "properties": {
                        "originalFileName": {
                          "type": "string"
                        },
                        "displayFileName": {
                          "type": "string"
                        },
                        "score": {
                          "type": "number"
                        },
                        "downloadUrl": {
                          "type": "string"
                        },
                        "snippet": {
                          "type": "string"
                        },
                        "sharePointWebUrl": {
                          "type": "string"
                        },
                        "sourceType": {
                          "type": "string",
                          "enum": [
                            "rag",
                            "uploaded"
                          ]
                        },
                        "documentId": {
                          "type": "string"
                        },
                        "fileId": {
                          "type": "string"
                        },
                        "evidenceText": {
                          "type": "string"
                        },
                        "chunkIndex": {
                          "type": "number"
                        },
                        "startChar": {
                          "type": "number"
                        },
                        "endChar": {
                          "type": "number"
                        },
                        "startLine": {
                          "type": "number"
                        },
                        "endLine": {
                          "type": "number"
                        },
                        "blobExtractedTextPath": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Message updated with RAG documents",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Message updated with RAG documents",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "modelId": {
                      "type": "string"
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "response": {
                      "type": "string"
                    },
                    "ragDocuments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "originalFileName",
                          "displayFileName",
                          "downloadUrl",
                          "snippet"
                        ],
                        "properties": {
                          "originalFileName": {
                            "type": "string"
                          },
                          "displayFileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "downloadUrl": {
                            "type": "string"
                          },
                          "snippet": {
                            "type": "string"
                          },
                          "sharePointWebUrl": {
                            "type": "string"
                          },
                          "sourceType": {
                            "type": "string",
                            "enum": [
                              "rag",
                              "uploaded"
                            ]
                          },
                          "documentId": {
                            "type": "string"
                          },
                          "fileId": {
                            "type": "string"
                          },
                          "evidenceText": {
                            "type": "string"
                          },
                          "chunkIndex": {
                            "type": "number"
                          },
                          "startChar": {
                            "type": "number"
                          },
                          "endChar": {
                            "type": "number"
                          },
                          "startLine": {
                            "type": "number"
                          },
                          "endLine": {
                            "type": "number"
                          },
                          "blobExtractedTextPath": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/completions": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "template_content": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "sourceUrl": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "fileName",
                          "content"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "max_tokens": {
                    "type": "number",
                    "minimum": 1
                  },
                  "stop": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "top_p": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "frequency_penalty": {
                    "type": "number",
                    "minimum": -2,
                    "maximum": 2
                  },
                  "presence_penalty": {
                    "type": "number",
                    "minimum": -2,
                    "maximum": 2
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "custom_params": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "history": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "message"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "timestamp": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "conversation_id": {
                    "type": "string"
                  },
                  "user_id": {
                    "type": "string"
                  },
                  "system_message": {
                    "type": "string"
                  },
                  "agent_id": {
                    "type": "string"
                  },
                  "response_mode": {
                    "type": "string",
                    "enum": [
                      "stream",
                      "complete"
                    ]
                  },
                  "mcp": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "servers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "qlik-http",
                            "outlook-mcp",
                            "environment"
                          ]
                        }
                      },
                      "clientServers": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "url"
                          ],
                          "properties": {
                            "serverId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "headers": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "timeout": {
                              "type": "number"
                            },
                            "description": {
                              "type": "string"
                            },
                            "expired": {
                              "type": "boolean"
                            },
                            "notifyByEmail": {
                              "type": "boolean"
                            },
                            "disabledTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "auto_tool_use": {
                        "type": "boolean"
                      },
                      "deepResearchBySteps": {
                        "type": "boolean"
                      },
                      "tool_choice": {
                        "oneOf": [
                          {
                            "type": "string",
                            "enum": [
                              "auto",
                              "none"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "tool"
                                ]
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "name"
                            ]
                          }
                        ]
                      },
                      "server_overrides": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "stdio",
                                "http"
                              ]
                            },
                            "url": {
                              "type": "string"
                            },
                            "timeout": {
                              "type": "number"
                            },
                            "headers": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "command": {
                              "type": "string"
                            },
                            "args": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "env": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "created": {
                      "type": "number"
                    },
                    "model": {
                      "type": "string"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string"
                          },
                          "index": {
                            "type": "number"
                          },
                          "finish_reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "completion": {
                      "type": "string"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "conversation_id": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "string"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "number"
                        },
                        "completion_tokens": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "type": "number"
                        }
                      }
                    },
                    "request_usage": {
                      "type": "object",
                      "properties": {
                        "requestId": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "outputTokens": {
                          "type": "number"
                        },
                        "totalTokens": {
                          "type": "number"
                        },
                        "cachedInputTokens": {
                          "type": "number"
                        },
                        "reasoningTokens": {
                          "type": "number"
                        },
                        "calculatedCostMicros": {
                          "type": "number"
                        },
                        "completedCalls": {
                          "type": "number"
                        },
                        "unavailableUsageCalls": {
                          "type": "number"
                        },
                        "unavailableCostCalls": {
                          "type": "number"
                        },
                        "costsHidden": {
                          "type": "boolean"
                        }
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "role": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "appliedSkills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skillId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "alwaysApply": {
                            "type": "boolean"
                          },
                          "userInvocable": {
                            "type": "boolean"
                          },
                          "disableModelInvocation": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).\n\nSupports streaming: send `Accept: text/event-stream` (or `X-Stream-Type`) to receive server-sent events.",
        "x-streaming": {
          "header": "Accept: text/event-stream"
        }
      }
    },
    "/chat/completions/multipart": {
      "post": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/outlook/chat/completions": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "additionalProperties": false,
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "default"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "role"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {},
                        "name": {
                          "type": "string"
                        },
                        "tool_call_id": {
                          "type": "string"
                        },
                        "tool_calls": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "tool_choice": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "auto",
                          "none"
                        ]
                      },
                      {
                        "type": "object"
                      }
                    ]
                  },
                  "parallel_tool_calls": {
                    "type": "boolean"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "stream_options": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "max_completion_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "top_p": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "frequency_penalty": {
                    "type": "number",
                    "minimum": -2,
                    "maximum": 2
                  },
                  "presence_penalty": {
                    "type": "number",
                    "minimum": -2,
                    "maximum": 2
                  },
                  "stop": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "user": {
                    "type": "string",
                    "maxLength": 256
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/models": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "chat",
                "image"
              ],
              "default": "chat"
            },
            "in": "query",
            "name": "type",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the model"
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name of the model"
                          },
                          "displayName": {
                            "type": "string",
                            "description": "Configured display name of the model"
                          },
                          "nickname": {
                            "type": "string",
                            "description": "Optional nickname shown in the model picker"
                          },
                          "showInPrimaryDropdown": {
                            "type": "boolean",
                            "description": "Whether the model is shown in the primary model dropdown section"
                          },
                          "order": {
                            "type": "number",
                            "description": "Display order of the model"
                          },
                          "hidden": {
                            "type": "boolean",
                            "description": "Whether the model is hidden behind a cheat code"
                          },
                          "defaultReasoningEffort": {
                            "type": "string",
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ],
                            "description": "Default reasoning effort for this model"
                          },
                          "provider": {
                            "type": "string",
                            "description": "The provider of the model (e.g., azure-openai, azure-mistral)"
                          },
                          "maxtokens": {
                            "type": "number",
                            "description": "Maximum number of tokens the model can handle"
                          },
                          "capabilities": {
                            "type": "object",
                            "properties": {
                              "streaming": {
                                "type": "boolean",
                                "description": "Whether the model supports streaming responses"
                              },
                              "reasoning": {
                                "type": "boolean",
                                "description": "Whether the model has reasoning capabilities"
                              }
                            },
                            "additionalProperties": true
                          },
                          "parameters": {
                            "type": "object",
                            "description": "Model-specific parameters and configuration",
                            "additionalProperties": true
                          },
                          "variants": {
                            "type": "array",
                            "description": "Optional variants for this model, each with parameter overrides",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "reasoningEffort": {
                                  "type": "string",
                                  "enum": [
                                    "low",
                                    "medium",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "provider"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "object": {
                      "type": "string",
                      "enum": [
                        "list"
                      ],
                      "description": "Object type identifier"
                    },
                    "count": {
                      "type": "number",
                      "description": "Number of models in the list"
                    },
                    "default_model": {
                      "type": "string",
                      "description": "Default model identifier"
                    },
                    "utility_model": {
                      "type": "string",
                      "description": "Utility model identifier for background tasks"
                    }
                  },
                  "required": [
                    "data",
                    "object",
                    "count",
                    "default_model"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/system-message": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/personnel-system-message": {
      "get": {
        "summary": "Get personnel system message by user ID",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Retrieve the personnel system message for a specific user\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": true,
            "description": "The unique identifier of the user"
          }
        ],
        "responses": {
          "200": {
            "description": "Personnel system message retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Personnel system message retrieved successfully",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "nullable": true,
                      "description": "The personnel system message or null if not found"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid user ID",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - Invalid user ID",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      },
      "post": {
        "summary": "Create a new personnel system message",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Create a new personnel system message for a specific user\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "message"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "The unique identifier of the user",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "description": "The personnel system message content",
                    "minLength": 1,
                    "maxLength": 100000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Personnel system message created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Personnel system message created successfully",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - Invalid input data",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      },
      "put": {
        "summary": "Update an existing personnel system message",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Update the personnel system message for a specific user\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "message"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "The unique identifier of the user",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "description": "The updated personnel system message content",
                    "minLength": 1,
                    "maxLength": 100000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Personnel system message updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Personnel system message updated successfully",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - Invalid input data",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Personnel system message not found",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Personnel system message not found",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      },
      "delete": {
        "summary": "Delete a personnel system message",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Deactivate the personnel system message for a specific user\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": true,
            "description": "The unique identifier of the user"
          }
        ],
        "responses": {
          "200": {
            "description": "Personnel system message deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Personnel system message deleted successfully",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid user ID",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - Invalid user ID",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/upload/image": {
      "post": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Upload an image to blob storage\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "url": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "mimetype": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "userId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/upload/image/download": {
      "get": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Download an image via backend proxy\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "url",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "filename",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/generate/image": {
      "post": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Generate images from text prompts or edit existing images using Azure OpenAI GPT-image-1\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Text prompt for image generation or editing instructions for input image"
                  },
                  "model": {
                    "type": "string",
                    "description": "Model to use for generation"
                  },
                  "size": {
                    "type": "string",
                    "enum": [
                      "1024x1024",
                      "1024x1536",
                      "1536x1024"
                    ],
                    "default": "1024x1024",
                    "description": "Image size"
                  },
                  "quality": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "default": "high",
                    "description": "Image quality"
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 1,
                    "description": "Number of images to generate"
                  },
                  "user": {
                    "type": "string",
                    "description": "Unique identifier for the user"
                  },
                  "conversation_id": {
                    "type": "string",
                    "maxLength": 256,
                    "description": "Conversation to associate with the generated image usage"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "generate",
                      "edit"
                    ],
                    "default": "auto",
                    "description": "Whether this is a new image or an edit"
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg"
                    ],
                    "default": "png",
                    "description": "Output image format"
                  },
                  "output_compression": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "default": 100,
                    "description": "Output compression level"
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enable streaming responses"
                  },
                  "partial_images": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "description": "Number of partial images for streaming"
                  },
                  "image": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "minItems": 1,
                        "maxItems": 16
                      }
                    ],
                    "description": "Image URL or base64 encoded image data for editing operations. Provide an array to edit or combine multiple images."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "number"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "b64_json": {
                            "type": "string"
                          },
                          "revised_prompt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/prompt-enhancer/enhance": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "original_prompt"
                ],
                "properties": {
                  "original_prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "description": "The original prompt to be enhanced"
                  },
                  "model": {
                    "type": "string",
                    "description": "Deprecated. The configured utility model is used instead."
                  },
                  "skills": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "boolean"
                    }
                  },
                  "language_output": {
                    "type": "string",
                    "enum": [
                      "same",
                      "english"
                    ],
                    "default": "same",
                    "description": "Output language preference"
                  },
                  "simplified_mode": {
                    "type": "boolean",
                    "default": false,
                    "description": "Use simplified mode to save processing time and tokens"
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.7
                  },
                  "max_tokens": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 4000,
                    "default": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "enhanced_prompt": {
                          "type": "string",
                          "description": "The enhanced version of the original prompt"
                        },
                        "original_prompt": {
                          "type": "string",
                          "description": "The original prompt that was enhanced"
                        },
                        "applied_skills": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "List of skills that were applied"
                        },
                        "enhancement_steps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "step_number": {
                                "type": "number"
                              },
                              "skill_name": {
                                "type": "string"
                              },
                              "skill_description": {
                                "type": "string"
                              },
                              "enhanced_prompt": {
                                "type": "string"
                              }
                            }
                          },
                          "description": "Step-by-step enhancement process (only in non-simplified mode)"
                        },
                        "model_used": {
                          "type": "string",
                          "description": "The AI model that was used for enhancement"
                        },
                        "processing_time_ms": {
                          "type": "number",
                          "description": "Processing time in milliseconds"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/prompt-enhancer/basic-enhance": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "original_prompt"
                ],
                "properties": {
                  "original_prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000,
                    "description": "The original prompt to be enhanced"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "enhanced_prompt": {
                          "type": "string",
                          "description": "The enhanced version of the original prompt"
                        },
                        "original_prompt": {
                          "type": "string",
                          "description": "The original prompt that was enhanced"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/prompt-enhancer/skills": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/prompt-enhancer/health": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "capabilities": {
                      "type": "object",
                      "properties": {
                        "skills_available": {
                          "type": "number"
                        },
                        "modes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "languages": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "research_based_on": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/templates": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "templateId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "example": {
                            "type": "string"
                          },
                          "icon": {
                            "type": "string"
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "private",
                              "userGroup"
                            ]
                          },
                          "userGroupIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "attachmentId": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                },
                                "mimeType": {
                                  "type": "string"
                                },
                                "sizeBytes": {
                                  "type": "number"
                                },
                                "uploadedAt": {
                                  "type": "string",
                                  "format": "date-time"
                                }
                              }
                            }
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "post": {
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "example": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string"
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "attachmentId": {
                                "type": "string"
                              },
                              "filename": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "uploadedAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/templates/{templateId}": {
      "put": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "templateId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "example": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string"
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "attachmentId": {
                                "type": "string"
                              },
                              "filename": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "uploadedAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "templateId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/templates/{templateId}/attachments/{attachmentId}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "templateId",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "attachmentId",
            "required": true
          }
        ],
        "responses": {
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/skills": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skillId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "rawSkillMd": {
                            "type": "string"
                          },
                          "alwaysApply": {
                            "type": "boolean"
                          },
                          "invocationMode": {
                            "type": "string",
                            "enum": [
                              "automatic",
                              "onRequest",
                              "alwaysOn"
                            ]
                          },
                          "userInvocable": {
                            "type": "boolean"
                          },
                          "disableModelInvocation": {
                            "type": "boolean"
                          },
                          "allowedTools": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "private",
                              "userGroup"
                            ]
                          },
                          "userGroupIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "defaultActive": {
                            "type": "boolean"
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "hasUserOverride": {
                            "type": "boolean"
                          },
                          "bundleFiles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "mimeType": {
                                  "type": "string"
                                },
                                "sizeBytes": {
                                  "type": "number"
                                },
                                "storageUrl": {
                                  "type": "string"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "manual",
                              "import-md",
                              "import-zip",
                              "import-skill"
                            ]
                          },
                          "referenceFileCount": {
                            "type": "number"
                          },
                          "indexedReferenceChunkCount": {
                            "type": "number"
                          },
                          "lastIndexedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "indexStatus": {
                            "type": "string",
                            "enum": [
                              "notIndexed",
                              "pending",
                              "ready",
                              "failed"
                            ]
                          },
                          "indexError": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "isOwnedByCurrentUser": {
                            "type": "boolean"
                          },
                          "canEdit": {
                            "type": "boolean"
                          },
                          "canDelete": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "displayName",
                  "description",
                  "body"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "alwaysApply": {
                    "type": "boolean"
                  },
                  "invocationMode": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "onRequest",
                      "alwaysOn"
                    ]
                  },
                  "userInvocable": {
                    "type": "boolean"
                  },
                  "disableModelInvocation": {
                    "type": "boolean"
                  },
                  "allowedTools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "userGroup"
                    ]
                  },
                  "userGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultActive": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "rawSkillMd": {
                          "type": "string"
                        },
                        "alwaysApply": {
                          "type": "boolean"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "userInvocable": {
                          "type": "boolean"
                        },
                        "disableModelInvocation": {
                          "type": "boolean"
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "defaultActive": {
                          "type": "boolean"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasUserOverride": {
                          "type": "boolean"
                        },
                        "bundleFiles": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "storageUrl": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import-md",
                            "import-zip",
                            "import-skill"
                          ]
                        },
                        "referenceFileCount": {
                          "type": "number"
                        },
                        "indexedReferenceChunkCount": {
                          "type": "number"
                        },
                        "lastIndexedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "indexStatus": {
                          "type": "string",
                          "enum": [
                            "notIndexed",
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "indexError": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "isOwnedByCurrentUser": {
                          "type": "boolean"
                        },
                        "canEdit": {
                          "type": "boolean"
                        },
                        "canDelete": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/skills/{skillId}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "skillId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "rawSkillMd": {
                          "type": "string"
                        },
                        "alwaysApply": {
                          "type": "boolean"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "userInvocable": {
                          "type": "boolean"
                        },
                        "disableModelInvocation": {
                          "type": "boolean"
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "defaultActive": {
                          "type": "boolean"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasUserOverride": {
                          "type": "boolean"
                        },
                        "bundleFiles": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "storageUrl": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import-md",
                            "import-zip",
                            "import-skill"
                          ]
                        },
                        "referenceFileCount": {
                          "type": "number"
                        },
                        "indexedReferenceChunkCount": {
                          "type": "number"
                        },
                        "lastIndexedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "indexStatus": {
                          "type": "string",
                          "enum": [
                            "notIndexed",
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "indexError": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "isOwnedByCurrentUser": {
                          "type": "boolean"
                        },
                        "canEdit": {
                          "type": "boolean"
                        },
                        "canDelete": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string",
                    "minLength": 1
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1
                  },
                  "alwaysApply": {
                    "type": "boolean"
                  },
                  "invocationMode": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "onRequest",
                      "alwaysOn"
                    ]
                  },
                  "userInvocable": {
                    "type": "boolean"
                  },
                  "disableModelInvocation": {
                    "type": "boolean"
                  },
                  "allowedTools": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "userGroup"
                    ]
                  },
                  "userGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultActive": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "skillId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "rawSkillMd": {
                          "type": "string"
                        },
                        "alwaysApply": {
                          "type": "boolean"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "userInvocable": {
                          "type": "boolean"
                        },
                        "disableModelInvocation": {
                          "type": "boolean"
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "defaultActive": {
                          "type": "boolean"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasUserOverride": {
                          "type": "boolean"
                        },
                        "bundleFiles": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "storageUrl": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import-md",
                            "import-zip",
                            "import-skill"
                          ]
                        },
                        "referenceFileCount": {
                          "type": "number"
                        },
                        "indexedReferenceChunkCount": {
                          "type": "number"
                        },
                        "lastIndexedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "indexStatus": {
                          "type": "string",
                          "enum": [
                            "notIndexed",
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "indexError": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "isOwnedByCurrentUser": {
                          "type": "boolean"
                        },
                        "canEdit": {
                          "type": "boolean"
                        },
                        "canDelete": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "skillId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/skills/import": {
      "post": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "create",
                "replace"
              ]
            },
            "in": "query",
            "name": "mode",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "targetSkillId",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "skillId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            },
                            "rawSkillMd": {
                              "type": "string"
                            },
                            "alwaysApply": {
                              "type": "boolean"
                            },
                            "invocationMode": {
                              "type": "string",
                              "enum": [
                                "automatic",
                                "onRequest",
                                "alwaysOn"
                              ]
                            },
                            "userInvocable": {
                              "type": "boolean"
                            },
                            "disableModelInvocation": {
                              "type": "boolean"
                            },
                            "allowedTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "public",
                                "private",
                                "userGroup"
                              ]
                            },
                            "userGroupIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "defaultActive": {
                              "type": "boolean"
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "hasUserOverride": {
                              "type": "boolean"
                            },
                            "bundleFiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "sizeBytes": {
                                    "type": "number"
                                  },
                                  "storageUrl": {
                                    "type": "string"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "import-md",
                                "import-zip",
                                "import-skill"
                              ]
                            },
                            "referenceFileCount": {
                              "type": "number"
                            },
                            "indexedReferenceChunkCount": {
                              "type": "number"
                            },
                            "lastIndexedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "indexStatus": {
                              "type": "string",
                              "enum": [
                                "notIndexed",
                                "pending",
                                "ready",
                                "failed"
                              ]
                            },
                            "indexError": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "isOwnedByCurrentUser": {
                              "type": "boolean"
                            },
                            "canEdit": {
                              "type": "boolean"
                            },
                            "canDelete": {
                              "type": "boolean"
                            }
                          }
                        },
                        "replaced": {
                          "type": "boolean"
                        },
                        "importedFileCount": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "skillId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            },
                            "rawSkillMd": {
                              "type": "string"
                            },
                            "alwaysApply": {
                              "type": "boolean"
                            },
                            "invocationMode": {
                              "type": "string",
                              "enum": [
                                "automatic",
                                "onRequest",
                                "alwaysOn"
                              ]
                            },
                            "userInvocable": {
                              "type": "boolean"
                            },
                            "disableModelInvocation": {
                              "type": "boolean"
                            },
                            "allowedTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "public",
                                "private",
                                "userGroup"
                              ]
                            },
                            "userGroupIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "defaultActive": {
                              "type": "boolean"
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "hasUserOverride": {
                              "type": "boolean"
                            },
                            "bundleFiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "sizeBytes": {
                                    "type": "number"
                                  },
                                  "storageUrl": {
                                    "type": "string"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "import-md",
                                "import-zip",
                                "import-skill"
                              ]
                            },
                            "referenceFileCount": {
                              "type": "number"
                            },
                            "indexedReferenceChunkCount": {
                              "type": "number"
                            },
                            "lastIndexedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "indexStatus": {
                              "type": "string",
                              "enum": [
                                "notIndexed",
                                "pending",
                                "ready",
                                "failed"
                              ]
                            },
                            "indexError": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "isOwnedByCurrentUser": {
                              "type": "boolean"
                            },
                            "canEdit": {
                              "type": "boolean"
                            },
                            "canDelete": {
                              "type": "boolean"
                            }
                          }
                        },
                        "replaced": {
                          "type": "boolean"
                        },
                        "importedFileCount": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/skills/import/github": {
      "post": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "githubUrl"
                ],
                "properties": {
                  "githubUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "skillPath": {
                    "type": "string"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "userGroup"
                    ]
                  },
                  "userGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "invocationMode": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "onRequest",
                      "alwaysOn"
                    ]
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "create",
                "replace"
              ]
            },
            "in": "query",
            "name": "mode",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "targetSkillId",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "skillId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            },
                            "rawSkillMd": {
                              "type": "string"
                            },
                            "alwaysApply": {
                              "type": "boolean"
                            },
                            "invocationMode": {
                              "type": "string",
                              "enum": [
                                "automatic",
                                "onRequest",
                                "alwaysOn"
                              ]
                            },
                            "userInvocable": {
                              "type": "boolean"
                            },
                            "disableModelInvocation": {
                              "type": "boolean"
                            },
                            "allowedTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "public",
                                "private",
                                "userGroup"
                              ]
                            },
                            "userGroupIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "defaultActive": {
                              "type": "boolean"
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "hasUserOverride": {
                              "type": "boolean"
                            },
                            "bundleFiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "sizeBytes": {
                                    "type": "number"
                                  },
                                  "storageUrl": {
                                    "type": "string"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "import-md",
                                "import-zip",
                                "import-skill"
                              ]
                            },
                            "referenceFileCount": {
                              "type": "number"
                            },
                            "indexedReferenceChunkCount": {
                              "type": "number"
                            },
                            "lastIndexedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "indexStatus": {
                              "type": "string",
                              "enum": [
                                "notIndexed",
                                "pending",
                                "ready",
                                "failed"
                              ]
                            },
                            "indexError": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "isOwnedByCurrentUser": {
                              "type": "boolean"
                            },
                            "canEdit": {
                              "type": "boolean"
                            },
                            "canDelete": {
                              "type": "boolean"
                            }
                          }
                        },
                        "replaced": {
                          "type": "boolean"
                        },
                        "importedFileCount": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skill": {
                          "type": "object",
                          "properties": {
                            "skillId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            },
                            "rawSkillMd": {
                              "type": "string"
                            },
                            "alwaysApply": {
                              "type": "boolean"
                            },
                            "invocationMode": {
                              "type": "string",
                              "enum": [
                                "automatic",
                                "onRequest",
                                "alwaysOn"
                              ]
                            },
                            "userInvocable": {
                              "type": "boolean"
                            },
                            "disableModelInvocation": {
                              "type": "boolean"
                            },
                            "allowedTools": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "visibility": {
                              "type": "string",
                              "enum": [
                                "public",
                                "private",
                                "userGroup"
                              ]
                            },
                            "userGroupIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "defaultActive": {
                              "type": "boolean"
                            },
                            "isActive": {
                              "type": "boolean"
                            },
                            "hasUserOverride": {
                              "type": "boolean"
                            },
                            "bundleFiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "mimeType": {
                                    "type": "string"
                                  },
                                  "sizeBytes": {
                                    "type": "number"
                                  },
                                  "storageUrl": {
                                    "type": "string"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "manual",
                                "import-md",
                                "import-zip",
                                "import-skill"
                              ]
                            },
                            "referenceFileCount": {
                              "type": "number"
                            },
                            "indexedReferenceChunkCount": {
                              "type": "number"
                            },
                            "lastIndexedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "indexStatus": {
                              "type": "string",
                              "enum": [
                                "notIndexed",
                                "pending",
                                "ready",
                                "failed"
                              ]
                            },
                            "indexError": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "isOwnedByCurrentUser": {
                              "type": "boolean"
                            },
                            "canEdit": {
                              "type": "boolean"
                            },
                            "canDelete": {
                              "type": "boolean"
                            }
                          }
                        },
                        "replaced": {
                          "type": "boolean"
                        },
                        "importedFileCount": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/skills/{skillId}/preference": {
      "put": {
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "isActive"
                ],
                "properties": {
                  "isActive": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "skillId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "rawSkillMd": {
                          "type": "string"
                        },
                        "alwaysApply": {
                          "type": "boolean"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "userInvocable": {
                          "type": "boolean"
                        },
                        "disableModelInvocation": {
                          "type": "boolean"
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "defaultActive": {
                          "type": "boolean"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasUserOverride": {
                          "type": "boolean"
                        },
                        "bundleFiles": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "storageUrl": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import-md",
                            "import-zip",
                            "import-skill"
                          ]
                        },
                        "referenceFileCount": {
                          "type": "number"
                        },
                        "indexedReferenceChunkCount": {
                          "type": "number"
                        },
                        "lastIndexedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "indexStatus": {
                          "type": "string",
                          "enum": [
                            "notIndexed",
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "indexError": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "isOwnedByCurrentUser": {
                          "type": "boolean"
                        },
                        "canEdit": {
                          "type": "boolean"
                        },
                        "canDelete": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "skillId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "rawSkillMd": {
                          "type": "string"
                        },
                        "alwaysApply": {
                          "type": "boolean"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "userInvocable": {
                          "type": "boolean"
                        },
                        "disableModelInvocation": {
                          "type": "boolean"
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "private",
                            "userGroup"
                          ]
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "defaultActive": {
                          "type": "boolean"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "hasUserOverride": {
                          "type": "boolean"
                        },
                        "bundleFiles": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "mimeType": {
                                "type": "string"
                              },
                              "sizeBytes": {
                                "type": "number"
                              },
                              "storageUrl": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import-md",
                            "import-zip",
                            "import-skill"
                          ]
                        },
                        "referenceFileCount": {
                          "type": "number"
                        },
                        "indexedReferenceChunkCount": {
                          "type": "number"
                        },
                        "lastIndexedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "indexStatus": {
                          "type": "string",
                          "enum": [
                            "notIndexed",
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "indexError": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "isOwnedByCurrentUser": {
                          "type": "boolean"
                        },
                        "canEdit": {
                          "type": "boolean"
                        },
                        "canDelete": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/scheduled-tasks": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "post": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/scheduled-tasks/{id}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "patch": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/scheduled-tasks/{id}/run-now": {
      "post": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/categories": {
      "get": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Get all categories accessible to the user\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "categoryId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "color": {
                            "type": "string"
                          },
                          "textColor": {
                            "type": "string"
                          },
                          "order": {
                            "type": "number"
                          },
                          "visibility": {
                            "type": "string"
                          },
                          "userGroupIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      },
      "post": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Create a new category\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1
                  },
                  "textColor": {
                    "type": "string"
                  },
                  "order": {
                    "type": "number"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "userGroup"
                    ]
                  },
                  "userGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "name",
                  "color"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "categoryId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "textColor": {
                          "type": "string"
                        },
                        "order": {
                          "type": "number"
                        },
                        "visibility": {
                          "type": "string"
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/categories/{categoryId}": {
      "put": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Update an existing category\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "color": {
                    "type": "string",
                    "minLength": 1
                  },
                  "textColor": {
                    "type": "string"
                  },
                  "order": {
                    "type": "number"
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "private",
                      "userGroup"
                    ]
                  },
                  "userGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "categoryId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "categoryId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "textColor": {
                          "type": "string"
                        },
                        "order": {
                          "type": "number"
                        },
                        "visibility": {
                          "type": "string"
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      },
      "delete": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Delete a category\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "categoryId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/categories/reorder": {
      "post": {
        "tags": [
          "Chat (divi)"
        ],
        "description": "Reorder categories\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "orders": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "categoryId": {
                          "type": "string"
                        },
                        "order": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "categoryId",
                        "order"
                      ]
                    }
                  }
                },
                "required": [
                  "orders"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/user-settings/get": {
      "post": {
        "summary": "Retrieve user settings by ID",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Unique identifier of the user"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "object",
                          "properties": {
                            "sendHotkey": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Keyboard shortcut used to send a message"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "de"
                              ],
                              "description": "Preferred UI language"
                            },
                            "showImageGenerationButton": {
                              "type": "boolean",
                              "description": "Whether to show the image generation button in the UI"
                            },
                            "showMcpButton": {
                              "type": "boolean",
                              "description": "Whether to show the MCP (Model Context Protocol) button in the UI"
                            },
                            "enableMcpByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable MCP (Model Context Protocol) by default"
                            },
                            "showShortTermMemoryButton": {
                              "type": "boolean",
                              "description": "Whether to show the short term memory button in the UI"
                            },
                            "enableShortTermMemoryByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable short term memory by default"
                            }
                          },
                          "additionalProperties": true
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/user-settings": {
      "post": {
        "summary": "Create user settings record",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "settings"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Unique identifier of the user"
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "sendHotkey": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Keyboard shortcut used to send a message"
                      },
                      "language": {
                        "type": "string",
                        "enum": [
                          "en",
                          "de"
                        ],
                        "description": "Preferred UI language"
                      },
                      "showImageGenerationButton": {
                        "type": "boolean",
                        "description": "Whether to show the image generation button in the UI"
                      },
                      "showMcpButton": {
                        "type": "boolean",
                        "description": "Whether to show the MCP (Model Context Protocol) button in the UI"
                      },
                      "enableMcpByDefault": {
                        "type": "boolean",
                        "description": "Whether to enable MCP (Model Context Protocol) by default"
                      },
                      "showShortTermMemoryButton": {
                        "type": "boolean",
                        "description": "Whether to show the short term memory button in the UI"
                      },
                      "enableShortTermMemoryByDefault": {
                        "type": "boolean",
                        "description": "Whether to enable short term memory by default"
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "object",
                          "properties": {
                            "sendHotkey": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Keyboard shortcut used to send a message"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "de"
                              ],
                              "description": "Preferred UI language"
                            },
                            "showImageGenerationButton": {
                              "type": "boolean",
                              "description": "Whether to show the image generation button in the UI"
                            },
                            "showMcpButton": {
                              "type": "boolean",
                              "description": "Whether to show the MCP (Model Context Protocol) button in the UI"
                            },
                            "enableMcpByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable MCP (Model Context Protocol) by default"
                            },
                            "showShortTermMemoryButton": {
                              "type": "boolean",
                              "description": "Whether to show the short term memory button in the UI"
                            },
                            "enableShortTermMemoryByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable short term memory by default"
                            }
                          },
                          "additionalProperties": true
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "summary": "Update existing user settings",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "settings"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Unique identifier of the user"
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "sendHotkey": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Keyboard shortcut used to send a message"
                      },
                      "language": {
                        "type": "string",
                        "enum": [
                          "en",
                          "de"
                        ],
                        "description": "Preferred UI language"
                      },
                      "showImageGenerationButton": {
                        "type": "boolean",
                        "description": "Whether to show the image generation button in the UI"
                      },
                      "showMcpButton": {
                        "type": "boolean",
                        "description": "Whether to show the MCP (Model Context Protocol) button in the UI"
                      },
                      "enableMcpByDefault": {
                        "type": "boolean",
                        "description": "Whether to enable MCP (Model Context Protocol) by default"
                      },
                      "showShortTermMemoryButton": {
                        "type": "boolean",
                        "description": "Whether to show the short term memory button in the UI"
                      },
                      "enableShortTermMemoryByDefault": {
                        "type": "boolean",
                        "description": "Whether to enable short term memory by default"
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "settings": {
                          "type": "object",
                          "properties": {
                            "sendHotkey": {
                              "type": "string",
                              "minLength": 1,
                              "description": "Keyboard shortcut used to send a message"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "de"
                              ],
                              "description": "Preferred UI language"
                            },
                            "showImageGenerationButton": {
                              "type": "boolean",
                              "description": "Whether to show the image generation button in the UI"
                            },
                            "showMcpButton": {
                              "type": "boolean",
                              "description": "Whether to show the MCP (Model Context Protocol) button in the UI"
                            },
                            "enableMcpByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable MCP (Model Context Protocol) by default"
                            },
                            "showShortTermMemoryButton": {
                              "type": "boolean",
                              "description": "Whether to show the short term memory button in the UI"
                            },
                            "enableShortTermMemoryByDefault": {
                              "type": "boolean",
                              "description": "Whether to enable short term memory by default"
                            }
                          },
                          "additionalProperties": true
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "summary": "Delete user settings by user ID",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId"
                ],
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Unique identifier of the user"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/model-settings": {
      "get": {
        "summary": "Retrieve persisted model connection settings",
        "tags": [
          "Chat (divi)"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "defaultModelId": {
                          "type": "string"
                        },
                        "defaultImageModelId": {
                          "type": "string"
                        },
                        "utilityModelId": {
                          "type": "string"
                        },
                        "hideCostsInUserConversations": {
                          "type": "boolean"
                        },
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              },
                              "nickname": {
                                "type": "string"
                              },
                              "visibleInDropdown": {
                                "type": "boolean"
                              },
                              "showInPrimaryDropdown": {
                                "type": "boolean"
                              },
                              "provider": {
                                "type": "string"
                              },
                              "isImageModel": {
                                "type": "boolean"
                              },
                              "capabilities": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "boolean"
                                }
                              },
                              "deploymentName": {
                                "type": "string"
                              },
                              "apiVersion": {
                                "type": "string"
                              },
                              "apiKey": {
                                "type": "string"
                              },
                              "resourceName": {
                                "type": "string"
                              },
                              "endpoint": {
                                "type": "string"
                              },
                              "maxTokens": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "pricing": {
                                "type": "object",
                                "properties": {
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3
                                  },
                                  "inputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "outputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "cachedInputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "unitRates": {
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "meterKind": {
                                          "type": "string",
                                          "enum": [
                                            "images",
                                            "ocr_pages",
                                            "audio_duration"
                                          ]
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 64
                                        },
                                        "operation": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "size": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "quality": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "pricePerUnitMicros": {
                                          "type": "number",
                                          "minimum": 0
                                        }
                                      },
                                      "required": [
                                        "meterKind",
                                        "pricePerUnitMicros"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "version": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "currency",
                                  "version"
                                ],
                                "anyOf": [
                                  {
                                    "required": [
                                      "inputPricePerMillion",
                                      "outputPricePerMillion"
                                    ]
                                  },
                                  {
                                    "required": [
                                      "unitRates"
                                    ]
                                  }
                                ],
                                "additionalProperties": false
                              },
                              "order": {
                                "type": "number"
                              },
                              "deleted": {
                                "type": "boolean"
                              },
                              "hidden": {
                                "type": "boolean"
                              },
                              "defaultReasoningEffort": {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "medium",
                                  "high"
                                ]
                              },
                              "variants": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "reasoningEffort": {
                                      "type": "string",
                                      "enum": [
                                        "low",
                                        "medium",
                                        "high"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "userGroupIds": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "provider",
                              "deploymentName",
                              "apiVersion",
                              "apiKey",
                              "resourceName",
                              "endpoint"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "settingsId",
                        "defaultModelId",
                        "hideCostsInUserConversations",
                        "models",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "summary": "Update persisted model connection settings",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "defaultModelId": {
                    "type": "string"
                  },
                  "defaultImageModelId": {
                    "type": "string"
                  },
                  "utilityModelId": {
                    "type": "string"
                  },
                  "hideCostsInUserConversations": {
                    "type": "boolean"
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "nickname": {
                          "type": "string"
                        },
                        "visibleInDropdown": {
                          "type": "boolean"
                        },
                        "showInPrimaryDropdown": {
                          "type": "boolean"
                        },
                        "deleted": {
                          "type": "boolean"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "isImageModel": {
                          "type": "boolean"
                        },
                        "capabilities": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "boolean"
                          }
                        },
                        "deploymentName": {
                          "type": "string"
                        },
                        "apiVersion": {
                          "type": "string"
                        },
                        "apiKey": {
                          "type": "string"
                        },
                        "resourceName": {
                          "type": "string"
                        },
                        "endpoint": {
                          "type": "string"
                        },
                        "maxTokens": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "pricing": {
                          "type": "object",
                          "properties": {
                            "currency": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 3
                            },
                            "inputPricePerMillion": {
                              "type": "number",
                              "minimum": 0
                            },
                            "outputPricePerMillion": {
                              "type": "number",
                              "minimum": 0
                            },
                            "cachedInputPricePerMillion": {
                              "type": "number",
                              "minimum": 0
                            },
                            "unitRates": {
                              "type": "array",
                              "minItems": 1,
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "meterKind": {
                                    "type": "string",
                                    "enum": [
                                      "images",
                                      "ocr_pages",
                                      "audio_duration"
                                    ]
                                  },
                                  "unit": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64
                                  },
                                  "operation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "size": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 32
                                  },
                                  "quality": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 32
                                  },
                                  "pricePerUnitMicros": {
                                    "type": "number",
                                    "minimum": 0
                                  }
                                },
                                "required": [
                                  "meterKind",
                                  "pricePerUnitMicros"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "version": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "currency"
                          ],
                          "anyOf": [
                            {
                              "required": [
                                "inputPricePerMillion",
                                "outputPricePerMillion"
                              ]
                            },
                            {
                              "required": [
                                "unitRates"
                              ]
                            }
                          ],
                          "additionalProperties": false
                        },
                        "order": {
                          "type": "number"
                        },
                        "hidden": {
                          "type": "boolean"
                        },
                        "defaultReasoningEffort": {
                          "type": "string",
                          "enum": [
                            "low",
                            "medium",
                            "high"
                          ]
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1
                              },
                              "reasoningEffort": {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "medium",
                                  "high"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "userGroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "models"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "defaultModelId": {
                          "type": "string"
                        },
                        "defaultImageModelId": {
                          "type": "string"
                        },
                        "utilityModelId": {
                          "type": "string"
                        },
                        "hideCostsInUserConversations": {
                          "type": "boolean"
                        },
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              },
                              "nickname": {
                                "type": "string"
                              },
                              "visibleInDropdown": {
                                "type": "boolean"
                              },
                              "showInPrimaryDropdown": {
                                "type": "boolean"
                              },
                              "provider": {
                                "type": "string"
                              },
                              "isImageModel": {
                                "type": "boolean"
                              },
                              "capabilities": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "boolean"
                                }
                              },
                              "deploymentName": {
                                "type": "string"
                              },
                              "apiVersion": {
                                "type": "string"
                              },
                              "apiKey": {
                                "type": "string"
                              },
                              "resourceName": {
                                "type": "string"
                              },
                              "endpoint": {
                                "type": "string"
                              },
                              "maxTokens": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "pricing": {
                                "type": "object",
                                "properties": {
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3
                                  },
                                  "inputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "outputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "cachedInputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "unitRates": {
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "meterKind": {
                                          "type": "string",
                                          "enum": [
                                            "images",
                                            "ocr_pages",
                                            "audio_duration"
                                          ]
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 64
                                        },
                                        "operation": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "size": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "quality": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "pricePerUnitMicros": {
                                          "type": "number",
                                          "minimum": 0
                                        }
                                      },
                                      "required": [
                                        "meterKind",
                                        "pricePerUnitMicros"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "version": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "currency",
                                  "version"
                                ],
                                "anyOf": [
                                  {
                                    "required": [
                                      "inputPricePerMillion",
                                      "outputPricePerMillion"
                                    ]
                                  },
                                  {
                                    "required": [
                                      "unitRates"
                                    ]
                                  }
                                ],
                                "additionalProperties": false
                              },
                              "order": {
                                "type": "number"
                              },
                              "deleted": {
                                "type": "boolean"
                              },
                              "hidden": {
                                "type": "boolean"
                              },
                              "defaultReasoningEffort": {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "medium",
                                  "high"
                                ]
                              },
                              "variants": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "reasoningEffort": {
                                      "type": "string",
                                      "enum": [
                                        "low",
                                        "medium",
                                        "high"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "userGroupIds": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "provider",
                              "deploymentName",
                              "apiVersion",
                              "apiKey",
                              "resourceName",
                              "endpoint"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "settingsId",
                        "defaultModelId",
                        "hideCostsInUserConversations",
                        "models",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/model-settings/overall-settings": {
      "put": {
        "summary": "Update global model-related settings",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hideCostsInUserConversations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "hideCostsInUserConversations"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "defaultModelId": {
                          "type": "string"
                        },
                        "defaultImageModelId": {
                          "type": "string"
                        },
                        "utilityModelId": {
                          "type": "string"
                        },
                        "hideCostsInUserConversations": {
                          "type": "boolean"
                        },
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "name": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              },
                              "nickname": {
                                "type": "string"
                              },
                              "visibleInDropdown": {
                                "type": "boolean"
                              },
                              "showInPrimaryDropdown": {
                                "type": "boolean"
                              },
                              "provider": {
                                "type": "string"
                              },
                              "isImageModel": {
                                "type": "boolean"
                              },
                              "capabilities": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "boolean"
                                }
                              },
                              "deploymentName": {
                                "type": "string"
                              },
                              "apiVersion": {
                                "type": "string"
                              },
                              "apiKey": {
                                "type": "string"
                              },
                              "resourceName": {
                                "type": "string"
                              },
                              "endpoint": {
                                "type": "string"
                              },
                              "maxTokens": {
                                "type": "integer",
                                "minimum": 1
                              },
                              "pricing": {
                                "type": "object",
                                "properties": {
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3
                                  },
                                  "inputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "outputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "cachedInputPricePerMillion": {
                                    "type": "number",
                                    "minimum": 0
                                  },
                                  "unitRates": {
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "meterKind": {
                                          "type": "string",
                                          "enum": [
                                            "images",
                                            "ocr_pages",
                                            "audio_duration"
                                          ]
                                        },
                                        "unit": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 64
                                        },
                                        "operation": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 128
                                        },
                                        "size": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "quality": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 32
                                        },
                                        "pricePerUnitMicros": {
                                          "type": "number",
                                          "minimum": 0
                                        }
                                      },
                                      "required": [
                                        "meterKind",
                                        "pricePerUnitMicros"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "version": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "currency",
                                  "version"
                                ],
                                "anyOf": [
                                  {
                                    "required": [
                                      "inputPricePerMillion",
                                      "outputPricePerMillion"
                                    ]
                                  },
                                  {
                                    "required": [
                                      "unitRates"
                                    ]
                                  }
                                ],
                                "additionalProperties": false
                              },
                              "order": {
                                "type": "number"
                              },
                              "deleted": {
                                "type": "boolean"
                              },
                              "hidden": {
                                "type": "boolean"
                              },
                              "defaultReasoningEffort": {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "medium",
                                  "high"
                                ]
                              },
                              "variants": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "name": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "reasoningEffort": {
                                      "type": "string",
                                      "enum": [
                                        "low",
                                        "medium",
                                        "high"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "userGroupIds": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "provider",
                              "deploymentName",
                              "apiVersion",
                              "apiKey",
                              "resourceName",
                              "endpoint"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "settingsId",
                        "defaultModelId",
                        "hideCostsInUserConversations",
                        "models",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/translation-settings": {
      "get": {
        "summary": "Retrieve global translation overrides",
        "tags": [
          "Chat (divi)"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "resources": {
                          "type": "object",
                          "properties": {
                            "en": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "de": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "settingsId",
                        "resources",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "summary": "Update global translation overrides",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resources": {
                    "type": "object",
                    "properties": {
                      "en": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "de": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "resources"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "settingsId": {
                          "type": "string"
                        },
                        "resources": {
                          "type": "object",
                          "properties": {
                            "en": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "de": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "settingsId",
                        "resources",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "data",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/audit-logs/suggestions": {
      "get": {
        "summary": "Retrieve audit log filter suggestions",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "userId",
                "tableName"
              ]
            },
            "in": "query",
            "name": "field",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "q",
            "required": false
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            },
            "in": "query",
            "name": "limit",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "field": {
                          "type": "string",
                          "enum": [
                            "userId",
                            "tableName"
                          ]
                        },
                        "suggestions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "value",
                              "label"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "field",
                        "suggestions"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/audit-logs/export": {
      "get": {
        "summary": "Export audit log entries matching the filters as CSV",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "CREATE",
                "UPDATE",
                "DELETE"
              ]
            },
            "in": "query",
            "name": "operation",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "tableName",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "in": "query",
            "name": "search",
            "required": false
          }
        ],
        "responses": {
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/audit-logs": {
      "get": {
        "summary": "Retrieve audit log entries",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "CREATE",
                "UPDATE",
                "DELETE"
              ]
            },
            "in": "query",
            "name": "operation",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "tableName",
            "required": false
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "in": "query",
            "name": "limit",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "cursor",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "in": "query",
            "name": "search",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "audits": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "userId": {
                                "type": "string"
                              },
                              "userName": {
                                "type": "string"
                              },
                              "operation": {
                                "type": "string",
                                "enum": [
                                  "CREATE",
                                  "UPDATE",
                                  "DELETE"
                                ]
                              },
                              "tableName": {
                                "type": "string"
                              },
                              "previousValue": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "additionalProperties": true
                                  },
                                  {
                                    "type": "array",
                                    "items": {}
                                  }
                                ],
                                "nullable": true
                              },
                              "newValue": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "additionalProperties": true
                                  },
                                  {
                                    "type": "array",
                                    "items": {}
                                  }
                                ],
                                "nullable": true
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            },
                            "required": [
                              "id",
                              "userId",
                              "userName",
                              "operation",
                              "tableName",
                              "previousValue",
                              "newValue",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "total": {
                          "type": "integer",
                          "nullable": true
                        },
                        "perDay": {
                          "type": "array",
                          "nullable": true,
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "count": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "date",
                              "count"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "nextCursor": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "required": [
                        "audits",
                        "total",
                        "perDay",
                        "hasMore",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/conversations/{conversationId}/usage": {
      "get": {
        "summary": "Retrieve calculated AI usage for a conversation",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "conversationId": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "nullable": true
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "outputTokens": {
                          "type": "number"
                        },
                        "totalTokens": {
                          "type": "number"
                        },
                        "cachedInputTokens": {
                          "type": "number"
                        },
                        "reasoningTokens": {
                          "type": "number"
                        },
                        "imageCount": {
                          "type": "number"
                        },
                        "ocrPageCount": {
                          "type": "number"
                        },
                        "audioDurationMs": {
                          "type": "number"
                        },
                        "calculatedCostMicros": {
                          "type": "number",
                          "nullable": true
                        },
                        "completedCalls": {
                          "type": "number"
                        },
                        "unavailableUsageCalls": {
                          "type": "number"
                        },
                        "unavailableCostCalls": {
                          "type": "number"
                        },
                        "costsHidden": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "conversationId",
                        "inputTokens",
                        "outputTokens",
                        "totalTokens",
                        "cachedInputTokens",
                        "reasoningTokens",
                        "imageCount",
                        "ocrPageCount",
                        "audioDurationMs",
                        "completedCalls",
                        "unavailableUsageCalls"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/internal/usage-events": {
      "post": {
        "summary": "Ingest a sanitized AI provider usage event from a trusted service",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "providerCallId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "rootRequestId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "sourceService": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "operation": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "provider": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "deploymentName": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "apiVersion": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "streaming": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "completed",
                      "failed",
                      "cancelled",
                      "usage_unavailable"
                    ]
                  },
                  "usageSource": {
                    "type": "string",
                    "enum": [
                      "provider",
                      "unavailable"
                    ]
                  },
                  "usage": {
                    "type": "object",
                    "properties": {
                      "inputTokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "outputTokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "totalTokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "cachedInputTokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "reasoningTokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "prompt_tokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "completion_tokens": {
                        "type": "number",
                        "minimum": 0
                      },
                      "total_tokens": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": true
                  },
                  "meterKind": {
                    "type": "string",
                    "enum": [
                      "tokens",
                      "images",
                      "ocr_pages",
                      "audio_duration"
                    ]
                  },
                  "unit": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "maxLength": 64
                          },
                          "count": {
                            "type": "number",
                            "minimum": 0
                          }
                        },
                        "required": [
                          "type",
                          "count"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "unitCount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "metadata": {
                    "type": "object",
                    "properties": {
                      "agentId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "knowledgeBaseId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "conversationId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "taskId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "jobId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "fileId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "fileName": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "indexName": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "batchId": {
                        "type": "string",
                        "maxLength": 256,
                        "nullable": true
                      },
                      "fileCount": {
                        "type": "number",
                        "minimum": 0,
                        "nullable": true
                      },
                      "imageCount": {
                        "type": "number",
                        "minimum": 0,
                        "nullable": true
                      },
                      "engine": {
                        "type": "string",
                        "maxLength": 64,
                        "nullable": true
                      },
                      "region": {
                        "type": "string",
                        "maxLength": 64,
                        "nullable": true
                      },
                      "imageSize": {
                        "type": "string",
                        "maxLength": 32,
                        "nullable": true
                      },
                      "imageQuality": {
                        "type": "string",
                        "maxLength": 32,
                        "nullable": true
                      },
                      "size": {
                        "type": "string",
                        "maxLength": 32,
                        "nullable": true
                      },
                      "quality": {
                        "type": "string",
                        "maxLength": 32,
                        "nullable": true
                      },
                      "identitySource": {
                        "type": "string",
                        "maxLength": 64,
                        "nullable": true
                      }
                    },
                    "additionalProperties": false
                  },
                  "startedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "completedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "durationMs": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "providerCallId",
                  "rootRequestId",
                  "sourceService",
                  "operation",
                  "modelId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "duplicate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "duplicate": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "duplicate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/usage/statistics/export": {
      "get": {
        "summary": "Export tenant-scoped AI usage and calculated cost statistics as CSV",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "in": "query",
            "name": "modelId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "in": "query",
            "name": "operation",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "in": "query",
            "name": "sourceService",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/usage/statistics": {
      "get": {
        "summary": "Retrieve tenant-scoped AI usage and calculated cost statistics",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "from",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "in": "query",
            "name": "to",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "in": "query",
            "name": "modelId",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "in": "query",
            "name": "operation",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "in": "query",
            "name": "sourceService",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "range": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "to": {
                              "type": "string",
                              "format": "date-time"
                            }
                          },
                          "required": [
                            "from",
                            "to"
                          ],
                          "additionalProperties": false
                        },
                        "summary": {
                          "type": "object",
                          "properties": {
                            "calls": {
                              "type": "number",
                              "minimum": 0
                            },
                            "completedCalls": {
                              "type": "number",
                              "minimum": 0
                            },
                            "inputTokens": {
                              "type": "number",
                              "minimum": 0
                            },
                            "outputTokens": {
                              "type": "number",
                              "minimum": 0
                            },
                            "totalTokens": {
                              "type": "number",
                              "minimum": 0
                            },
                            "imageCount": {
                              "type": "number",
                              "minimum": 0
                            },
                            "ocrPageCount": {
                              "type": "number",
                              "minimum": 0
                            },
                            "audioDurationMs": {
                              "type": "number",
                              "minimum": 0
                            },
                            "unavailableUsageCalls": {
                              "type": "number",
                              "minimum": 0
                            },
                            "unavailableCostCalls": {
                              "type": "number",
                              "minimum": 0
                            },
                            "costs": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "currency": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 3
                                  },
                                  "calculatedCostMicros": {
                                    "type": "number",
                                    "minimum": 0
                                  }
                                },
                                "required": [
                                  "currency",
                                  "calculatedCostMicros"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "calls",
                            "completedCalls",
                            "inputTokens",
                            "outputTokens",
                            "totalTokens",
                            "imageCount",
                            "ocrPageCount",
                            "audioDurationMs",
                            "unavailableUsageCalls",
                            "unavailableCostCalls",
                            "costs"
                          ],
                          "additionalProperties": false
                        },
                        "daily": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "unavailableCostCalls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "date",
                              "calls",
                              "totalTokens",
                              "unavailableCostCalls",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "byUser": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "userId": {
                                "type": "string"
                              },
                              "userName": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "unavailableCostCalls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "userId",
                              "userName",
                              "calls",
                              "totalTokens",
                              "unavailableCostCalls",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "byModel": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "modelId": {
                                "type": "string"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "unavailableCostCalls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "modelId",
                              "calls",
                              "totalTokens",
                              "unavailableCostCalls",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "byOperation": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "operation": {
                                "type": "string"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "unavailableCostCalls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "operation",
                              "calls",
                              "totalTokens",
                              "unavailableCostCalls",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "bySource": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sourceService": {
                                "type": "string"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "unavailableCostCalls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "sourceService",
                              "calls",
                              "totalTokens",
                              "unavailableCostCalls",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "heatmap": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "userId": {
                                "type": "string"
                              },
                              "userName": {
                                "type": "string"
                              },
                              "calls": {
                                "type": "number",
                                "minimum": 0
                              },
                              "totalTokens": {
                                "type": "number",
                                "minimum": 0
                              },
                              "costs": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 3
                                    },
                                    "calculatedCostMicros": {
                                      "type": "number",
                                      "minimum": 0
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "calculatedCostMicros"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "date",
                              "userId",
                              "userName",
                              "calls",
                              "totalTokens",
                              "costs"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "options": {
                          "type": "object",
                          "properties": {
                            "users": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "value",
                                  "label"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "models": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "operations": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "sourceServices": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "users",
                            "models",
                            "operations",
                            "sourceServices"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "range",
                        "summary",
                        "daily",
                        "byUser",
                        "byModel",
                        "byOperation",
                        "bySource",
                        "heatmap",
                        "options"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers": {
      "post": {
        "summary": "Create a new MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "serverUrl",
                  "authType"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "serverUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "timeout": {
                    "type": "number"
                  },
                  "authType": {
                    "type": "string",
                    "enum": [
                      "none",
                      "bearer",
                      "apikey",
                      "queryparam",
                      "oauth2"
                    ]
                  },
                  "secret": {
                    "type": "string"
                  },
                  "authHeaderName": {
                    "type": "string"
                  },
                  "authQueryParamName": {
                    "type": "string"
                  },
                  "userGroups": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "isPublic": {
                    "type": "boolean"
                  },
                  "oauth2Scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "oauth2AuthorizeUrl": {
                    "type": "string"
                  },
                  "oauth2TokenUrl": {
                    "type": "string"
                  },
                  "oauth2ClientId": {
                    "type": "string"
                  },
                  "oauth2RedirectUri": {
                    "type": "string"
                  },
                  "oauth2UsePkce": {
                    "type": "boolean"
                  },
                  "oauth2ClientSecret": {
                    "type": "string"
                  },
                  "oauth2AutoDiscovered": {
                    "type": "boolean"
                  },
                  "shareCredentials": {
                    "type": "boolean"
                  },
                  "notifyByEmail": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Server created",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Server created",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "serverUrl": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "timeout": {
                      "type": "number"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "authHeaderName": {
                      "type": "string"
                    },
                    "authQueryParamName": {
                      "type": "string"
                    },
                    "shareCredentials": {
                      "type": "boolean"
                    },
                    "notifyByEmail": {
                      "type": "boolean"
                    },
                    "oauth2Scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "oauth2AutoDiscovered": {
                      "type": "boolean"
                    },
                    "oauthStatus": {
                      "type": "string"
                    },
                    "tokenExpiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "tenantId": {
                      "type": "string"
                    },
                    "userGroups": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "isPublic": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "summary": "List accessible MCP user servers",
        "tags": [
          "Chat (divi)"
        ],
        "responses": {
          "200": {
            "description": "List of servers",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of servers",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "serverUrl": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "timeout": {
                        "type": "number"
                      },
                      "authType": {
                        "type": "string"
                      },
                      "authHeaderName": {
                        "type": "string"
                      },
                      "authQueryParamName": {
                        "type": "string"
                      },
                      "shareCredentials": {
                        "type": "boolean"
                      },
                      "notifyByEmail": {
                        "type": "boolean"
                      },
                      "isPublic": {
                        "type": "boolean"
                      },
                      "oauth2Scopes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "oauth2AuthorizeUrl": {
                        "type": "string"
                      },
                      "oauth2TokenUrl": {
                        "type": "string"
                      },
                      "oauth2ClientId": {
                        "type": "string"
                      },
                      "oauth2RedirectUri": {
                        "type": "string"
                      },
                      "oauth2UsePkce": {
                        "type": "boolean"
                      },
                      "oauth2AutoDiscovered": {
                        "type": "boolean"
                      },
                      "oauthStatus": {
                        "type": "string"
                      },
                      "credentialStatus": {
                        "type": "string",
                        "enum": [
                          "not_configured",
                          "configured"
                        ]
                      },
                      "tokenExpiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "createdBy": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "profilePic": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      },
                      "tenantId": {
                        "type": "string"
                      },
                      "userGroups": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "isEnabled": {
                        "type": "boolean"
                      },
                      "userDisabledTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "globalDisabledTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "disabledTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "isOwner": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/enabled-for-completions": {
      "get": {
        "summary": "Get enabled MCP user servers for completions (with resolved auth)",
        "tags": [
          "Chat (divi)"
        ],
        "responses": {
          "200": {
            "description": "List of enabled servers with resolved auth headers",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of enabled servers with resolved auth headers",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "serverId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      },
                      "timeout": {
                        "type": "number"
                      },
                      "description": {
                        "type": "string"
                      },
                      "expired": {
                        "type": "boolean"
                      },
                      "notifyByEmail": {
                        "type": "boolean"
                      },
                      "disabledTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}": {
      "get": {
        "summary": "Get a single MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "summary": "Update an MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "serverUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "timeout": {
                    "type": "number"
                  },
                  "authType": {
                    "type": "string",
                    "enum": [
                      "none",
                      "bearer",
                      "apikey",
                      "queryparam",
                      "oauth2"
                    ]
                  },
                  "secret": {
                    "type": "string"
                  },
                  "authHeaderName": {
                    "type": "string"
                  },
                  "authQueryParamName": {
                    "type": "string"
                  },
                  "userGroups": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "isPublic": {
                    "type": "boolean"
                  },
                  "oauth2Scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "oauth2AuthorizeUrl": {
                    "type": "string"
                  },
                  "oauth2TokenUrl": {
                    "type": "string"
                  },
                  "oauth2ClientId": {
                    "type": "string"
                  },
                  "oauth2RedirectUri": {
                    "type": "string"
                  },
                  "oauth2UsePkce": {
                    "type": "boolean"
                  },
                  "oauth2ClientSecret": {
                    "type": "string"
                  },
                  "oauth2AutoDiscovered": {
                    "type": "boolean"
                  },
                  "shareCredentials": {
                    "type": "boolean"
                  },
                  "notifyByEmail": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "summary": "Delete an MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/toggle": {
      "patch": {
        "summary": "Toggle MCP user server enabled/disabled",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/tools": {
      "get": {
        "summary": "List tools exposed by an MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Tools exposed by the MCP server",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Tools exposed by the MCP server",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "disabled": {
                        "type": "boolean"
                      },
                      "disabledByUser": {
                        "type": "boolean"
                      },
                      "disabledGlobally": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/tools/toggle": {
      "patch": {
        "summary": "Toggle an MCP user server tool enabled/disabled",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "toolName",
                  "enabled"
                ],
                "properties": {
                  "toolName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/tools/global-toggle": {
      "patch": {
        "summary": "Toggle an MCP user server tool enabled/disabled for everyone",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "toolName",
                  "enabled"
                ],
                "properties": {
                  "toolName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/secret": {
      "get": {
        "summary": "Get decrypted secret for an MCP user server (owner only)",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Decrypted secret",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Decrypted secret",
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/oauth-token": {
      "post": {
        "summary": "Save OAuth token for an MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accessToken"
                ],
                "properties": {
                  "accessToken": {
                    "type": "string"
                  },
                  "refreshToken": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Token saved",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Token saved",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "serverUrl": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "oauth2Scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tokenExpiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/oauth-code-exchange": {
      "post": {
        "summary": "Exchange OAuth authorization code for tokens (server-side, avoids CORS)",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "codeVerifier": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Token exchange successful",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Token exchange successful",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "oauthStatus": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/oauth-proxy-exchange": {
      "post": {
        "summary": "Proxy OAuth code exchange to avoid browser CORS (for new servers without a saved ID)",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tokenUrl",
                  "code"
                ],
                "properties": {
                  "tokenUrl": {
                    "type": "string"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "clientSecret": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "codeVerifier": {
                    "type": "string"
                  },
                  "redirectUri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token returned",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Token returned",
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/discover-oauth": {
      "post": {
        "summary": "Discover OAuth configuration from a server URL via RFC 8414",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "serverUrl"
                ],
                "properties": {
                  "serverUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "redirectUri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Discovery result",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Discovery result",
                  "type": "object",
                  "properties": {
                    "discovered": {
                      "type": "boolean"
                    },
                    "oauth2AuthorizeUrl": {
                      "type": "string"
                    },
                    "oauth2TokenUrl": {
                      "type": "string"
                    },
                    "oauth2Scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "oauth2UsePkce": {
                      "type": "boolean"
                    },
                    "oauth2ClientId": {
                      "type": "string"
                    },
                    "oauth2ClientSecret": {
                      "type": "string"
                    },
                    "registrationEndpoint": {
                      "type": "string"
                    },
                    "registrationError": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/test-connection": {
      "post": {
        "summary": "Test connection to an MCP server using stored credentials",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Proxied response from the MCP server",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Proxied response from the MCP server",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number"
                    },
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-user-servers/{id}/user-credential": {
      "post": {
        "summary": "Save per-user credential for a non-shared MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "secret"
                ],
                "properties": {
                  "secret": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Credential saved",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Credential saved",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "credentialStatus": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "summary": "Get decrypted per-user credential for a non-shared MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Decrypted credential",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Decrypted credential",
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "summary": "Delete per-user credential for a non-shared MCP user server",
        "tags": [
          "Chat (divi)"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Credential deleted",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Credential deleted",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-proxy": {
      "post": {
        "summary": "Proxy a request to an MCP server (avoids CORS)",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "payload"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "payload": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proxied response from the MCP server",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Proxied response from the MCP server",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number"
                    },
                    "data": {}
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          },
          "4XX": {
            "description": "Client error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Client error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "5XX": {
            "description": "Proxy/server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Proxy/server error",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-tester/tools": {
      "post": {
        "summary": "List the tools an arbitrary MCP server offers (manual tester)",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1
                  },
                  "auth": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "none",
                          "bearer",
                          "header",
                          "queryparam"
                        ]
                      },
                      "token": {
                        "type": "string"
                      },
                      "headerName": {
                        "type": "string"
                      },
                      "headerValue": {
                        "type": "string"
                      },
                      "paramName": {
                        "type": "string"
                      },
                      "paramValue": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/mcp-tester/call": {
      "post": {
        "summary": "Invoke one tool on an arbitrary MCP server (manual tester)",
        "tags": [
          "Chat (divi)"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "toolName"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1
                  },
                  "auth": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "none",
                          "bearer",
                          "header",
                          "queryparam"
                        ]
                      },
                      "token": {
                        "type": "string"
                      },
                      "headerName": {
                        "type": "string"
                      },
                      "headerValue": {
                        "type": "string"
                      },
                      "paramName": {
                        "type": "string"
                      },
                      "paramValue": {
                        "type": "string"
                      }
                    }
                  },
                  "toolName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "arguments": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/tasks/active": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/tasks/active/user": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/tasks/pre-create": {
      "post": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/tasks/{taskId}/acknowledge": {
      "post": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "taskId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/tasks/{taskId}/stop": {
      "post": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "taskId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/environment-runs": {
      "get": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/environment-runs/{runId}/artifacts/{artifactName}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "runId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "artifactName",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/environment-runs/{runId}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "runId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/files/process": {
      "post": {
        "summary": "Process uploaded files and return a stable batch result",
        "tags": [
          "Chat (divi)"
        ],
        "description": "A request accepts at most 10 documents. A logical batch accepts at most 20 documents and 26214400 bytes.\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-batch-id",
            "required": false,
            "description": "Optional batch ID to append files to an existing batch"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-user-id",
            "required": false,
            "description": "Document batch owner"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "batchId",
                    "status",
                    "files"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "finalizing",
                        "completed",
                        "failed"
                      ]
                    },
                    "processing": {
                      "type": "boolean"
                    },
                    "progress": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "successCount": {
                      "type": "number"
                    },
                    "errorCount": {
                      "type": "number"
                    },
                    "pendingCount": {
                      "type": "number"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/files/process/finalize": {
      "post": {
        "summary": "Finalize an async ingestion job",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Fetches a completed async ingestion job result and merges successful files into the owner-scoped batch.\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jobId"
                ],
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "batchId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-batch-id",
            "required": false,
            "description": "Optional batch ID to append files to an existing batch"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-user-id",
            "required": false,
            "description": "Document batch owner"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "batchId",
                    "status",
                    "files"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "finalizing",
                        "completed",
                        "failed"
                      ]
                    },
                    "processing": {
                      "type": "boolean"
                    },
                    "progress": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "successCount": {
                      "type": "number"
                    },
                    "errorCount": {
                      "type": "number"
                    },
                    "pendingCount": {
                      "type": "number"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "batchId",
                    "status",
                    "files"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "finalizing",
                        "completed",
                        "failed"
                      ]
                    },
                    "processing": {
                      "type": "boolean"
                    },
                    "progress": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "successCount": {
                      "type": "number"
                    },
                    "errorCount": {
                      "type": "number"
                    },
                    "pendingCount": {
                      "type": "number"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/files/process/jobs/{jobId}": {
      "get": {
        "summary": "Get async ingestion job status",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Owner-scoped proxy for reconnect and refresh recovery. Call finalize after a completed terminal status.\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "jobId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-batch-id",
            "required": false,
            "description": "Optional batch ID to append files to an existing batch"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-user-id",
            "required": false,
            "description": "Document batch owner"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "batchId",
                    "status",
                    "files"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "processing",
                        "finalizing",
                        "completed",
                        "failed"
                      ]
                    },
                    "processing": {
                      "type": "boolean"
                    },
                    "progress": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "successCount": {
                      "type": "number"
                    },
                    "errorCount": {
                      "type": "number"
                    },
                    "pendingCount": {
                      "type": "number"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/files/process/{batchId}/files/{fileId}": {
      "delete": {
        "summary": "Remove an unsent document from a batch",
        "tags": [
          "Chat (divi)"
        ],
        "description": "Owner-scoped and idempotent. Files already attached to a conversation cannot be removed.\n\n**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "batchId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "fileId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-batch-id",
            "required": false,
            "description": "Optional batch ID to append files to an existing batch"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-user-id",
            "required": false,
            "description": "Document batch owner"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "batchId",
                    "fileId",
                    "remainingFiles"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "fileId": {
                      "type": "string"
                    },
                    "remainingFiles": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "batchId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "statusCode": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "filename",
                          "status"
                        ],
                        "properties": {
                          "filename": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "processing",
                              "finalizing",
                              "completed",
                              "failed",
                              "skipped"
                            ]
                          },
                          "mimeType": {
                            "type": "string"
                          },
                          "sizeBytes": {
                            "type": "number"
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "ordinal": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          },
                          "extractionMethod": {
                            "type": "string"
                          },
                          "error": {
                            "type": "object",
                            "required": [
                              "code",
                              "message"
                            ],
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "details": {
                                "type": "object",
                                "additionalProperties": true
                              },
                              "statusCode": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat"
      }
    },
    "/chat/files/artifacts/{fileId}/original": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "fileId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/files/artifacts/{fileId}/pdf-preview": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "fileId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/chat/files/artifacts/{fileId}/preview": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "fileId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat (divi)"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/": {
      "post": {
        "summary": "Create a new conversation",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId",
                  "userId",
                  "conversationName"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "description": "conversationId should come from frontend"
                  },
                  "userId": {
                    "type": "string",
                    "description": "userId should come from UsersApi"
                  },
                  "conversationName": {
                    "type": "string",
                    "description": "conversationName should come from frontend"
                  },
                  "isPinned": {
                    "type": "boolean",
                    "default": false,
                    "description": "Whether the conversation is pinned"
                  },
                  "projectId": {
                    "type": "string",
                    "description": "Optional project ID to link conversation to"
                  },
                  "lastModelId": {
                    "type": "string",
                    "description": "Last model used in this conversation"
                  },
                  "lastAgentId": {
                    "type": "string",
                    "description": "Last agent used in this conversation"
                  },
                  "parentConversationId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Parent conversation for branches"
                  },
                  "branchedFromMessageId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Message where branch starts"
                  },
                  "branchRootConversationId": {
                    "type": "string",
                    "nullable": true,
                    "description": "Root conversation for branch tree"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "New conversation created",
            "content": {
              "application/json": {
                "schema": {
                  "description": "New conversation created",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "isPinned": {
                      "type": "boolean",
                      "default": false
                    },
                    "projectId": {
                      "type": "string"
                    },
                    "lastModelId": {
                      "type": "string",
                      "nullable": true
                    },
                    "lastAgentId": {
                      "type": "string",
                      "nullable": true
                    },
                    "parentConversationId": {
                      "type": "string",
                      "nullable": true
                    },
                    "branchedFromMessageId": {
                      "type": "string",
                      "nullable": true
                    },
                    "branchRootConversationId": {
                      "type": "string",
                      "nullable": true
                    },
                    "latestContextUsage": {
                      "type": "object",
                      "properties": {
                        "modelTokenLimit": {
                          "type": "number"
                        },
                        "reservedCompletionTokens": {
                          "type": "number"
                        },
                        "usableInputTokens": {
                          "type": "number"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "availableInputTokens": {
                          "type": "number"
                        },
                        "overflowTokens": {
                          "type": "number"
                        },
                        "inputUtilizationPercentage": {
                          "type": "number"
                        },
                        "isOverflow": {
                          "type": "boolean"
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/{conversationId}/branches": {
      "post": {
        "summary": "Create a new conversation branch from a message",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId",
                  "userId",
                  "conversationName",
                  "branchedFromMessageId"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string"
                  },
                  "userId": {
                    "type": "string"
                  },
                  "conversationName": {
                    "type": "string"
                  },
                  "branchedFromMessageId": {
                    "type": "string"
                  },
                  "projectId": {
                    "type": "string"
                  },
                  "lastModelId": {
                    "type": "string"
                  },
                  "lastAgentId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Conversation branch created",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Conversation branch created",
                  "type": "object",
                  "properties": {
                    "conversation": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "conversationId": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "conversationName": {
                          "type": "string"
                        },
                        "isDeleted": {
                          "type": "boolean"
                        },
                        "isPinned": {
                          "type": "boolean"
                        },
                        "projectId": {
                          "type": "string",
                          "nullable": true
                        },
                        "lastModelId": {
                          "type": "string",
                          "nullable": true
                        },
                        "lastAgentId": {
                          "type": "string",
                          "nullable": true
                        },
                        "parentConversationId": {
                          "type": "string",
                          "nullable": true
                        },
                        "branchedFromMessageId": {
                          "type": "string",
                          "nullable": true
                        },
                        "branchRootConversationId": {
                          "type": "string",
                          "nullable": true
                        },
                        "latestContextUsage": {
                          "type": "object",
                          "properties": {
                            "modelTokenLimit": {
                              "type": "number"
                            },
                            "reservedCompletionTokens": {
                              "type": "number"
                            },
                            "usableInputTokens": {
                              "type": "number"
                            },
                            "inputTokens": {
                              "type": "number"
                            },
                            "availableInputTokens": {
                              "type": "number"
                            },
                            "overflowTokens": {
                              "type": "number"
                            },
                            "inputUtilizationPercentage": {
                              "type": "number"
                            },
                            "isOverflow": {
                              "type": "boolean"
                            }
                          }
                        },
                        "oldestMessageId": {
                          "type": "string",
                          "nullable": true
                        },
                        "lastReadAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "lastMessageAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "conversationId": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "modelId": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "prompt": {
                            "type": "string"
                          },
                          "response": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "file"
                                  ],
                                  "description": "Type of attachment"
                                },
                                "content": {
                                  "type": "string",
                                  "description": "URL or File Path"
                                },
                                "filename": {
                                  "type": "string",
                                  "description": "Original filename"
                                },
                                "mimeType": {
                                  "type": "string",
                                  "description": "MIME type of the attachment"
                                },
                                "size": {
                                  "type": "number",
                                  "description": "Size in bytes"
                                },
                                "sender": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "assistant"
                                  ],
                                  "default": "user"
                                }
                              }
                            }
                          },
                          "ragDocuments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "originalFileName": {
                                  "type": "string",
                                  "description": "Original filename in blob storage for downloads"
                                },
                                "displayFileName": {
                                  "type": "string",
                                  "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                                },
                                "score": {
                                  "type": "number",
                                  "description": "Relevance score (optional)"
                                },
                                "downloadUrl": {
                                  "type": "string",
                                  "description": "Download URL for the document"
                                },
                                "snippet": {
                                  "type": "string",
                                  "description": "Text snippet/preview from the document"
                                },
                                "sharePointWebUrl": {
                                  "type": "string",
                                  "description": "Optional SharePoint web URL for the document"
                                }
                              }
                            }
                          },
                          "appliedSkills": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "skillId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "displayName": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "instructions": {
                                  "type": "string"
                                },
                                "source": {
                                  "type": "string"
                                },
                                "invocationMode": {
                                  "type": "string",
                                  "enum": [
                                    "automatic",
                                    "onRequest",
                                    "alwaysOn"
                                  ]
                                },
                                "appliedReason": {
                                  "type": "string",
                                  "enum": [
                                    "alwaysOn",
                                    "explicitRequest",
                                    "automaticMatch"
                                  ]
                                },
                                "allowedTools": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "referenceHits": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "skillId": {
                                        "type": "string",
                                        "description": "Owning skill id"
                                      },
                                      "filePath": {
                                        "type": "string",
                                        "description": "Path to the reference file inside the skill bundle"
                                      },
                                      "chunkId": {
                                        "type": "string",
                                        "description": "Unique chunk identifier in the skill reference index"
                                      },
                                      "score": {
                                        "type": "number",
                                        "description": "Optional retrieval score"
                                      },
                                      "snippet": {
                                        "type": "string",
                                        "description": "Retrieved text snippet used at runtime"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "runIds": {
                            "type": "array",
                            "description": "Environment-run ids (envrun_*) for code-execution panels",
                            "items": {
                              "type": "string"
                            }
                          },
                          "historyTruncated": {
                            "type": "boolean"
                          },
                          "historyCompacted": {
                            "type": "boolean"
                          },
                          "droppedMessageCount": {
                            "type": "number"
                          },
                          "contextUsage": {
                            "type": "object",
                            "properties": {
                              "modelTokenLimit": {
                                "type": "number"
                              },
                              "reservedCompletionTokens": {
                                "type": "number"
                              },
                              "usableInputTokens": {
                                "type": "number"
                              },
                              "inputTokens": {
                                "type": "number"
                              },
                              "availableInputTokens": {
                                "type": "number"
                              },
                              "overflowTokens": {
                                "type": "number"
                              },
                              "inputUtilizationPercentage": {
                                "type": "number"
                              },
                              "isOverflow": {
                                "type": "boolean"
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "oldestMessageId": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/{conversationId}": {
      "get": {
        "summary": "Get a single conversation by ID",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation found",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Conversation found",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    },
                    "isPinned": {
                      "type": "boolean"
                    },
                    "projectId": {
                      "type": "string",
                      "nullable": true
                    },
                    "lastModelId": {
                      "type": "string",
                      "nullable": true
                    },
                    "lastAgentId": {
                      "type": "string",
                      "nullable": true
                    },
                    "parentConversationId": {
                      "type": "string",
                      "nullable": true
                    },
                    "branchedFromMessageId": {
                      "type": "string",
                      "nullable": true
                    },
                    "branchRootConversationId": {
                      "type": "string",
                      "nullable": true
                    },
                    "latestContextUsage": {
                      "type": "object",
                      "properties": {
                        "modelTokenLimit": {
                          "type": "number"
                        },
                        "reservedCompletionTokens": {
                          "type": "number"
                        },
                        "usableInputTokens": {
                          "type": "number"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "availableInputTokens": {
                          "type": "number"
                        },
                        "overflowTokens": {
                          "type": "number"
                        },
                        "inputUtilizationPercentage": {
                          "type": "number"
                        },
                        "isOverflow": {
                          "type": "boolean"
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/{conversationId}/edit": {
      "patch": {
        "summary": "Edit conversation",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "conversationName": {
                    "type": "string"
                  },
                  "isPinned": {
                    "type": "boolean"
                  },
                  "lastModelId": {
                    "type": "string",
                    "nullable": true
                  },
                  "lastAgentId": {
                    "type": "string",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation edited",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Conversation edited",
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "isPinned": {
                      "type": "boolean"
                    },
                    "lastModelId": {
                      "type": "string",
                      "nullable": true
                    },
                    "lastAgentId": {
                      "type": "string",
                      "nullable": true
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/{conversationId}/delete": {
      "patch": {
        "summary": "Flag conversations as deleted",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Updated conversation",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Updated conversation",
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "isPinned": {
                      "type": "boolean"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/{conversationId}/read": {
      "patch": {
        "summary": "Mark conversation as read",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation marked as read",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Conversation marked as read",
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "lastReadAt": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "lastMessageAt": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/user/{userId}": {
      "get": {
        "summary": "List user conversations + last messages",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "default": 30
            },
            "in": "query",
            "name": "daysBack",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/conversations/user/{userId}/recent": {
      "get": {
        "summary": "List recent user conversations by count",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "default": 15
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "Maximum number of conversations to return"
          },
          {
            "schema": {
              "type": "integer",
              "default": 1
            },
            "in": "query",
            "name": "page",
            "required": false,
            "description": "Page number for pagination (1-based)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "projectId",
            "required": false,
            "description": "Optional project ID to filter conversations"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Array of recent conversations with their messages",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Array of recent conversations with their messages",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "conversationId": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "conversationName": {
                        "type": "string"
                      },
                      "isDeleted": {
                        "type": "boolean"
                      },
                      "isPinned": {
                        "type": "boolean"
                      },
                      "projectId": {
                        "type": "string",
                        "nullable": true
                      },
                      "lastModelId": {
                        "type": "string",
                        "nullable": true
                      },
                      "lastAgentId": {
                        "type": "string",
                        "nullable": true
                      },
                      "parentConversationId": {
                        "type": "string",
                        "nullable": true
                      },
                      "branchedFromMessageId": {
                        "type": "string",
                        "nullable": true
                      },
                      "branchRootConversationId": {
                        "type": "string",
                        "nullable": true
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "lastReadAt": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                      },
                      "lastMessageAt": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                      },
                      "latestContextUsage": {
                        "type": "object",
                        "properties": {
                          "modelTokenLimit": {
                            "type": "number"
                          },
                          "reservedCompletionTokens": {
                            "type": "number"
                          },
                          "usableInputTokens": {
                            "type": "number"
                          },
                          "inputTokens": {
                            "type": "number"
                          },
                          "availableInputTokens": {
                            "type": "number"
                          },
                          "overflowTokens": {
                            "type": "number"
                          },
                          "inputUtilizationPercentage": {
                            "type": "number"
                          },
                          "isOverflow": {
                            "type": "boolean"
                          }
                        }
                      },
                      "isLastPage": {
                        "type": "boolean",
                        "description": "Present and true only on the last conversation of the last page"
                      },
                      "messageLoadFailed": {
                        "type": "boolean",
                        "description": "True if messages could not be loaded (e.g. decryption failure)"
                      },
                      "messageLoadError": {
                        "type": "string",
                        "description": "Error message when messageLoadFailed is true"
                      },
                      "lastMessages": {
                        "type": "object",
                        "properties": {
                          "messages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "_id": {
                                  "type": "string"
                                },
                                "conversationId": {
                                  "type": "string"
                                },
                                "userId": {
                                  "type": "string"
                                },
                                "modelId": {
                                  "type": "string"
                                },
                                "role": {
                                  "type": "string"
                                },
                                "prompt": {
                                  "type": "string"
                                },
                                "response": {
                                  "type": "string"
                                },
                                "attachments": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "enum": [
                                          "image",
                                          "file"
                                        ],
                                        "description": "Type of attachment"
                                      },
                                      "content": {
                                        "type": "string",
                                        "description": "URL or File Path"
                                      },
                                      "filename": {
                                        "type": "string",
                                        "description": "Original filename"
                                      },
                                      "mimeType": {
                                        "type": "string",
                                        "description": "MIME type of the attachment"
                                      },
                                      "size": {
                                        "type": "number",
                                        "description": "Size in bytes"
                                      },
                                      "sender": {
                                        "type": "string",
                                        "enum": [
                                          "user",
                                          "assistant"
                                        ],
                                        "default": "user"
                                      }
                                    }
                                  }
                                },
                                "ragDocuments": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "originalFileName",
                                      "displayFileName",
                                      "downloadUrl",
                                      "snippet"
                                    ],
                                    "properties": {
                                      "originalFileName": {
                                        "type": "string",
                                        "description": "Original filename in blob storage for downloads"
                                      },
                                      "displayFileName": {
                                        "type": "string",
                                        "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                                      },
                                      "score": {
                                        "type": "number",
                                        "description": "Relevance score (optional)"
                                      },
                                      "downloadUrl": {
                                        "type": "string",
                                        "description": "Download URL for the document"
                                      },
                                      "snippet": {
                                        "type": "string",
                                        "description": "Text snippet/preview from the document"
                                      },
                                      "sharePointWebUrl": {
                                        "type": "string",
                                        "description": "Optional SharePoint web URL for the document"
                                      }
                                    }
                                  }
                                },
                                "appliedSkills": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "skillId": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      },
                                      "displayName": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "instructions": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "type": "string"
                                      },
                                      "invocationMode": {
                                        "type": "string",
                                        "enum": [
                                          "automatic",
                                          "onRequest",
                                          "alwaysOn"
                                        ]
                                      },
                                      "appliedReason": {
                                        "type": "string",
                                        "enum": [
                                          "alwaysOn",
                                          "explicitRequest",
                                          "automaticMatch"
                                        ]
                                      },
                                      "allowedTools": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "referenceHits": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "skillId": {
                                              "type": "string",
                                              "description": "Owning skill id"
                                            },
                                            "filePath": {
                                              "type": "string",
                                              "description": "Path to the reference file inside the skill bundle"
                                            },
                                            "chunkId": {
                                              "type": "string",
                                              "description": "Unique chunk identifier in the skill reference index"
                                            },
                                            "score": {
                                              "type": "number",
                                              "description": "Optional retrieval score"
                                            },
                                            "snippet": {
                                              "type": "string",
                                              "description": "Retrieved text snippet used at runtime"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                },
                                "runIds": {
                                  "type": "array",
                                  "description": "Environment-run ids (envrun_*) for code-execution panels",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "historyTruncated": {
                                  "type": "boolean"
                                },
                                "historyCompacted": {
                                  "type": "boolean"
                                },
                                "droppedMessageCount": {
                                  "type": "number"
                                },
                                "contextUsage": {
                                  "type": "object",
                                  "properties": {
                                    "modelTokenLimit": {
                                      "type": "number"
                                    },
                                    "reservedCompletionTokens": {
                                      "type": "number"
                                    },
                                    "usableInputTokens": {
                                      "type": "number"
                                    },
                                    "inputTokens": {
                                      "type": "number"
                                    },
                                    "availableInputTokens": {
                                      "type": "number"
                                    },
                                    "overflowTokens": {
                                      "type": "number"
                                    },
                                    "inputUtilizationPercentage": {
                                      "type": "number"
                                    },
                                    "isOverflow": {
                                      "type": "boolean"
                                    }
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "format": "date-time"
                                }
                              }
                            }
                          },
                          "oldestMessageId": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages": {
      "post": {
        "summary": "Create a new chat message",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId",
                  "userId",
                  "modelId",
                  "role",
                  "prompt"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string"
                  },
                  "userId": {
                    "type": "string"
                  },
                  "modelId": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "file"
                          ],
                          "description": "Type of attachment"
                        },
                        "content": {
                          "type": "string",
                          "description": "URL or File Path"
                        },
                        "filename": {
                          "type": "string",
                          "description": "Original filename"
                        },
                        "mimeType": {
                          "type": "string",
                          "description": "MIME type of the attachment"
                        },
                        "size": {
                          "type": "number",
                          "description": "Size in bytes"
                        },
                        "sender": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ],
                          "default": "user"
                        }
                      }
                    }
                  },
                  "ragDocuments": {
                    "type": "array",
                    "description": "RAG source documents used for this response",
                    "items": {
                      "type": "object",
                      "properties": {
                        "originalFileName": {
                          "type": "string",
                          "description": "Original filename in blob storage for downloads"
                        },
                        "displayFileName": {
                          "type": "string",
                          "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                        },
                        "score": {
                          "type": "number",
                          "description": "Relevance score (optional)"
                        },
                        "downloadUrl": {
                          "type": "string",
                          "description": "Download URL for the document"
                        },
                        "snippet": {
                          "type": "string",
                          "description": "Text snippet/preview from the document"
                        },
                        "sharePointWebUrl": {
                          "type": "string",
                          "description": "Optional SharePoint web URL for the document"
                        }
                      }
                    }
                  },
                  "appliedSkills": {
                    "type": "array",
                    "description": "Runtime skills applied to this assistant response",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "instructions": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "appliedReason": {
                          "type": "string",
                          "enum": [
                            "alwaysOn",
                            "explicitRequest",
                            "automaticMatch"
                          ]
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "referenceHits": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skillId": {
                                "type": "string",
                                "description": "Owning skill id"
                              },
                              "filePath": {
                                "type": "string",
                                "description": "Path to the reference file inside the skill bundle"
                              },
                              "chunkId": {
                                "type": "string",
                                "description": "Unique chunk identifier in the skill reference index"
                              },
                              "score": {
                                "type": "number",
                                "description": "Optional retrieval score"
                              },
                              "snippet": {
                                "type": "string",
                                "description": "Retrieved text snippet used at runtime"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "runIds": {
                    "type": "array",
                    "description": "Environment-run ids (envrun_*) for code-execution panels",
                    "items": {
                      "type": "string"
                    }
                  },
                  "historyTruncated": {
                    "type": "boolean"
                  },
                  "historyCompacted": {
                    "type": "boolean"
                  },
                  "droppedMessageCount": {
                    "type": "number"
                  },
                  "contextUsage": {
                    "type": "object",
                    "properties": {
                      "modelTokenLimit": {
                        "type": "number"
                      },
                      "reservedCompletionTokens": {
                        "type": "number"
                      },
                      "usableInputTokens": {
                        "type": "number"
                      },
                      "inputTokens": {
                        "type": "number"
                      },
                      "availableInputTokens": {
                        "type": "number"
                      },
                      "overflowTokens": {
                        "type": "number"
                      },
                      "inputUtilizationPercentage": {
                        "type": "number"
                      },
                      "isOverflow": {
                        "type": "boolean"
                      }
                    }
                  },
                  "stopped_by_user": {
                    "type": "boolean",
                    "description": "Whether the user stopped the generation"
                  },
                  "complete": {
                    "type": "boolean",
                    "description": "Whether the response completed successfully"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "New message added",
            "content": {
              "application/json": {
                "schema": {
                  "description": "New message added",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "conversationName": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "modelId": {
                      "type": "string"
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "response": {
                      "type": "string"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "image",
                              "file"
                            ],
                            "description": "Type of attachment"
                          },
                          "content": {
                            "type": "string",
                            "description": "URL or File Path"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Original filename"
                          },
                          "mimeType": {
                            "type": "string",
                            "description": "MIME type of the attachment"
                          },
                          "size": {
                            "type": "number",
                            "description": "Size in bytes"
                          },
                          "sender": {
                            "type": "string",
                            "enum": [
                              "user",
                              "assistant"
                            ],
                            "default": "user"
                          }
                        }
                      }
                    },
                    "ragDocuments": {
                      "type": "array",
                      "description": "RAG source documents used for this response",
                      "items": {
                        "type": "object",
                        "properties": {
                          "originalFileName": {
                            "type": "string",
                            "description": "Original filename in blob storage for downloads"
                          },
                          "displayFileName": {
                            "type": "string",
                            "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                          },
                          "score": {
                            "type": "number",
                            "description": "Relevance score (optional)"
                          },
                          "downloadUrl": {
                            "type": "string",
                            "description": "Download URL for the document"
                          },
                          "snippet": {
                            "type": "string",
                            "description": "Text snippet/preview from the document"
                          },
                          "sharePointWebUrl": {
                            "type": "string",
                            "description": "Optional SharePoint web URL for the document"
                          }
                        }
                      }
                    },
                    "appliedSkills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skillId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "instructions": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "invocationMode": {
                            "type": "string",
                            "enum": [
                              "automatic",
                              "onRequest",
                              "alwaysOn"
                            ]
                          },
                          "appliedReason": {
                            "type": "string",
                            "enum": [
                              "alwaysOn",
                              "explicitRequest",
                              "automaticMatch"
                            ]
                          },
                          "allowedTools": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "referenceHits": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "skillId": {
                                  "type": "string",
                                  "description": "Owning skill id"
                                },
                                "filePath": {
                                  "type": "string",
                                  "description": "Path to the reference file inside the skill bundle"
                                },
                                "chunkId": {
                                  "type": "string",
                                  "description": "Unique chunk identifier in the skill reference index"
                                },
                                "score": {
                                  "type": "number",
                                  "description": "Optional retrieval score"
                                },
                                "snippet": {
                                  "type": "string",
                                  "description": "Retrieved text snippet used at runtime"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "runIds": {
                      "type": "array",
                      "description": "Environment-run ids (envrun_*) for code-execution panels",
                      "items": {
                        "type": "string"
                      }
                    },
                    "historyTruncated": {
                      "type": "boolean"
                    },
                    "historyCompacted": {
                      "type": "boolean"
                    },
                    "droppedMessageCount": {
                      "type": "number"
                    },
                    "contextUsage": {
                      "type": "object",
                      "properties": {
                        "modelTokenLimit": {
                          "type": "number"
                        },
                        "reservedCompletionTokens": {
                          "type": "number"
                        },
                        "usableInputTokens": {
                          "type": "number"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "availableInputTokens": {
                          "type": "number"
                        },
                        "overflowTokens": {
                          "type": "number"
                        },
                        "inputUtilizationPercentage": {
                          "type": "number"
                        },
                        "isOverflow": {
                          "type": "boolean"
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/{conversationId}": {
      "get": {
        "summary": "Get messages in a conversation with pagination support",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "default": 15
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "Number of messages to fetch"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "beforeId",
            "required": false,
            "description": "Get messages before this message ID (for pagination when scrolling up)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true,
            "description": "ID of the conversation to get messages from"
          }
        ],
        "responses": {
          "200": {
            "description": "Messages and pagination information",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Messages and pagination information",
                  "type": "object",
                  "properties": {
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "conversationId": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "modelId": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "user",
                              "assistant",
                              "system"
                            ]
                          },
                          "prompt": {
                            "type": "string"
                          },
                          "response": {
                            "type": "string"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "file"
                                  ],
                                  "description": "Type of attachment"
                                },
                                "content": {
                                  "type": "string",
                                  "description": "URL or File Path"
                                },
                                "filename": {
                                  "type": "string",
                                  "description": "Original filename"
                                },
                                "mimeType": {
                                  "type": "string",
                                  "description": "MIME type of the attachment"
                                },
                                "size": {
                                  "type": "number",
                                  "description": "Size in bytes"
                                },
                                "sender": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "assistant"
                                  ],
                                  "default": "user"
                                }
                              }
                            }
                          },
                          "ragDocuments": {
                            "type": "array",
                            "description": "RAG source documents used for this response",
                            "items": {
                              "type": "object",
                              "properties": {
                                "originalFileName": {
                                  "type": "string",
                                  "description": "Original filename in blob storage for downloads"
                                },
                                "displayFileName": {
                                  "type": "string",
                                  "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                                },
                                "score": {
                                  "type": "number",
                                  "description": "Relevance score (optional)"
                                },
                                "downloadUrl": {
                                  "type": "string",
                                  "description": "Download URL for the document"
                                },
                                "snippet": {
                                  "type": "string",
                                  "description": "Text snippet/preview from the document"
                                },
                                "sharePointWebUrl": {
                                  "type": "string",
                                  "description": "Optional SharePoint web URL for the document"
                                }
                              }
                            }
                          },
                          "appliedSkills": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "skillId": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "displayName": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "instructions": {
                                  "type": "string"
                                },
                                "source": {
                                  "type": "string"
                                },
                                "invocationMode": {
                                  "type": "string",
                                  "enum": [
                                    "automatic",
                                    "onRequest",
                                    "alwaysOn"
                                  ]
                                },
                                "appliedReason": {
                                  "type": "string",
                                  "enum": [
                                    "alwaysOn",
                                    "explicitRequest",
                                    "automaticMatch"
                                  ]
                                },
                                "allowedTools": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "referenceHits": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "skillId": {
                                        "type": "string",
                                        "description": "Owning skill id"
                                      },
                                      "filePath": {
                                        "type": "string",
                                        "description": "Path to the reference file inside the skill bundle"
                                      },
                                      "chunkId": {
                                        "type": "string",
                                        "description": "Unique chunk identifier in the skill reference index"
                                      },
                                      "score": {
                                        "type": "number",
                                        "description": "Optional retrieval score"
                                      },
                                      "snippet": {
                                        "type": "string",
                                        "description": "Retrieved text snippet used at runtime"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          },
                          "runIds": {
                            "type": "array",
                            "description": "Environment-run ids (envrun_*) for code-execution panels",
                            "items": {
                              "type": "string"
                            }
                          },
                          "historyTruncated": {
                            "type": "boolean"
                          },
                          "historyCompacted": {
                            "type": "boolean"
                          },
                          "droppedMessageCount": {
                            "type": "number"
                          },
                          "contextUsage": {
                            "type": "object",
                            "properties": {
                              "modelTokenLimit": {
                                "type": "number"
                              },
                              "reservedCompletionTokens": {
                                "type": "number"
                              },
                              "usableInputTokens": {
                                "type": "number"
                              },
                              "inputTokens": {
                                "type": "number"
                              },
                              "availableInputTokens": {
                                "type": "number"
                              },
                              "overflowTokens": {
                                "type": "number"
                              },
                              "inputUtilizationPercentage": {
                                "type": "number"
                              },
                              "isOverflow": {
                                "type": "boolean"
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "oldestMessageId": {
                      "type": "string",
                      "nullable": true,
                      "description": "ID of the oldest message in the result set, use this as beforeId when loading more messages"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/{id}": {
      "patch": {
        "summary": "Update chat message fields",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "modelId": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "description": "Updated list of attachments for this message",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "file"
                          ],
                          "description": "Type of attachment"
                        },
                        "content": {
                          "type": "string",
                          "description": "URL or File Path"
                        },
                        "filename": {
                          "type": "string",
                          "description": "Original filename"
                        },
                        "mimeType": {
                          "type": "string",
                          "description": "MIME type of the attachment"
                        },
                        "size": {
                          "type": "number",
                          "description": "Size in bytes"
                        },
                        "sender": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ],
                          "default": "user"
                        }
                      }
                    }
                  },
                  "ragDocuments": {
                    "type": "array",
                    "description": "Updated list of RAG source documents for this message",
                    "items": {
                      "type": "object",
                      "properties": {
                        "originalFileName": {
                          "type": "string",
                          "description": "Original filename in blob storage for downloads"
                        },
                        "displayFileName": {
                          "type": "string",
                          "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                        },
                        "score": {
                          "type": "number",
                          "description": "Relevance score (optional)"
                        },
                        "downloadUrl": {
                          "type": "string",
                          "description": "Download URL for the document"
                        },
                        "snippet": {
                          "type": "string",
                          "description": "Text snippet/preview from the document"
                        },
                        "sharePointWebUrl": {
                          "type": "string",
                          "description": "Optional SharePoint web URL for the document"
                        }
                      }
                    }
                  },
                  "appliedSkills": {
                    "type": "array",
                    "description": "Updated list of runtime skills used for this message",
                    "items": {
                      "type": "object",
                      "properties": {
                        "skillId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "instructions": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "invocationMode": {
                          "type": "string",
                          "enum": [
                            "automatic",
                            "onRequest",
                            "alwaysOn"
                          ]
                        },
                        "appliedReason": {
                          "type": "string",
                          "enum": [
                            "alwaysOn",
                            "explicitRequest",
                            "automaticMatch"
                          ]
                        },
                        "allowedTools": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "referenceHits": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "skillId": {
                                "type": "string",
                                "description": "Owning skill id"
                              },
                              "filePath": {
                                "type": "string",
                                "description": "Path to the reference file inside the skill bundle"
                              },
                              "chunkId": {
                                "type": "string",
                                "description": "Unique chunk identifier in the skill reference index"
                              },
                              "score": {
                                "type": "number",
                                "description": "Optional retrieval score"
                              },
                              "snippet": {
                                "type": "string",
                                "description": "Retrieved text snippet used at runtime"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "runIds": {
                    "type": "array",
                    "description": "Environment-run ids (envrun_*) for code-execution panels",
                    "items": {
                      "type": "string"
                    }
                  },
                  "historyTruncated": {
                    "type": "boolean"
                  },
                  "historyCompacted": {
                    "type": "boolean"
                  },
                  "droppedMessageCount": {
                    "type": "number"
                  },
                  "contextUsage": {
                    "type": "object",
                    "properties": {
                      "modelTokenLimit": {
                        "type": "number"
                      },
                      "reservedCompletionTokens": {
                        "type": "number"
                      },
                      "usableInputTokens": {
                        "type": "number"
                      },
                      "inputTokens": {
                        "type": "number"
                      },
                      "availableInputTokens": {
                        "type": "number"
                      },
                      "overflowTokens": {
                        "type": "number"
                      },
                      "inputUtilizationPercentage": {
                        "type": "number"
                      },
                      "isOverflow": {
                        "type": "boolean"
                      }
                    }
                  },
                  "stopped_by_user": {
                    "type": "boolean",
                    "description": "Whether the user stopped the generation"
                  },
                  "complete": {
                    "type": "boolean",
                    "description": "Whether the response completed successfully"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Updated message with new values",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Updated message with new values",
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "modelId": {
                      "type": "string",
                      "description": "Updated model ID"
                    },
                    "role": {
                      "type": "string"
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Updated prompt text"
                    },
                    "response": {
                      "type": "string",
                      "description": "Updated response text"
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "image",
                              "file"
                            ],
                            "description": "Type of attachment"
                          },
                          "content": {
                            "type": "string",
                            "description": "URL or File Path"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Original filename"
                          },
                          "mimeType": {
                            "type": "string",
                            "description": "MIME type of the attachment"
                          },
                          "size": {
                            "type": "number",
                            "description": "Size in bytes"
                          },
                          "sender": {
                            "type": "string",
                            "enum": [
                              "user",
                              "assistant"
                            ],
                            "default": "user"
                          }
                        }
                      }
                    },
                    "ragDocuments": {
                      "type": "array",
                      "description": "RAG source documents used for this response",
                      "items": {
                        "type": "object",
                        "properties": {
                          "originalFileName": {
                            "type": "string",
                            "description": "Original filename in blob storage for downloads"
                          },
                          "displayFileName": {
                            "type": "string",
                            "description": "Display name with context (e.g., \"document.pdf (page 1)\")"
                          },
                          "score": {
                            "type": "number",
                            "description": "Relevance score (optional)"
                          },
                          "downloadUrl": {
                            "type": "string",
                            "description": "Download URL for the document"
                          },
                          "snippet": {
                            "type": "string",
                            "description": "Text snippet/preview from the document"
                          },
                          "sharePointWebUrl": {
                            "type": "string",
                            "description": "Optional SharePoint web URL for the document"
                          }
                        }
                      }
                    },
                    "appliedSkills": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "skillId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "instructions": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "invocationMode": {
                            "type": "string",
                            "enum": [
                              "automatic",
                              "onRequest",
                              "alwaysOn"
                            ]
                          },
                          "appliedReason": {
                            "type": "string",
                            "enum": [
                              "alwaysOn",
                              "explicitRequest",
                              "automaticMatch"
                            ]
                          },
                          "allowedTools": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "referenceHits": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "skillId": {
                                  "type": "string",
                                  "description": "Owning skill id"
                                },
                                "filePath": {
                                  "type": "string",
                                  "description": "Path to the reference file inside the skill bundle"
                                },
                                "chunkId": {
                                  "type": "string",
                                  "description": "Unique chunk identifier in the skill reference index"
                                },
                                "score": {
                                  "type": "number",
                                  "description": "Optional retrieval score"
                                },
                                "snippet": {
                                  "type": "string",
                                  "description": "Retrieved text snippet used at runtime"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "runIds": {
                      "type": "array",
                      "description": "Environment-run ids (envrun_*) for code-execution panels",
                      "items": {
                        "type": "string"
                      }
                    },
                    "historyTruncated": {
                      "type": "boolean"
                    },
                    "historyCompacted": {
                      "type": "boolean"
                    },
                    "droppedMessageCount": {
                      "type": "number"
                    },
                    "contextUsage": {
                      "type": "object",
                      "properties": {
                        "modelTokenLimit": {
                          "type": "number"
                        },
                        "reservedCompletionTokens": {
                          "type": "number"
                        },
                        "usableInputTokens": {
                          "type": "number"
                        },
                        "inputTokens": {
                          "type": "number"
                        },
                        "availableInputTokens": {
                          "type": "number"
                        },
                        "overflowTokens": {
                          "type": "number"
                        },
                        "inputUtilizationPercentage": {
                          "type": "number"
                        },
                        "isOverflow": {
                          "type": "boolean"
                        }
                      }
                    },
                    "stopped_by_user": {
                      "type": "boolean"
                    },
                    "complete": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp of when the message was updated"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/last": {
      "delete": {
        "summary": "Delete the last message",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/user-images": {
      "get": {
        "summary": "Get all images generated by or provided to the requesting user",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": true,
            "description": "ID of the user to get generated images for"
          }
        ],
        "responses": {
          "200": {
            "description": "Array of all image attachments from configured image models or with sender=assistant, with enhanced metadata",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Array of all image attachments from configured image models or with sender=assistant, with enhanced metadata",
                  "type": "object",
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "attachment": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "file"
                                ],
                                "description": "Type of attachment"
                              },
                              "content": {
                                "type": "string",
                                "description": "URL or File Path"
                              },
                              "filename": {
                                "type": "string",
                                "description": "Original filename"
                              },
                              "mimeType": {
                                "type": "string",
                                "description": "MIME type of the attachment"
                              },
                              "size": {
                                "type": "number",
                                "description": "Size in bytes"
                              },
                              "sender": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "assistant"
                                ],
                                "default": "user"
                              }
                            },
                            "description": "The image attachment data"
                          },
                          "prompt": {
                            "type": "string",
                            "description": "User prompt that generated this image"
                          },
                          "generatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the image was generated"
                          },
                          "conversationId": {
                            "type": "string",
                            "description": "ID of the conversation where the image was generated"
                          },
                          "conversationName": {
                            "type": "string",
                            "description": "Name of the conversation where the image was generated"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/user/{userId}/recent": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat History"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/project/{projectId}/recent": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat History"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/history/chat/messages/{id}/re-encrypt": {
      "patch": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Chat History"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/": {
      "post": {
        "summary": "Create a new project",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "userId",
                  "projectName"
                ],
                "properties": {
                  "projectId": {
                    "type": "string"
                  },
                  "userId": {
                    "type": "string"
                  },
                  "projectName": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "systemPrompt": {
                    "type": "string"
                  },
                  "sharedWithGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projectId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "projectName": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "systemPrompt": {
                      "type": "string"
                    },
                    "sharedWithGroupIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/{projectId}": {
      "patch": {
        "summary": "Update a project",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId"
                ],
                "properties": {
                  "projectName": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "systemPrompt": {
                    "type": "string"
                  },
                  "sharedWithGroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "userId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "summary": "Get a project by ID",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projectId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "projectName": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "systemPrompt": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isDeleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "summary": "Delete a project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/user/{userId}": {
      "get": {
        "summary": "List user projects",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userGroupIds",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/{projectId}/conversations/{conversationId}/link": {
      "patch": {
        "summary": "Link a conversation to a project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userGroupIds",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/conversations/{conversationId}/unlink": {
      "patch": {
        "summary": "Unlink a conversation from its project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "conversationId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/{projectId}/transcriptions/{jobId}/link": {
      "patch": {
        "summary": "Link a transcription to a project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userId",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userGroupIds",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "jobId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/transcriptions/{jobId}/unlink": {
      "patch": {
        "summary": "Unlink a transcription from its project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "jobId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/projects/{projectId}/conversations/{userId}": {
      "get": {
        "summary": "Get all conversations and transcriptions linked to a project",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "userGroupIds",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "conversationId": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "conversationName": {
                            "type": "string"
                          },
                          "isPinned": {
                            "type": "boolean"
                          },
                          "projectId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "isDeleted": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "transcriptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "JobId": {
                            "type": "string"
                          },
                          "Title": {
                            "type": "string"
                          },
                          "Description": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "Text": {
                            "type": "string"
                          },
                          "SpeakerSegments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Speaker": {
                                  "type": "string"
                                },
                                "Text": {
                                  "type": "string"
                                },
                                "Confidence": {
                                  "type": "number"
                                },
                                "StartTime": {
                                  "type": "string"
                                },
                                "EndTime": {
                                  "type": "string"
                                },
                                "BackgroundInformation": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "Language": {
                            "type": "string"
                          },
                          "CreatedAt": {
                            "type": "string"
                          },
                          "CompletedAt": {
                            "type": "string"
                          },
                          "ErrorMessage": {
                            "type": "string"
                          },
                          "ErrorCode": {
                            "type": "string"
                          },
                          "UserId": {
                            "type": "string"
                          },
                          "ProjectId": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/preset": {
      "post": {
        "summary": "Create a new preset",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userId",
                  "name"
                ],
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "agentId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "properties": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "presetId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "agentId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "properties": {
                      "type": "object"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/preset/{presetId}": {
      "patch": {
        "summary": "Update a preset",
        "tags": [
          "Chat History"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "agentId": {
                    "type": "string"
                  },
                  "properties": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            },
            "in": "path",
            "name": "presetId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "summary": "Delete a preset",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{24}$"
            },
            "in": "path",
            "name": "presetId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/history/api/v1/preset/user/{userId}": {
      "get": {
        "summary": "List user presets",
        "tags": [
          "Chat History"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "userId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.chat",
        "description": "**Required API-key scope:** `tools.chat` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.CreateAgentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.CreateAgentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.CreateAgentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userGroups",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categories",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isPublic",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "createdByMe",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortDirection",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PaginatedAgentsEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PaginatedAgentsEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PaginatedAgentsEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.DeleteAgentEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.DeleteAgentEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.DeleteAgentEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete",
        "description": "**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.UpdateAgentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.UpdateAgentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.UpdateAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMutationEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/indexed-count": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.IndexedAgentsCountEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.IndexedAgentsCountEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.IndexedAgentsCountEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/categories": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CreateCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CreateCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CreateCategoryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/categories/{id}": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.UpdateCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.UpdateCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.UpdateCategoryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Categories.CategoryDto"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete",
        "description": "**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process-content": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process-content/jobs": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process-content/jobs/{jobId}/status": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process-content/jobs/{jobId}/result": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/process-content/jobs/{jobId}/cancel": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/download/{blobPath}": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "blobPath",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/source-preview": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "blobPath",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxChars",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/office-pdf-preview": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "blobPath",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/circuit-breaker/reset": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/files/agents/{agentId}/document-counts": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileNames",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/initialize": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.InitializeIndexingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.InitializeIndexingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.InitializeIndexingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/file-result": {
      "put": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.UpdateFileProcessingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.UpdateFileProcessingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.UpdateFileProcessingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/progress": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/results": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/status": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/reset": {
      "delete": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete",
        "description": "**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/files": {
      "delete": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete",
        "description": "**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/{agentId}/cancel": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/indexing-tracking/cleanup-stuck-sessions": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.CleanupStuckSessionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.CleanupStuckSessionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.CleanupStuckSessionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}/index-all": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}/status": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}/documents/delete": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}/reindex-from-tracking": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/agents/{agentId}/search": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.AgentSearchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.AgentSearchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.AgentSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/health/dependencies": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.CreateKnowledgeBaseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.CreateKnowledgeBaseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.CreateKnowledgeBaseRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      },
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBasesEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBasesEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBasesEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      },
      "put": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.UpdateKnowledgeBaseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.UpdateKnowledgeBaseRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.UpdateKnowledgeBaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      },
      "delete": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.DeleteKnowledgeBaseEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.DeleteKnowledgeBaseEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.DeleteKnowledgeBaseEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete",
        "description": "**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/migrate-from-agents": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigrateFromAgentsResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigrateFromAgentsResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigrateFromAgentsResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/migratable-agents": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentsEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentsEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentsEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/migrate-from-agents/{agentId}": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/agents_Ingestion.Contracts.Common.ErrorResponse"
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/index-all": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.BulkIndexRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/status": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/documents/delete": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/reindex-from-tracking": {
      "post": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/document-counts": {
      "get": {
        "tags": [
          "Agents & Knowledge Bases"
        ],
        "parameters": [
          {
            "name": "kbId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileNames",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/semantic-search": {
      "post": {
        "summary": "Semantic search",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Perform a semantic search in the agent's index\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Search query"
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "Name of the agent (search index)"
          }
        ],
        "responses": {
          "200": {
            "description": "Semantic search results",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Semantic search results",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number",
                            "nullable": true
                          },
                          "lastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "contentType": {
                            "type": "string",
                            "nullable": true
                          },
                          "size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "siteId": {
                            "type": "string",
                            "nullable": true
                          },
                          "folderName": {
                            "type": "string",
                            "nullable": true
                          },
                          "fileId": {
                            "type": "string",
                            "nullable": true
                          },
                          "sharePointLastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "originalFolderPath": {
                            "type": "string",
                            "nullable": true
                          },
                          "flatStorage": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "lastProcessed": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "metadata_storage_last_modified": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_content_type": {
                            "type": "string",
                            "nullable": true
                          },
                          "@search.rerankerScore": {
                            "type": "number",
                            "nullable": true
                          },
                          "@search.captions": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                },
                                "highlights": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Semantic search failed",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Semantic search failed",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/vector-search": {
      "post": {
        "summary": "Vector search",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Perform a vector search in the agent's index\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Text query to convert to vector"
                  },
                  "topK": {
                    "type": "number",
                    "description": "Number of results to return",
                    "default": 5
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "Name of the agent (search index)"
          }
        ],
        "responses": {
          "200": {
            "description": "Vector search results",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Vector search results",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number",
                            "nullable": true
                          },
                          "lastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "contentType": {
                            "type": "string",
                            "nullable": true
                          },
                          "size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "siteId": {
                            "type": "string",
                            "nullable": true
                          },
                          "folderName": {
                            "type": "string",
                            "nullable": true
                          },
                          "fileId": {
                            "type": "string",
                            "nullable": true
                          },
                          "sharePointLastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "originalFolderPath": {
                            "type": "string",
                            "nullable": true
                          },
                          "flatStorage": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "lastProcessed": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "metadata_storage_last_modified": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_content_type": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Vector search failed",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Vector search failed",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/hybrid-search": {
      "post": {
        "summary": "Hybrid search (keyword + vector)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Perform a hybrid search in the agent's index using both keyword and vector search.\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Text query for keyword and vector search"
                  },
                  "topK": {
                    "type": "number",
                    "description": "Number of results to return",
                    "default": 5
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "Name of the agent (search index)"
          }
        ],
        "responses": {
          "200": {
            "description": "Hybrid search results",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hybrid search results",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number",
                            "nullable": true
                          },
                          "lastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "contentType": {
                            "type": "string",
                            "nullable": true
                          },
                          "size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "siteId": {
                            "type": "string",
                            "nullable": true
                          },
                          "folderName": {
                            "type": "string",
                            "nullable": true
                          },
                          "fileId": {
                            "type": "string",
                            "nullable": true
                          },
                          "sharePointLastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "originalFolderPath": {
                            "type": "string",
                            "nullable": true
                          },
                          "flatStorage": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "lastProcessed": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "metadata_storage_last_modified": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_content_type": {
                            "type": "string",
                            "nullable": true
                          },
                          "@search.rerankerScore": {
                            "type": "number",
                            "nullable": true
                          },
                          "@search.captions": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                },
                                "highlights": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Hybrid search failed",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hybrid search failed",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/iterative-hybrid-search": {
      "post": {
        "summary": "Iterative hybrid search with LLM judge",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Perform hybrid search with LLM-based retrieval judging and optional query refactoring/retry. The LLM will judge the retrieval quality, optionally refactor the query, and retry up to maxRetries times.\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Text query for search"
                  },
                  "topK": {
                    "type": "number",
                    "description": "Number of results to return",
                    "default": 5
                  },
                  "maxRetries": {
                    "type": "number",
                    "description": "Max LLM judge retries",
                    "default": 3
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "Name of the agent (search index)"
          }
        ],
        "responses": {
          "200": {
            "description": "Iterative hybrid search results with LLM judge verdict",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Iterative hybrid search results with LLM judge verdict",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string",
                      "description": "Original base query"
                    },
                    "refactoredQueries": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Array of refactored queries used during search iterations"
                    },
                    "attempts": {
                      "type": "number"
                    },
                    "judge": {
                      "type": "object",
                      "properties": {
                        "verdict": {
                          "type": "string"
                        },
                        "score": {
                          "type": "number"
                        },
                        "explanation": {
                          "type": "string"
                        },
                        "refactoredQuery": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number",
                            "nullable": true
                          },
                          "lastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "contentType": {
                            "type": "string",
                            "nullable": true
                          },
                          "size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "siteId": {
                            "type": "string",
                            "nullable": true
                          },
                          "folderName": {
                            "type": "string",
                            "nullable": true
                          },
                          "fileId": {
                            "type": "string",
                            "nullable": true
                          },
                          "sharePointLastModified": {
                            "type": "string",
                            "nullable": true
                          },
                          "originalFolderPath": {
                            "type": "string",
                            "nullable": true
                          },
                          "flatStorage": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "lastProcessed": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_size": {
                            "type": "integer",
                            "nullable": true
                          },
                          "metadata_storage_last_modified": {
                            "type": "string",
                            "nullable": true
                          },
                          "metadata_storage_content_type": {
                            "type": "string",
                            "nullable": true
                          },
                          "@search.rerankerScore": {
                            "type": "number",
                            "nullable": true
                          },
                          "@search.captions": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                },
                                "highlights": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Iterative hybrid search failed",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Iterative hybrid search failed",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/enhanced-multipart-search": {
      "post": {
        "summary": "Enhanced multipart search with file processing and RAG",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Process uploaded files, perform RAG search, and forward enhanced context to DIVI backend\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "ID of the agent (search index)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-batch-id",
            "required": false,
            "description": "Optional batch ID from a previous file processing request"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "header",
            "name": "x-user-id",
            "required": false,
            "description": "Optional user identifier for tracking file ownership"
          }
        ],
        "responses": {
          "200": {
            "description": "Streaming response from DIVI backend",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Streaming response from DIVI backend",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/hyde-search": {
      "post": {
        "summary": "HyDE-enhanced semantic search",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "description": "Perform semantic search using Hypothetical Document Embeddings (HyDE) for improved query expansion\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "The search query"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "single",
                      "multiple",
                      "reverse",
                      "adaptive"
                    ],
                    "description": "HyDE method to use (default: adaptive)"
                  },
                  "numDocuments": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "description": "Number of hypothetical documents to generate (default: 3)"
                  },
                  "domain": {
                    "type": "string",
                    "description": "Domain context for better document generation (default: general)"
                  },
                  "topK": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50,
                    "description": "Maximum number of results to return (default: 10)"
                  },
                  "maxRetries": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "description": "Maximum number of retries for iterative search (default: 3)"
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true,
            "description": "ID of the agent (search index)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful HyDE search results",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Successful HyDE search results",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "query": {
                      "type": "string"
                    },
                    "hydeMethod": {
                      "type": "string"
                    },
                    "hydeConfidence": {
                      "type": "number"
                    },
                    "hypotheticalDocuments": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "judgeVerdict": {
                      "type": "string"
                    },
                    "judgeScore": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "originalQuery": {
                          "type": "string"
                        },
                        "expandedQueries": {
                          "type": "integer"
                        },
                        "totalResults": {
                          "type": "integer"
                        },
                        "uniqueResults": {
                          "type": "integer"
                        },
                        "hydeMethod": {
                          "type": "string"
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "maxRetries": {
                          "type": "integer"
                        },
                        "attemptsPerDocument": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/agents/search/{agentId}/corpus/search": {
      "post": {
        "summary": "Corpus BM25 snippet search",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/documents": {
      "get": {
        "summary": "List corpus documents (wiki index)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/documents/{docId}": {
      "get": {
        "summary": "Read corpus document sections",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "docId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/entities": {
      "get": {
        "summary": "Look up corpus entities",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/graph": {
      "get": {
        "summary": "Knowledge graph (documents or relationships mode)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/resolve-references": {
      "post": {
        "summary": "AI-resolve each entity's reference document",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/search/{agentId}/corpus/consolidate-entities": {
      "post": {
        "summary": "AI-merge duplicate entities into canonical",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/skills/references/index": {
      "post": {
        "summary": "Replace indexed skill reference chunks",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/skills/references/search": {
      "post": {
        "summary": "Search indexed skill reference chunks",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/search": {
      "post": {
        "summary": "KB-scoped corpus BM25 snippet search (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/documents": {
      "get": {
        "summary": "KB-scoped corpus document index (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/documents/{docId}": {
      "get": {
        "summary": "KB-scoped read corpus document sections (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "docId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/entities": {
      "get": {
        "summary": "KB-scoped entity lookup (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/graph": {
      "get": {
        "summary": "KB-scoped knowledge graph (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/resolve-references": {
      "post": {
        "summary": "KB-scoped AI-resolve each entity's reference document (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/consolidate-entities": {
      "post": {
        "summary": "KB-scoped AI-merge duplicate entities into canonical (single partition)",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/build-graph": {
      "post": {
        "summary": "Build the knowledge graph (consolidate entities → resolve references) in the background",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.edit",
        "description": "**Required API-key scope:** `agents.edit` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/agents/knowledge-bases/{kbId}/corpus/graph-build-status": {
      "get": {
        "summary": "Progress of the current/last knowledge-graph build",
        "tags": [
          "Agent Search & Knowledge Graph"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "kbId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription": {
      "post": {
        "tags": [
          "Speech to Text"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/speech_TranscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/speech_TranscriptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/speech_TranscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription/{jobId}/status": {
      "get": {
        "tags": [
          "Speech to Text"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription/{jobId}/result": {
      "get": {
        "tags": [
          "Speech to Text"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription/previous": {
      "get": {
        "tags": [
          "Speech to Text"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription/{jobId}/details": {
      "get": {
        "tags": [
          "Speech to Text"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resultId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      },
      "patch": {
        "tags": [
          "Speech to Text"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resultId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/speech_PatchTranscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/speech_PatchTranscriptionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/speech_PatchTranscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Transcription/{jobId}": {
      "delete": {
        "tags": [
          "Speech to Text"
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resultId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/speech/api/Upload/upload": {
      "post": {
        "tags": [
          "Speech to Text"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "tools.transcript",
        "description": "**Required API-key scope:** `tools.transcript` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/drive/sites/{siteId}/items/{itemId}": {
      "get": {
        "operationId": "07_getItemById",
        "summary": "Get a specific item (file or folder) by ID",
        "tags": [
          "Microsoft Graph Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "itemId",
            "required": true,
            "description": "ID of the item to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Successful response",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/drive/sites/{siteId}/files/{fileId}/content": {
      "get": {
        "operationId": "08_downloadFile",
        "summary": "Download a file by ID",
        "tags": [
          "Microsoft Graph Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "fileId",
            "required": true,
            "description": "ID of the file to download"
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/json": {
                "schema": {
                  "description": "File content",
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/drive/sites/{siteId}/folders/{folderId}/structure": {
      "get": {
        "operationId": "10_getFileStructure",
        "summary": "Get hierarchical file structure starting from a folder",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Recursively retrieves the file structure from a starting folder to build a tree view\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "number"
            },
            "in": "query",
            "name": "depth",
            "required": false,
            "description": "Maximum depth to traverse (-1 for unlimited, default: 2)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderId",
            "required": true,
            "description": "ID of the folder to start from"
          }
        ],
        "responses": {
          "200": {
            "description": "Hierarchical file structure",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hierarchical file structure",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/graph_def-7"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/drive/sites/{siteId}/structure": {
      "get": {
        "operationId": "11_getRootFileStructure",
        "summary": "Get hierarchical file structure starting from the root",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Recursively retrieves the file structure from the root folder to build a tree view\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "number"
            },
            "in": "query",
            "name": "depth",
            "required": false,
            "description": "Maximum depth to traverse (-1 for unlimited, default: 2)"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          }
        ],
        "responses": {
          "200": {
            "description": "Hierarchical file structure",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Hierarchical file structure",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/graph_def-8"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/drive/sites/{siteId}/folders/{folderId}/saveToBlob": {
      "post": {
        "operationId": "09_downloadFolderToBlob",
        "summary": "Download all files in a folder and save to Azure Blob Storage",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Downloads all files in a folder and saves them to Azure Blob Storage using flat storage structure. Supports depth control: use depth=0 for current folder only, depth=1 for current + 1 level of subfolders, or depth=-1 for unlimited recursion (default). Requires a custom folder name in the request body that will be combined with user ID to create a unique folder name.\n\n**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "folderName"
                ],
                "properties": {
                  "folderName": {
                    "type": "string",
                    "description": "Custom folder name for storing the files (will be combined with user ID to create a unique folder name in format: folderName_userId)",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "depth": {
                    "type": "integer",
                    "description": "Maximum depth to recurse into subfolders. -1 = unlimited (default), 0 = current folder only, 1 = current + 1 level of subfolders, etc.",
                    "minimum": -1,
                    "default": 0
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "blobPrefix",
            "required": false,
            "description": "Optional prefix for blob storage paths (e.g., \"customer1/project2\")"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderId",
            "required": true,
            "description": "ID of the folder to process"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation summary",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Operation summary",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "success": {
                          "type": "number"
                        },
                        "failure": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "fileId": {
                            "type": "string"
                          },
                          "relativePath": {
                            "type": "string"
                          },
                          "blobUrl": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          },
                          "storagePath": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create"
      }
    },
    "/graph/drive/sites/{siteId}/saveFilesToBlob": {
      "post": {
        "operationId": "12_saveSelectedFilesToBlob",
        "summary": "Save selected files to Azure Blob Storage",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Downloads the specified files by ID and saves them to Azure Blob Storage. The folder name will be combined with user ID to create a unique folder name in format: folderName_userId. The siteId is stored as metadata in the blob.\n\n**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileIds",
                  "folderName"
                ],
                "properties": {
                  "fileIds": {
                    "type": "array",
                    "description": "List of file IDs to save to Azure Blob Storage",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 200
                  },
                  "folderName": {
                    "type": "string",
                    "description": "Custom folder name for storing the files (will be combined with user ID to create a unique folder name in format: folderName_userId)",
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "blobPrefix",
            "required": false,
            "description": "Optional prefix for blob storage paths (e.g., \"customer1/project2\")"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/graph_def-5"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create"
      }
    },
    "/graph/drive/sites/{siteId}/drives/{driveId}/saveFilesToBlob": {
      "post": {
        "operationId": "14_saveSelectedFilesFromDriveToBlob",
        "summary": "Save selected files from a specific drive to Azure Blob Storage",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Downloads the specified files by ID from a specific document library (drive) and saves them to Azure Blob Storage. The folder name will be combined with user ID to create a unique folder name in format: folderName_userId. The siteId and driveId are stored as metadata in the blob.\n\n**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileIds",
                  "folderName"
                ],
                "properties": {
                  "fileIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of file IDs to save to blob storage",
                    "minItems": 1,
                    "maxItems": 200
                  },
                  "folderName": {
                    "type": "string",
                    "description": "Custom folder name for storing the files (will be combined with user ID to create a unique folder name in format: folderName_userId)",
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "blobPrefix",
            "required": false,
            "description": "Optional prefix for blob storage paths"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true,
            "description": "Drive ID of the document library"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/graph_def-5"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create"
      }
    },
    "/graph/drive/sites/{siteId}/drives/{driveId}/folders/{folderId}/saveToBlob": {
      "post": {
        "operationId": "15_downloadDriveFolderToBlob",
        "summary": "Download all files in a folder from a specific drive and save to Azure Blob Storage",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Downloads all files in a folder from a specific document library (drive) and saves them to Azure Blob Storage using flat storage structure. Supports depth control: use depth=0 for current folder only, depth=1 for current + 1 level of subfolders, or depth=-1 for unlimited recursion (default). The folder name will be combined with user ID to create a unique folder name. The siteId and driveId are stored as metadata in the blob.\n\n**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "folderName"
                ],
                "properties": {
                  "folderName": {
                    "type": "string",
                    "description": "Custom folder name for storing the files (will be combined with user ID to create a unique folder name in format: folderName_userId)",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "depth": {
                    "type": "integer",
                    "description": "Maximum depth to recurse into subfolders. -1 = unlimited (default), 0 = current folder only, 1 = current + 1 level of subfolders, etc.",
                    "minimum": -1,
                    "default": -1
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "blobPrefix",
            "required": false,
            "description": "Optional prefix for blob storage paths (e.g., \"customer1/project2\")"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true,
            "description": "Drive ID of the document library"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderId",
            "required": true,
            "description": "ID of the folder to process"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation summary",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Operation summary",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "success": {
                          "type": "number"
                        },
                        "failure": {
                          "type": "number"
                        },
                        "skipped": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "fileId": {
                            "type": "string"
                          },
                          "relativePath": {
                            "type": "string"
                          },
                          "blobUrl": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          },
                          "storagePath": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create"
      }
    },
    "/graph/blob-storage/folder/{folderName}/status": {
      "get": {
        "operationId": "10_checkFileStatus",
        "summary": "Check status of files in blob folder compared to SharePoint",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Compares file metadata in blob storage with current SharePoint data to identify outdated files\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "Name of the blob folder to check"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/blob-storage/folder/{folderName}/outdated": {
      "get": {
        "operationId": "11_getOutdatedFiles",
        "summary": "Get only outdated files that need manual re-upload",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns only files that are outdated compared to their SharePoint versions and need re-upload\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "Name of the blob folder to check"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/blob-storage/folder/{folderName}/files": {
      "get": {
        "operationId": "12_listBlobFolderFiles",
        "summary": "List all files in a specific blob folder",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns metadata of all files stored in the specified blob folder\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "Name of the blob folder to list"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      },
      "delete": {
        "operationId": "14_deleteBlobFiles",
        "summary": "Delete specific files from a blob folder",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Deletes specific files by name from the specified folder in Azure Blob Storage. This operation cannot be undone. Use with caution.\n\n**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fileNames"
                ],
                "properties": {
                  "fileNames": {
                    "type": "array",
                    "description": "Array of file names to delete from the folder",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    },
                    "minItems": 1
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "Name of the folder containing the files to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "All files successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "description": "All files successfully deleted",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "folderName": {
                          "type": "string"
                        },
                        "totalRequested": {
                          "type": "number"
                        },
                        "deletedCount": {
                          "type": "number"
                        },
                        "notFoundCount": {
                          "type": "number"
                        },
                        "errorCount": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fileName": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "deleted",
                              "not_found",
                              "error"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Partial success - some files deleted, some failed or not found",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Partial success - some files deleted, some failed or not found",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "partial_success"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "folderName": {
                          "type": "string"
                        },
                        "totalRequested": {
                          "type": "number"
                        },
                        "deletedCount": {
                          "type": "number"
                        },
                        "notFoundCount": {
                          "type": "number"
                        },
                        "errorCount": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fileName": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "deleted",
                              "not_found",
                              "error"
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - invalid input parameters",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete"
      }
    },
    "/graph/blob-storage/folder/{folderName}": {
      "delete": {
        "operationId": "13_deleteBlobFolder",
        "summary": "Delete an entire folder and all its contents from Azure Blob Storage",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Permanently deletes all files in the specified folder from Azure Blob Storage. This operation cannot be undone. Use with caution.\n\n**Required API-key scope:** `agents.delete` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "Name of the folder to delete (all files with this prefix will be deleted)"
          }
        ],
        "responses": {
          "200": {
            "description": "Folder successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Folder successfully deleted",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "folderName": {
                          "type": "string"
                        },
                        "totalFound": {
                          "type": "number"
                        },
                        "deletedCount": {
                          "type": "number"
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "207": {
            "description": "Folder deletion completed with some errors",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Folder deletion completed with some errors",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object",
                      "properties": {
                        "folderName": {
                          "type": "string"
                        },
                        "totalFound": {
                          "type": "number"
                        },
                        "deletedCount": {
                          "type": "number"
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid folder name",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - invalid folder name",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.delete"
      }
    },
    "/graph/blob/folders/{folderName}/files": {
      "get": {
        "operationId": "13_listBlobFolderFiles",
        "summary": "List all files in a specific blob folder",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Lists all files stored in a specific blob folder (e.g., devtest_635e3aba-826a-4637-a94e-fc89b43d6046) with their metadata including fileId, siteId, SharePoint last modified date, and processing timestamp.\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]+$",
              "minLength": 1
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "The complete folder name in blob storage (e.g., devtest_635e3aba-826a-4637-a94e-fc89b43d6046)"
          }
        ],
        "responses": {
          "200": {
            "description": "List of files in the blob folder",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of files in the blob folder",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "folderName": {
                      "type": "string",
                      "description": "The folder name that was queried"
                    },
                    "totalFiles": {
                      "type": "number",
                      "description": "Total number of files found in the folder"
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fileName": {
                            "type": "string",
                            "description": "Name of the file"
                          },
                          "fileId": {
                            "type": "string",
                            "description": "SharePoint file ID"
                          },
                          "siteId": {
                            "type": "string",
                            "description": "SharePoint site ID"
                          },
                          "sharePointLastModified": {
                            "type": "string",
                            "description": "Last modified date from SharePoint (ISO format)"
                          },
                          "lastProcessed": {
                            "type": "string",
                            "description": "Timestamp when the file was last processed/uploaded (ISO format)"
                          },
                          "blobUrl": {
                            "type": "string",
                            "description": "Direct URL to the blob in Azure Storage"
                          },
                          "size": {
                            "type": "number",
                            "description": "File size in bytes"
                          },
                          "originalFolderPath": {
                            "type": "string",
                            "description": "Original folder path in SharePoint"
                          }
                        },
                        "required": [
                          "fileName",
                          "fileId",
                          "siteId",
                          "sharePointLastModified",
                          "lastProcessed"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid folder name",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request - invalid folder name",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/blob/folders/{folderName}/status": {
      "get": {
        "operationId": "14_checkBlobFileStatus",
        "summary": "Check status of files in blob folder",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Checks if files in blob storage are up-to-date compared to SharePoint. Shows which files are current, outdated, or have unknown status.\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "in": "query",
            "name": "page",
            "required": false
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "in": "query",
            "name": "pageSize",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "search",
            "required": false,
            "description": "Optional case-insensitive file name filter"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "fileIds",
            "required": false,
            "description": "Optional comma-separated list of file IDs to limit status checks"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]+$",
              "minLength": 1
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "The complete folder name in blob storage"
          }
        ],
        "responses": {
          "200": {
            "description": "File status check results",
            "content": {
              "application/json": {
                "schema": {
                  "description": "File status check results",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "folderName": {
                      "type": "string"
                    },
                    "totalFiles": {
                      "type": "number"
                    },
                    "outdatedFiles": {
                      "type": "number"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "current": {
                          "type": "number"
                        },
                        "outdated": {
                          "type": "number"
                        },
                        "unknown": {
                          "type": "number"
                        }
                      }
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fileName": {
                            "type": "string"
                          },
                          "fileId": {
                            "type": "string"
                          },
                          "siteId": {
                            "type": "string"
                          },
                          "sharePointLastModified": {
                            "type": "string"
                          },
                          "lastProcessed": {
                            "type": "string"
                          },
                          "blobLastModified": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "current",
                              "outdated",
                              "unknown"
                            ]
                          },
                          "daysSinceLastUpdate": {
                            "type": "number"
                          },
                          "size": {
                            "type": "number"
                          },
                          "originalFolderPath": {
                            "type": "string"
                          },
                          "blobUrl": {
                            "type": "string"
                          },
                          "webUrl": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "number"
                        },
                        "pageSize": {
                          "type": "number"
                        },
                        "totalPages": {
                          "type": "number"
                        },
                        "totalItems": {
                          "type": "number"
                        },
                        "hasNextPage": {
                          "type": "boolean"
                        },
                        "hasPreviousPage": {
                          "type": "boolean"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/blob/folders/{folderName}/outdated": {
      "get": {
        "operationId": "15_getOutdatedFiles",
        "summary": "Get outdated files that need re-upload",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns only files that are outdated in blob storage compared to SharePoint and need manual re-upload.\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]+$",
              "minLength": 1,
              "maxLength": 200
            },
            "in": "path",
            "name": "folderName",
            "required": true,
            "description": "The complete folder name in blob storage"
          }
        ],
        "responses": {
          "200": {
            "description": "Outdated files that need re-upload",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Outdated files that need re-upload",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ]
                    },
                    "folderName": {
                      "type": "string"
                    },
                    "outdatedFilesCount": {
                      "type": "number"
                    },
                    "outdatedFiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fileName": {
                            "type": "string"
                          },
                          "fileId": {
                            "type": "string"
                          },
                          "siteId": {
                            "type": "string"
                          },
                          "sharePointLastModified": {
                            "type": "string"
                          },
                          "blobLastModified": {
                            "type": "string"
                          },
                          "lastProcessed": {
                            "type": "string"
                          },
                          "daysBehind": {
                            "type": "number",
                            "description": "Days the blob is behind SharePoint"
                          },
                          "size": {
                            "type": "number"
                          },
                          "originalFolderPath": {
                            "type": "string"
                          },
                          "blobUrl": {
                            "type": "string"
                          },
                          "actionRequired": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Internal server error",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "error"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/drive/folders-with-site-ids": {
      "get": {
        "operationId": "02_listFoldersWithSiteIds",
        "summary": "List OneDrive root folders with tenant and site IDs",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Retrieves all folders from the root of OneDrive and attempts to identify their tenant, site IDs, and drive IDs\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "folder": {
                        "$ref": "#/components/schemas/graph_def-0"
                      },
                      "tenant": {
                        "type": "string"
                      },
                      "sitePath": {
                        "type": "string"
                      },
                      "siteId": {
                        "type": "string"
                      },
                      "driveId": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/sites": {
      "get": {
        "operationId": "getAllUserSites",
        "summary": "Get all sites that the user has access to",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all SharePoint sites accessible to the authenticated user\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "List of accessible sites",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of accessible sites",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/graph_def-6"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/sites/{siteId}/drives": {
      "get": {
        "operationId": "getSiteDrives",
        "summary": "Get all drives (document libraries) for a site",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all document libraries and drives for a specific SharePoint site\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "List of site drives",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of site drives",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/sites/{siteId}/drive": {
      "get": {
        "operationId": "getSiteDefaultDrive",
        "summary": "Get the default drive for a specific site",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns the default document library (drive) information for the specified site\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID of the SharePoint site"
          }
        ],
        "responses": {
          "200": {
            "description": "Default drive information",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Default drive information",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "webUrl": {
                          "type": "string"
                        },
                        "driveType": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/sites/{siteId}/drives/{driveId}/contents": {
      "get": {
        "operationId": "getDriveContents",
        "summary": "Get contents of a specific drive",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all files and folders in the root of a specific SharePoint drive/document library\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Drive contents",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Drive contents",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "children": {
                          "type": "array"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/sites/{siteId}/drives/{driveId}/folders/{folderId}/contents": {
      "get": {
        "summary": "Get folder contents within a specific drive",
        "tags": [
          "Microsoft Graph Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true,
            "description": "Site ID"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true,
            "description": "Drive ID"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderId",
            "required": true,
            "description": "Folder ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "modified": {
                            "type": "string"
                          },
                          "downloadUrl": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "parentPath": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/sites/{siteId}/lists": {
      "get": {
        "operationId": "getSiteLists",
        "summary": "Get all lists for a site",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all lists (including document libraries) for a specific SharePoint site\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "siteId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "List of site lists",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of site lists",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/root/drives": {
      "get": {
        "operationId": "getTenantRootDrives",
        "summary": "Get all root-level drives (Viva Connections, tenant-level document libraries)",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all root-level drives accessible to the authenticated user, including Viva Connections and tenant-level shared libraries\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "List of root-level drives",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of root-level drives",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/root/lists": {
      "get": {
        "operationId": "getTenantRootLists",
        "summary": "Get all root-level lists (Viva Connections, etc.)",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all root-level lists including Viva Connections documents\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "responses": {
          "200": {
            "description": "List of root-level lists",
            "content": {
              "application/json": {
                "schema": {
                  "description": "List of root-level lists",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/root/drives/{driveId}/contents": {
      "get": {
        "operationId": "getTenantRootDriveContents",
        "summary": "Get contents of a root-level drive (Viva Connections documents)",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all files and folders in the root of a root-level drive (e.g., Viva Connections)\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true,
            "description": "Drive ID of the root-level drive"
          }
        ],
        "responses": {
          "200": {
            "description": "Root drive contents",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Root drive contents",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "children": {
                          "type": "array"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/root/drives/{driveId}/folders/{folderId}/contents": {
      "get": {
        "operationId": "getTenantRootDriveFolderContents",
        "summary": "Get folder contents within a root-level drive (Viva Connections)",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns all files and folders within a specific folder in a root-level drive\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "driveId",
            "required": true,
            "description": "Drive ID of the root-level drive"
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "folderId",
            "required": true,
            "description": "Folder ID within the drive"
          }
        ],
        "responses": {
          "200": {
            "description": "Folder contents",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Folder contents",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/root/lists/{listId}/drive": {
      "get": {
        "operationId": "getTenantRootListDrive",
        "summary": "Get drive associated with a root-level list (Viva Connections documents)",
        "tags": [
          "Microsoft Graph Files"
        ],
        "description": "Returns the drive object associated with a root-level list such as Viva Connections\n\n**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes).",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "listId",
            "required": true,
            "description": "List ID of the root-level list"
          }
        ],
        "responses": {
          "200": {
            "description": "Root list drive information",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Root list drive information",
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "webUrl": {
                          "type": "string"
                        },
                        "driveType": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "500": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read"
      }
    },
    "/graph/api/template-documents/add-from-drive": {
      "post": {
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Microsoft Graph Files"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.create",
        "description": "**Required API-key scope:** `agents.create` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/api/template-documents/agent/{agentId}/prompt/{promptText}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "agentId",
            "required": true
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "promptText",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Microsoft Graph Files"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/graph/api/template-documents/processing-status/{processingId}": {
      "get": {
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "processingId",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenError"
          },
          "502": {
            "$ref": "#/components/responses/UpstreamUnavailableError"
          }
        },
        "tags": [
          "Microsoft Graph Files"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "x-required-permission": "agents.read",
        "description": "**Required API-key scope:** `agents.read` (`agents.manager` grants all `agents.*` scopes)."
      }
    },
    "/api/v1/api-keys": {
      "post": {
        "operationId": "createApiKey",
        "summary": "Create an API key",
        "tags": [
          "API Key Management"
        ],
        "description": "Creates a personal API key bound to the calling user. The plaintext key is returned only once and cannot be retrieved again.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "permissions",
                  "expiresInDays"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "permissions": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    },
                    "description": "Scopes for the key — a subset of the scopes returned by GET /api/v1/scopes"
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Plaintext API key — shown only once"
                    },
                    "id": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "listApiKeys",
        "summary": "List my API keys",
        "tags": [
          "API Key Management"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "prefix": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "permissions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "isRevoked": {
                        "type": "boolean"
                      },
                      "lastUsedAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/api-keys/{id}": {
      "delete": {
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key",
        "tags": [
          "API Key Management"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/api/v1/scopes": {
      "get": {
        "operationId": "listScopes",
        "summary": "List issuable API-key scopes",
        "tags": [
          "API Key Management"
        ],
        "description": "Returns the scopes the calling user holds that can be granted to an API key, with display labels.",
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Personal API key (prefix `afk_`). Scopes are fixed at key creation."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Azure AD (MSAL) user token — used only by the API Key Management endpoints."
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "Missing or invalid credentials (`Missing X-Api-Key header` / `Invalid or expired API key`).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ForbiddenError": {
        "description": "The API key lacks the required scope (`Insufficient permissions. Required: <scope>`).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "UpstreamUnavailableError": {
        "description": "The upstream service did not respond (gateway 502).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "agents_Ingestion.Contracts.Agents.AgentDto": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "azureIndexExists": {
            "type": "boolean"
          },
          "hasIndex": {
            "type": "boolean"
          },
          "documentCount": {
            "type": "integer",
            "format": "int64"
          },
          "storageSize": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "indexedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "modelProperties": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.ModelPropertiesDto"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "private": {
            "type": "boolean"
          },
          "createdBy": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.CreatedByDto"
          },
          "prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PromptDto"
            },
            "nullable": true
          },
          "welcomeMessage": {
            "type": "string",
            "nullable": true
          },
          "mcpSettings": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMcpSettingsDto"
          },
          "canEdit": {
            "type": "boolean"
          },
          "canDelete": {
            "type": "boolean"
          },
          "knowledgeBaseIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "available": {
            "type": "boolean"
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.AgentEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "agent": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentDto"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.AgentMcpServerSettingsDto": {
        "type": "object",
        "properties": {
          "serverId": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          },
          "disabledTools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.AgentMcpSettingsDto": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "nullable": true
          },
          "servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMcpServerSettingsDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.AgentMutationEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "agent": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentDto"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.CreateAgentRequest": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "modelProperties": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.ModelPropertiesDto"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "private": {
            "type": "boolean",
            "nullable": true
          },
          "prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PromptDto"
            },
            "nullable": true
          },
          "welcomeMessage": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "mcpSettings": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMcpSettingsDto"
          },
          "knowledgeBaseIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.CreatedByDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "profilePic": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.DeleteAgentEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.IndexedAgentsCountEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.ModelPropertiesDto": {
        "type": "object",
        "properties": {
          "temperature": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "maxTokens": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "topP": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "topK": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "searchRetries": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frequencyPenalty": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "presencePenalty": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "systemPrompt": {
            "type": "string",
            "nullable": true
          },
          "defaultModel": {
            "type": "string",
            "nullable": true
          },
          "reasoningEffort": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.PaginatedAgentsEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentDto"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.PromptDto": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "nullable": true
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "templateDocumentId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Agents.UpdateAgentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "modelProperties": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.ModelPropertiesDto"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "private": {
            "type": "boolean",
            "nullable": true
          },
          "prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.PromptDto"
            },
            "nullable": true
          },
          "welcomeMessage": {
            "type": "string",
            "nullable": true
          },
          "mcpSettings": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Agents.AgentMcpSettingsDto"
          },
          "knowledgeBaseIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Categories.CategoryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "agentCount": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Categories.CreateCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Categories.UpdateCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Common.ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.IndexingTracking.CleanupStuckSessionsRequest": {
        "type": "object",
        "properties": {
          "timeoutMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "specificAgentId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.IndexingTracking.FileProcessingStatus": {
        "enum": [
          0,
          1,
          2,
          3
        ],
        "type": "integer",
        "format": "int32"
      },
      "agents_Ingestion.Contracts.IndexingTracking.InitializeIndexingRequest": {
        "type": "object",
        "properties": {
          "totalFiles": {
            "type": "integer",
            "format": "int32"
          },
          "fileNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.IndexingTracking.UpdateFileProcessingRequest": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.IndexingTracking.FileProcessingStatus"
          },
          "timeTaken": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "chunks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Ingestion.AgentSearchRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "nullable": true
          },
          "top": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "skip": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "siteId": {
            "type": "string",
            "nullable": true
          },
          "folderName": {
            "type": "string",
            "nullable": true
          },
          "fileId": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "orderBy": {
            "type": "string",
            "nullable": true
          },
          "minScore": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "minRerankerScore": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "semantic": {
            "type": "boolean",
            "nullable": true
          },
          "useVector": {
            "type": "boolean",
            "nullable": true
          },
          "hybrid": {
            "type": "boolean",
            "nullable": true
          },
          "vectorTopK": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Ingestion.BulkIndexRequest": {
        "type": "object",
        "properties": {
          "siteIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "batchSize": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "stream": {
            "type": "boolean",
            "nullable": true
          },
          "force": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Ingestion.DeleteDocumentsFilter": {
        "type": "object",
        "properties": {
          "siteId": {
            "type": "string",
            "nullable": true
          },
          "folderName": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "fileId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Ingestion.DeleteDocumentsRequest": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "fileNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "filter": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Ingestion.DeleteDocumentsFilter"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.CreateKnowledgeBaseRequest": {
        "type": "object",
        "properties": {
          "knowledgeBaseId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "private": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.CreatedByDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "profilePic": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.DeleteKnowledgeBaseEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "assignedAgentCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseDto": {
        "type": "object",
        "properties": {
          "knowledgeBaseId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "private": {
            "type": "boolean"
          },
          "createdBy": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.CreatedByDto"
          },
          "searchBackend": {
            "type": "string",
            "nullable": true
          },
          "hasIndex": {
            "type": "boolean"
          },
          "documentCount": {
            "type": "integer",
            "format": "int64"
          },
          "storageSize": {
            "type": "integer",
            "format": "int64"
          },
          "indexedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "reindexRecommended": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "assignedAgentCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "knowledgeBase": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseDto"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseMutationEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "knowledgeBase": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseDto"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBasesEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "knowledgeBases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.KnowledgeBaseDto"
            },
            "nullable": true
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentDto": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "documentCount": {
            "type": "integer",
            "format": "int64"
          },
          "indexedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "isCosmosOrigin": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentsEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/agents_Ingestion.Contracts.KnowledgeBases.MigratableAgentDto"
            },
            "nullable": true
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.MigrateFromAgentsResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "agentsMigrated": {
            "type": "integer",
            "format": "int32"
          },
          "agentsSkippedAlreadyMigrated": {
            "type": "integer",
            "format": "int32"
          },
          "knowledgeBasesCreated": {
            "type": "integer",
            "format": "int32"
          },
          "agentsUpdated": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.KnowledgeBases.UpdateKnowledgeBaseRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "icon": {
            "type": "string",
            "nullable": true
          },
          "iconColor": {
            "type": "string",
            "nullable": true
          },
          "userGroups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "private": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Templates.CreateTemplateDocumentRequest": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "promptText": {
            "type": "string",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Templates.TemplateMetadata"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Templates.ReplaceTemplateDocumentRequest": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/agents_Ingestion.Contracts.Templates.TemplateMetadata"
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Templates.TemplateMetadata": {
        "type": "object",
        "properties": {
          "originalSize": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "uploadedBy": {
            "type": "string",
            "nullable": true
          },
          "sourceUrl": {
            "type": "string",
            "nullable": true
          },
          "wasLimitReached": {
            "type": "boolean",
            "nullable": true
          },
          "chunksProcessed": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "totalChunks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "agents_Ingestion.Contracts.Templates.UpdatePromptTextRequest": {
        "type": "object",
        "properties": {
          "newPromptText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "speech_McpRequest": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "nullable": true
          },
          "method": {
            "type": "string",
            "nullable": true
          },
          "params": {
            "type": "object",
            "additionalProperties": {},
            "nullable": true
          },
          "id": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "speech_PatchSpeakerElements": {
        "type": "object",
        "properties": {
          "speaker": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "nullable": true
          },
          "endTime": {
            "type": "string",
            "nullable": true
          },
          "confidence": {
            "type": "number",
            "format": "double"
          },
          "backgroundInformation": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "speech_PatchTranscriptionRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "speakerSegments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/speech_PatchSpeakerElements"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "speech_TranscriptionRequest": {
        "type": "object",
        "properties": {
          "blobUrl": {
            "type": "string",
            "nullable": true
          },
          "blobUrls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "audioDurationSeconds": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "graph_def-0": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "webUrl": {
            "type": "string"
          },
          "file": {
            "type": "object",
            "properties": {
              "mimeType": {
                "type": "string"
              }
            },
            "nullable": true
          },
          "folder": {
            "type": "object",
            "properties": {
              "childCount": {
                "type": "number"
              }
            },
            "nullable": true
          }
        },
        "title": "DriveItem"
      },
      "graph_def-1": {
        "type": "object",
        "properties": {
          "driveId": {
            "type": "string"
          }
        },
        "title": "DriveId"
      },
      "graph_def-2": {
        "type": "string",
        "format": "binary",
        "title": "FileDownload"
      },
      "graph_def-3": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/graph_def-0"
            }
          }
        },
        "title": "FolderChildrenResponse"
      },
      "graph_def-4": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "title": "ItemResponse"
      },
      "graph_def-5": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "summary": {
            "type": "object",
            "properties": {
              "total": {
                "type": "number"
              },
              "success": {
                "type": "number"
              },
              "failure": {
                "type": "number"
              },
              "skipped": {
                "type": "number"
              }
            }
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "updated",
                    "skipped",
                    "failure"
                  ]
                },
                "fileName": {
                  "type": "string"
                },
                "relativePath": {
                  "type": "string"
                },
                "blobUrl": {
                  "type": "string"
                },
                "size": {
                  "type": "number"
                },
                "fileId": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              }
            }
          }
        },
        "title": "SaveSelectedFilesResponse"
      },
      "graph_def-6": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "webUrl": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "displayName",
          "webUrl"
        ],
        "title": "Site"
      },
      "graph_def-7": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "siteId": {
            "type": "string"
          },
          "parentId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "folder",
              "file"
            ]
          },
          "mimeType": {
            "type": "string"
          },
          "webUrl": {
            "type": "string"
          },
          "createdDateTime": {
            "type": "string"
          },
          "lastModifiedDateTime": {
            "type": "string"
          },
          "size": {
            "type": "number"
          },
          "fileCount": {
            "type": "number",
            "description": "Total number of supported files in this folder and all subfolders (only for folders)"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/graph_def-7"
            }
          }
        },
        "title": "folderStructure"
      },
      "graph_def-8": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "siteId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/graph_def-8"
            }
          },
          "parentId": {
            "type": "string"
          },
          "webUrl": {
            "type": "string"
          },
          "createdDateTime": {
            "type": "string"
          },
          "lastModifiedDateTime": {
            "type": "string"
          },
          "size": {
            "type": "number"
          },
          "mimeType": {
            "type": "string"
          },
          "fileCount": {
            "type": "number",
            "description": "Total number of supported files in this folder and all subfolders (only for folders)"
          }
        },
        "title": "rootFolderStructure"
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Platform APIs",
      "tags": [
        "Chat (divi)",
        "Chat History",
        "Agents & Knowledge Bases",
        "Agent Search & Knowledge Graph",
        "Speech to Text",
        "Microsoft Graph Files"
      ]
    },
    {
      "name": "Key Management",
      "tags": [
        "API Key Management"
      ]
    }
  ]
}