Skip to main content

Confirm direct upload completion

Requirements, permissions, request and response fields, and error handling.

Request and permissions

POST https://openapi.qwenwork.ai/v1/drive/direct-uploads/{session_id}/complete Authentication: Authorization: Bearer <access_token>. Use an access token obtained through user OAuth authorization. Required business Scope: drive.upload.write Authorization types declared in the contract: Organization authorization (organization) and personal authorization (personal). The platform must enable the Scope for your application. The user must have the relevant business permissions and access to the target resource. Availability of personal and organization authorization for your application depends on its console configuration.

Behavior and limitations

Confirm direct upload completion. Signed URLs expire. Do not log or share them, and do not send the platform token when accessing OSS. The upstream service continues to validate the user and Scope.

Path parameters

ParameterTypeRequiredDescription and constraints
session_idstringYesUpload session ID.
Format: "uuid"

Request body

The public contract does not declare a request body. Do not add identity fields or undeclared business fields.

Success responses

Each business API retains its original response structure; no common code/msg/data wrapper is added.

HTTP 200

Complete Response type: application/json
FieldTypeRequiredDescription and constraints
fileobjectYes—
file.created_atstringYes—
file.download_urlstringNo—
file.file_idstringYes—
file.is_directorybooleanYes—
file.mime_typestringYes—
file.modified_atstringYes—
file.namestringYes—
file.pathstringYes—
file.sizeintegerNo—
session_idstringYes—
statusstringYes—

Error responses

HTTPDescription and handling
400Business or gateway error
401Business or gateway error
403Business or gateway error
404Business or gateway error
409Business or gateway error
410Business or gateway error
413Business or gateway error
429Business or gateway error
500Business or gateway error
502Business or gateway error
503Business or gateway error
504Business or gateway error
Keep the request ID and error fields from the response for troubleshooting. A write operation may have taken effect even if the request times out or the connection drops. Do not automatically retry solely because you did not receive a success response.

Complete field contract

The JSON below contains the complete request, response, and error schemas, nested constraints, and public extension definitions for this API. Copy it to verify the contract. Success examples not declared in the contract are not inferred.
{
  "components": {
    "schemas": {
      "Complete": {
        "properties": {
          "file": {
            "$ref": "#/components/schemas/File"
          },
          "session_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "session_id",
          "status",
          "file"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "File": {
        "properties": {
          "created_at": {
            "type": "string"
          },
          "download_url": {
            "type": "string"
          },
          "file_id": {
            "type": "string"
          },
          "is_directory": {
            "type": "boolean"
          },
          "mime_type": {
            "type": "string"
          },
          "modified_at": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          }
        },
        "required": [
          "file_id",
          "path",
          "name",
          "is_directory",
          "mime_type",
          "created_at",
          "modified_at"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/drive/direct-uploads/{session_id}/complete": {
      "post": {
        "description": "Confirm direct upload completion. Signed URLs expire. Do not log or share them, and do not send the platform token when accessing OSS. The upstream service continues to validate the user and Scope.",
        "operationId": "drive-post-direct-uploads-session_id-complete",
        "parameters": [
          {
            "description": "Upload session ID.",
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complete"
                }
              }
            },
            "description": "Complete",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "data": {
                          "type": "null"
                        },
                        "msg": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "msg",
                        "data"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Business or gateway error",
            "headers": {
              "X-Request-ID": {
                "description": "Request ID generated by the open platform for each HTTP request, used for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed trace ID.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "OpenTelemetry TraceID for the current open platform request, correlated with X-Request-ID through request logs. A complete trace may be unavailable if it was not retained by sampling.",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "Confirm direct upload completion",
        "tags": [
          "直传上传"
        ]
      }
    }
  },
  "info": {
    "title": "Confirm direct upload completion",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
Back to the OpenAPI overview.