Upload

Upload an image, video or PDF

Accepts an image URL as JSON or an image/video file as multipart form data. Stores an asset owned by the caller and returns data.asset_id for use as a reference or source_asset_id. Malformed multipart data or a missing file returns 400. For a PDF such as a brand book, send JSON { "content_type": "application/pdf", "size": BYTES } instead: the response adds a signed upload_url, valid for 15 minutes, where you PUT the file with upload_headers. The file goes straight to storage, so it is not limited by the request body size; storage refuses it above 50 MB. Then pass asset_id to POST /v1/mascots/from-brand-book. No credit cost.

Select Masko-API-Version: 2026-09-26 (or api_version=2026-09-26) for the canonical mascot contract shown first. Existing unversioned clients keep legacy collection fields. A mascot_id query filter also selects the canonical contract. Mixing identifier names returns 400.

post/v1/upload

Request

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

Query parameters

api_version'2026-09-26' | 'legacy'

Equivalent to the version header, for polling URLs and clients that accept only relative paths. Header and query must agree.

Headers

Idempotency-Keystring

Account-scoped key (1 to 255 characters, ideally a UUID). Retries must preserve the credential workspace, effective API version, URL, content type and exact body bytes, including multipart boundaries; different inputs return 409 idempotency_key_reused. Completed responses, including 500 errors, replay for 24 hours after completion with current resource access checked again. Running or unconfirmed executions return 409 idempotency_request_in_progress and do not expire automatically. A receipt persistence failure returns 503 idempotency_persistence_failed: retry only with the same key and inspect the operation outcome before starting a new request.

Masko-API-Version'2026-09-26' | 'legacy'

Use 2026-09-26 for mascot_id resource fields. Unversioned shared routes retain the legacy contract.

Request body

OR

Response

Uploaded asset

Changes

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