Skip to content

Upload a media file

POST
/v1/Accounts/{auth_id}/Media
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/Media \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file \
--form content_type=application/pdf \
--form docname=contract-2026-11 \
--form doctype=pdf \
--form quality=standard \
--form docdescription=example \
--form visibility=public \
--form used_for=ContactCenter \
--form tags=example \
--form scope=local \
--form taskQueueSid=example \
--form workspaceSid=example

Uploads a document or audio file to your account’s media store, as multipart/form-data. The file may be at most 10 MB (requests over 12 MB are refused with 413). content_type must be one of application/pdf, image/jpeg, image/jpg, image/png, image/gif, image/webp, image/bmp, image/tiff, audio/mp3, audio/mpeg or audio/wav, and the file’s first bytes must match it. docname must be unique within your account. Documents (PDF and images) are also converted to a fax-ready TIFF (tifurl), unless used_for is ContactCenter; audio is stored as is. Use the returned id as media_sid in Send a fax. Visibility: a public item’s url is a permanent link served by this API at /v1/Media/Files/{uuid}/{name} that anyone can fetch without credentials (see Download a public media file); a private item’s url is a storage address that cannot be fetched directly (Get a media item gives a short-lived link). When visibility is left out, audio, Contact Center media (used_for=ContactCenter) and any item with tags are public and everything else is private. scope=global (vendor and superuser accounts only) shares the item read-only with the account’s tenants. taskQueueSid (which then needs workspaceSid) attaches the item to one of your Contact Center queues; both must exist on your account. All failures are 400 with the reason in message, for example a missing required field (validator text such as “Key: ‘MediaRequest.Doctype’ Error:Field validation for ‘Doctype’ failed on the ‘required’ tag”), “file size cannot exceed 10 MB”, “unsupported content type: …”, “file content does not match content type …”, “docname already exists: …”.

auth_id
required
string

Your account’s Auth ID (20 upper-case letters and digits).

Example

AC000000000000000000
Media type multipart/form-data
object
file
required

The file (at most 10 MB).

string format: binary
content_type
required

MIME type of the file; must match its content.

string
Allowed values: application/pdf image/jpeg image/jpg image/png image/gif image/webp image/bmp image/tiff audio/mp3 audio/mpeg audio/wav
docname
required

Document name, unique within your account.

string

Example

contract-2026-11
doctype
required

Free-text document type label.

string

Example

pdf
quality
required

Quality label. For PNG images it sets the TIFF conversion resolution (super, good, standard); other types ignore it.

string

Example

standard
docdescription

Free-text description.

string
visibility

Public or private; default depends on the file (see description).

string
Allowed values: public private
used_for

ContactCenter for Contact Center media (no TIFF conversion, public by default).

string

Example

ContactCenter
tags

Tags; repeat the field, or send a comma-separated list or a JSON array. Any tag makes the item public by default.

Array<string>
scope

Local (default) or global (vendor and superuser accounts only).

string
default: local
Allowed values: local global
taskQueueSid

Contact Center task queue to attach the item to; requires workspaceSid.

string
workspaceSid

Contact Center workspace of taskQueueSid.

string

The new media item, with status ‘success’.

Media type application/json
object
account_id

Auth ID of the owning account.

string
content_type

MIME type declared at upload.

string
docdescription

Free-text description.

string
docname

Document name, unique within the account.

string
doctype

Free-text document type label given at upload.

string
filename

Storage key of the uploaded file: <auth_id>//-, optionally under an environment prefix.

string
id

Media id. Use it as media_sid when sending a fax and as {media_id} in the Media paths. 0 in Get a media item.

integer
quality

Quality given at upload.

string
scope

“local” (this account only) or “global” (shared read-only with the account’s tenants).

string
Allowed values: local global
sourcetype

How the item was created: “api” for uploads.

string
status

“success” on upload and update; omitted elsewhere.

string
tags

Tags attached to the item.

Array<string>
taskQueueSid

Contact Center task queue the item is attached to, if any.

string
tifurl

Storage URL of the fax-ready TIFF rendering (empty for audio and Contact Center media). In Get a media item: a pre-signed link valid for 15 minutes.

string
url

Link to the file. Public items: a permanent link anyone can fetch (Download a public media file). Private items: a storage URL that is not directly downloadable. In Get a media item: a pre-signed link valid for 15 minutes.

string
uuid

Random UUID of the media item; part of its public link.

string
visibility

“public” (permanent unauthenticated link) or “private”.

string
Allowed values: public private
workspaceSid

Contact Center workspace of that task queue, if any.

string

Example

{
"account_id": "AC000000000000000000",
"content_type": "application/pdf",
"docdescription": "Contract for signature",
"docname": "contract-2026-11",
"doctype": "pdf",
"filename": "AC000000000000000000/11-2026/7f3c2a9e-4b1d-4c8e-9a61-2d5f0b8e1c34-contract.pdf",
"id": 1042,
"quality": "standard",
"scope": "local",
"sourcetype": "api",
"status": "success",
"tags": [
"hold-music"
],
"taskQueueSid": "",
"tifurl": "https://media-bucket.s3.us-east-1.amazonaws.com/AC000000000000000000/11-2026/7f3c2a9e-4b1d-4c8e-9a61-2d5f0b8e1c34.tiff",
"url": "https://api.siprtc.io/v1/Media/Files/7f3c2a9e-4b1d-4c8e-9a61-2d5f0b8e1c34/7f3c2a9e-4b1d-4c8e-9a61-2d5f0b8e1c34-contract.pdf",
"uuid": "7f3c2a9e-4b1d-4c8e-9a61-2d5f0b8e1c34",
"visibility": "public",
"workspaceSid": ""
}

Invalid form, missing or unsupported file, duplicate docname, invalid queue, or a conversion or storage error.

Media type application/json
object
message

Human-readable reason.

string
status

Always “failed”.

string

Example

{
"message": "fax not found",
"status": "failed"
}

Missing or wrong credentials, or credentials that may not act for {auth_id}. Body: ‘Authentication failed’.

Media type application/json
string

Example generated

example

Request body larger than 12 MB.

Media type application/json
object
message

Human-readable reason.

string

Example

{
"message": "Request Entity Too Large"
}

Unexpected server error.

Media type application/json
object
message

Human-readable reason.

string

Example

{
"message": "Request Entity Too Large"
}