Upload File
Call `/v1/file/upload` to generate a pre-signed upload URL, then pass the returned `download_url` to interfaces that accept public asset URLs.
https://zx1.deepwl.net/v1/file/uploadcurl -X PUT https://zx1.deepwl.net/v1/file/upload \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '
{
"headers": {
"Content-Type": "<string>"
},
"params": {}
}'{
"download_url": "https://xxxx.cn/uploads/file/2026/djlh2xxxxffqhkt.png",
"expire": 3600,
"method": "PUT",
"upload_url": "https://.../uploads/user/12/20260519-abcdef.png?signature=..."
}This API does not directly accept file contents. Instead, it first issues an object storage PUT URL, and the client uploads the file to that URL itself. It is suitable for pre-uploading images, videos, and other media assets, and uses API Key authentication. The default expiration time is 900 seconds, with a minimum of 60 seconds and a maximum of 3600 seconds.
Request Headers
Authorizationstring必填Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.
Content-Typestring必填Request content type, must be application/json.
Request Body
headersobjectCustom headers for the upload request.
Content-TypestringThe file MIME type, such as image/png, image/jpeg, or video/mp4.
paramsobjectAdditional query parameters for the upload URL. Can be an empty object {} if no extra parameters are needed.
Request Examples
Upload File to the Presigned URL
Once you have the upload_url, send a PUT request to that URL with the file contents. The Content-Type must match the value specified when requesting the presigned URL.
# Upload a video (Content-Type must match the video/mp4 declared when requesting upload_url)
curl -X PUT "https://.../uploads/user/12/20260519-abcdef.mp4?signature=..." \
-H "Content-Type: video/mp4" \
--data-binary @/path/to/video.mp4
Response Examples
Response Fields
download_urlstringThe public URL that can be directly passed to image, video, and task endpoints after a successful upload.
expireintegerThe expiration time of the pre-signed URL in seconds.
methodstringThe upload method, currently fixed as PUT.
upload_urlstringThe signed object storage upload URL.
Use Cases
Use it as a media URL after uploading
- Call
/v1/file/uploadto obtainupload_urlanddownload_url. - Upload the file by sending a
PUTrequest toupload_url. - Pass
download_urlas the input field to interfaces that accept public media URLs.
Notes
This endpoint only issues the upload URL; it does not upload the file for you. Actual file upload requires the client to send another PUT request to upload_url.