Skip to main content

Convert

Change a file's format — movmp4, pngwebp, or a document to PDF. The file-first recipe takes the target format directly and lowers it to the wire for you.

Audio formats

Accepted
audio/aac · audio/flac · audio/mp4 · audio/mpeg · audio/ogg · audio/wavStable

⚠️ This list is specific to convert. Each operation accepts its own set — merge, for example, does not take audio/mp4. Do not carry a list from one page to another; call getSchema() for the authoritative set at runtime.

File-first

const result = await client
.file('./clip.mov')
.convert('mp4')
.run({ maxWait: '10m' });

console.log(result.url);

convert(format) accepts a few extra options (image width/height/fit, quality, GIF knobs, …); they are typed and validated before upload.

Batch convert

const result = await client
.files(['./a.png', './b.png', './c.png'])
.convert('webp')
.run({ maxWait: '10m' });

See also

  • Compress — reduce size without changing format.
  • Thumbnail — generate a preview image.