Uploads

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.

PUThttps://zx1.deepwl.net/v1/file/upload
Request
curl -X PUT https://zx1.deepwl.net/v1/file/upload \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '
{
  "headers": {
    "Content-Type": "<string>"
  },
  "params": {}
}'
Response
{
  "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

headersobject

Custom headers for the upload request.

Content-Typestring

The file MIME type, such as image/png, image/jpeg, or video/mp4.

paramsobject

Additional 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_urlstring

The public URL that can be directly passed to image, video, and task endpoints after a successful upload.

expireinteger

The expiration time of the pre-signed URL in seconds.

methodstring

The upload method, currently fixed as PUT.

upload_urlstring

The signed object storage upload URL.

Use Cases

Use it as a media URL after uploading

  1. Call /v1/file/upload to obtain upload_url and download_url.
  2. Upload the file by sending a PUT request to upload_url.
  3. Pass download_url as 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.