Create File Conversion Task
POST/openapi/v1/files/convert-tasks
Asynchronously convert a non-PDF file (xlsx / docx / html, etc.) to PDF.
Workflow:
- Call Upload File to obtain the source
FileId. - Call this endpoint to submit a conversion task and receive a
TaskId. - Poll Query File Conversion Tasks until
TaskStatus=success, then readConvertedFileId. - Use
ConvertedFileIdasDocuments[].FileIdin Quick Create Envelope.
Supported source formats: doc / docx / xls / xlsx / html / jpg / jpeg / png / bmp / txt
Not supported: pdf (already the target format; use it directly).
Conversion typically takes 2–10 seconds; polling every 1–2 seconds is recommended.
Request Parameters
Header Parameters
AuthorizationRequiredstring
Bearer <access_token>
X-Operator-User-IdOptionalstring
Operator user ID. Not required in Authorization Code mode (the authorized user is used automatically). Optional in Client Credentials mode — omit to use the system user ID.
Request Body
application/jsonFileIdRequiredstring
Source file ID (required), returned by the UploadFile endpoint. Source file type must be one of doc / docx / xls / xlsx / html / jpg / jpeg / png / bmp / txt
Request Example
{
"FileId": "SGf1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6"
}Response Parameters
Response.Data
TaskIdOptionalstring
Conversion task ID; clients poll status via QueryFileConvertTasks
Response Example
{
"Response": {
"RequestId": "req-abc123",
"Error": null,
"Data": {
"TaskId": "20260709175117139808"
}
}
}Error Codes
| Error Code | Description |
|---|---|
INVALID_REQUEST | Invalid parameters (FileId is empty, the source file is already a PDF, source file type is not in the supported list, FileId does not belong to the current space, etc.) |
OPENAPI.OPERATOR_USER_NOT_FOUND | The X-Operator-User-Id is not a member of this space |
INTERNAL_ERROR | Internal service error (upstream conversion service unavailable, etc.) |