Skip to main content

aiExportTextToDocx

aiExportTextToDocx_202_response aiExportTextToDocx(AiExportTextToDocxRequest)

POST /api/2.0/ai/text-to-docx

Start markdown export

Queues a markdown export and answers 202 as soon as the job is accepted, without waiting for it. title, content and folderId are all required, and a content of only whitespace counts as missing even though it is not empty. format is optional and selects the output - Docx (the default), Pdf, or Md, which stores the markdown verbatim instead of converting it. The conversion runs in the AI worker, which saves the .docx into the target folder - an agent room resolves to its own result-storage subfolder - so there is nothing to poll here: completion arrives as the ordinary folder-modified socket event. This route accepts a body of up to 15 MB rather than the 100 KB the rest of the API allows, because a whole thread transcript is sent in one request.

Parameters​

NameInTypeDescriptionNotes
AiExportTextToDocxRequestbodyAiExportTextToDocxRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
202Confirms the export was queued. The file arrives in the target folder later, announced by a folder-modified socket event.aiExportTextToDocx_202_response-
400title, content or folderId is missing, or format is not one of Docx, Pdf, Md.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 transcript is larger than 15 MB, this route's own parser limit.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

aiExportTextToDocx_202_response

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

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