跳到主要内容

aiEditorToolsCall

aiEditorToolsCall_200_response aiEditorToolsCall(AiEditorToolsCallRequest)

POST /api/2.0/ai/editor-tools/call

Call an editor tool

Executes one DocSpace tool on behalf of the document editor's AI plugin, server-side and under the caller's own credentials, so the browser never holds the transport. name has to be one of the tools GET api/2.0/ai/editor-tools/list reports; anything else, including a tool the editor is not allowed to reach, is refused. The result is always returned as a string - a structured result is serialised - because the plugin relays it to the model verbatim. A tool that fails does so inside that string as an error payload rather than as an HTTP status, so check the content before trusting it.

Parameters​

NameInTypeDescriptionNotes
AiEditorToolsCallRequestbodyAiEditorToolsCallRequestThe tool to run: name from GET api/2.0/ai/editor-tools/list, arguments matching that tool's input schema, and an optional entityId for the room to run it in.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The tool's output as a string. A tool that failed reports it inside that string.aiEditorToolsCall_200_response-
400The tool name is not one this portal exposes.AiErrorResponse-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API.AiErrorResponse-
413The request body is larger than 100 KB, the JSON parser's limit on this route.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

aiEditorToolsCall_200_response

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json