Start an upload
const url = 'https://api.iomza.com/v1/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"file_name":"video.mov","content_type":"application/octet-stream","size":1,"progressive":true}'};
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.iomza.com/v1/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "file_name": "video.mov", "content_type": "application/octet-stream", "size": 1, "progressive": true }'Reserves a place for a file and signs where to send it. Up to 100 MB: mode: "single", one PUT to url with headers, then complete. Larger: mode: "multipart", each part (part_size bytes) PUT to its URL in parallel, keeping each response’s ETag, then complete with them. With progressive: true, each part is its own object and there is no complete: create the job right away and it is transcoded while the file arrives (send the first and last parts first). Sources are kept 7 days.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The file’s name, shown in the app.
The file’s type, sent again as Content-Type in each PUT.
Bytes. Up to the plan’s maximum file size.
Each part becomes its own object, readable as it lands, and there is no complete: create the job as soon as the upload starts and it is transcoded while the file arrives.
Responses
Section titled “Responses”The upload, with how to send the file.
object
How it arrives: single (one PUT), multipart (parts in parallel, then complete), progressive (parts readable as they land, no complete) or url (copied by the job that was given the URL; completed once the copy is done).
object
completed once the whole file is stored.
Where an imported source came from.
object
How it arrives: single (one PUT), multipart (parts in parallel, then complete), progressive (parts readable as they land, no complete) or url (copied by the job that was given the URL; completed once the copy is done).
object
completed once the whole file is stored.
Where an imported source came from.
object
How it arrives: single (one PUT), multipart (parts in parallel, then complete), progressive (parts readable as they land, no complete) or url (copied by the job that was given the URL; completed once the copy is done).
object
object
completed once the whole file is stored.
Where an imported source came from.
Example
{ "mode": "single", "method": "PUT", "object": "upload", "status": "pending"}Invalid fields: details lists each problem with its path.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}The API key is missing, invalid or revoked.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}The plan doesn’t allow it (minutes this month, file size: quota_exceeded), or the balance is used up and has to be topped up (insufficient_balance).
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Valid credentials that may not do this (forbidden), your plan doesn’t include the module the route belongs to (module_not_in_plan), or your organization is suspended (organization_suspended).
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Too many requests: wait and retry. Answered by the gateway, so the body may differ.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Ours: retry, and tell us if it persists.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Momentarily unavailable: retry in a few seconds.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}