v1

latestOpenAPI 3.0.02026-07-26117076.0 KB
File Upload

Upload File from URL

Upload files by providing a remote URL. The file will be downloaded from the URL and stored in PoYo AI storage.

post/api/common/upload/url

Request body

file_urlstring uri required

The remote file URL to upload.

Must be a publicly accessible URL using HTTP or HTTPS protocol.

Supported formats: JPEG, PNG, GIF, WebP

Note: The file will be downloaded from this URL and stored in PoYo AI storage.

upload_pathstring

Custom storage directory path.

If not specified, the system will auto-categorize the file.

Note: All files are stored with a temp/ prefix regardless of the specified path.

file_namestring

Custom filename for the uploaded file.

If not specified, the system will generate a unique filename in the format: {timestamp}_{random}_{extension}

Example auto-generated name: 20251229130857_a8B9cD2e.png

Example request

{
  "file_url": "https://example.com/images/sample.jpg",
  "upload_path": "avatars",
  "file_name": "my-custom-image.png"
}

Response

File uploaded successfully

successboolean required

Indicates whether the upload was successful

codeinteger required

HTTP status code

msgstring required

Response message

Example response

{
  "success": true,
  "code": 200,
  "msg": "File uploaded successfully",
  "data": {
    "file_id": "1bdfdbac6ebc2228d0b398d728bf4699",
    "file_name": "test-image.png",
    "original_name": "image-from-url.png",
    "file_size": 1419815,
    "mime_type": "image/png",
    "upload_path": "temp/test-uploads",
    "file_url": "https://storage.poyo.ai/temp/test-uploads/test-image.png",
    "download_url": "https://storage.poyo.ai/temp/test-uploads/test-image.png",
    "upload_time": "2025-12-29T13:08:57.673515",
    "expires_at": "2026-01-01T13:08:57.673515"
  }
}