File Upload

Upload File Stream

Upload files using multipart/form-data format. Supports image uploads and video uploads. Videos are stored under the temp/videos prefix by default, are limited to 100MB, and expire after 24 hours.

post/api/common/upload/stream

Request

  • Base URL
    https://api.poyo.ai
  • Auth
    HTTP bearer

Request body multipart/form-data

filestring binary required

File binary data to upload.

Supported image formats: JPEG, PNG, GIF, WebP

Supported video formats: MP4, WebM, QuickTime/MOV, AVI, MKV

Maximum: 1 file per request. Videos are limited to 100MB.

Retention: Images expire after 72 hours. Videos expire after 24 hours when stored under the temp/videos lifecycle prefix.

Note: The system automatically identifies and categorizes file types.

upload_pathstring

Custom storage directory path.

Supports both naming conventions:

  • snake_case: upload_path
  • camelCase: uploadPath

If not specified, the system uses temp. Video uploads using the default temp path are stored as temp/videos.

Note: API routing normalizes custom paths under the temp/ prefix.

file_namestring

Custom filename for the uploaded file.

Supports both naming conventions:

  • snake_case: file_name
  • camelCase: fileName

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

{
  "upload_path": "photos",
  "file_name": "photo.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"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.