Upload a media file
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/Media';const form = new FormData();form.append('file', 'file');form.append('content_type', 'application/pdf');form.append('docname', 'contract-2026-11');form.append('doctype', 'pdf');form.append('quality', 'standard');form.append('docdescription', 'example');form.append('visibility', 'public');form.append('used_for', 'ContactCenter');form.append('tags', 'example');form.append('scope', 'local');form.append('taskQueueSid', 'example');form.append('workspaceSid', 'example');
const options = {method: 'POST', headers: {Authorization: 'Basic <credentials>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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=exampleUploads 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: …”.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your account’s Auth ID (20 upper-case letters and digits).
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”object
The file (at most 10 MB).
MIME type of the file; must match its content.
Document name, unique within your account.
Example
contract-2026-11Free-text document type label.
Example
pdfQuality label. For PNG images it sets the TIFF conversion resolution (super, good, standard); other types ignore it.
Example
standardFree-text description.
Public or private; default depends on the file (see description).
ContactCenter for Contact Center media (no TIFF conversion, public by default).
Example
ContactCenterTags; repeat the field, or send a comma-separated list or a JSON array. Any tag makes the item public by default.
Local (default) or global (vendor and superuser accounts only).
Contact Center task queue to attach the item to; requires workspaceSid.
Contact Center workspace of taskQueueSid.
Responses
Section titled “ Responses ”The new media item, with status ‘success’.
object
Auth ID of the owning account.
MIME type declared at upload.
Free-text description.
Document name, unique within the account.
Free-text document type label given at upload.
Storage key of the uploaded file: <auth_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.
Quality given at upload.
“local” (this account only) or “global” (shared read-only with the account’s tenants).
How the item was created: “api” for uploads.
“success” on upload and update; omitted elsewhere.
Tags attached to the item.
Contact Center task queue the item is attached to, if any.
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.
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.
Random UUID of the media item; part of its public link.
“public” (permanent unauthenticated link) or “private”.
Contact Center workspace of that task queue, if any.
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.
object
Human-readable reason.
Always “failed”.
Example
{ "message": "fax not found", "status": "failed"}Missing or wrong credentials, or credentials that may not act for {auth_id}. Body: ‘Authentication failed’.
Example generated
exampleRequest body larger than 12 MB.
object
Human-readable reason.
Example
{ "message": "Request Entity Too Large"}Unexpected server error.
object
Human-readable reason.
Example
{ "message": "Request Entity Too Large"}