Uploads

Create Presigned Upload URL

Create a short-lived presigned URL for uploading media files. Upload the raw file bytes to presigned_url using every header returned in required_headers, then pass public_url as a model input.

post/v1/upload/presign

Request

  • Base URL: https://api.eachlabs.ai
  • URL: https://api.eachlabs.ai/v1/upload/presign
  • Auth: HTTP bearer

Request body

content_typestring required

MIME type of the file to upload

file_type'image' | 'video' | 'audio' | 'other'

High-level file category

expires_in_secondsinteger

How long the stored file is retained before automatic deletion, in seconds. Sets expires_at in the response. Defaults to 180 days when omitted; clamped to a minimum of 60 seconds and a maximum of 365 days (31536000). Does not affect the 15-minute upload-URL lifetime.

Example request

{
  "content_type": "image/png",
  "file_type": "image",
  "expires_in_seconds": 604800
}

Response

Presigned upload URL created

idstring

Upload identifier

presigned_urlstring uri

Short-lived URL for uploading raw file bytes

public_urlstring uri

Public URL to pass as a model input after upload succeeds

expires_atstring date-time

When the stored file is automatically deleted (its retention deadline). Defaults to 180 days out; controlled by expires_in_seconds. Not the upload-URL deadline — the presigned URL only accepts uploads for 15 minutes after issuance.

required_headersobject

Headers that must be sent verbatim with the upload PUT request

Example response

{
  "id": "0dce0f44-b8a5-4f30-91d4-5f6b0c221bf0",
  "presigned_url": "https://eachlabs-storage.s3.amazonaws.com/uploads/...?X-Amz-Signature=...",
  "public_url": "https://cdn-us.eachlabs.ai/uploads/0dce0f44-b8a5-4f30-91d4-5f6b0c221bf0.png",
  "expires_at": "2026-12-08T18:15:00Z",
  "required_headers": {
    "x-amz-meta-file-id": "0dce0f44-b8a5-4f30-91d4-5f6b0c221bf0"
  }
}

Changes

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