Start a resumable media upload with POST /api/v1/media/uploads. Requires an API key with the read scope or a signed-in workspace member.
Request
| Parameter | In | Type | Required |
|---|---|---|---|
workspaceId |
query | UUID | Yes |
| Body field | Type | Required |
|---|---|---|
sizeBytes |
integer | Yes |
Response
- HTTP 201:
MediaUploadSessionwithmediaId,partSizeBytes,expiresAt.
The OpenAPI document has each field’s type.
Examples
const asset = await workspace.media.upload(file);The SDK’s media.upload() runs this step itself for a file too large for one request.
upload = workspace.media.start_upload(size_bytes=52428800)curl -X POST "https://pubnio.com/api/v1/media/uploads?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"sizeBytes":52428800}'pnio media upload ./launch.mp4Hosted MCP’s execute tool cannot carry this operation’s binary body or response.
Errors
idempotency-conflict: HTTP 409, Idempotency key already usedupload-too-large: HTTP 413, Content Too Large
It also declares the problems most operations declare.
Idempotency
Required. A retry with the same Idempotency-Key returns the first result for 24 hours. Make one key per intent, such as crypto.randomUUID() or Python’s uuid4(), and reuse it only to retry the same request. The TypeScript SDK makes a key for each call unless you pass idempotencyKey. See Idempotency.
Limits
- It is one step of a resumable upload. Agents usually call
media.upload,media.import, ormedia.uploadInlineinstead.