Skip to main content
POST
/
api
/
media
/
convert
Re-encode a single video or audio file
curl --request POST \
  --url https://convertly.sh/api/media/convert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "files": [
    {
      "filename": "<string>",
      "mimeType": "<string>",
      "originalSize": 123,
      "finalSize": 123,
      "downloadUrl": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Dashboard-generated Convertly API key. Keys currently begin with cvly_.

Body

multipart/form-data

Re-encodes a single video or audio file. For image conversion, use /api/convert (batch) or /api/media/transform (single image with crop/resize).

format
enum<string>
required

Video: mp4, webm, mov. Audio: mp3, m4a, wav, ogg, flac.

Available options:
mp4,
webm,
mov,
mp3,
m4a,
wav,
ogg,
flac
file
file

Multipart upload input.

sourceUrl
string<uri>

Remote HTTP(S) file input. Use instead of file for single-file tools.

async
enum<string>
default:false

Set true to queue the media tool as a background job.

Available options:
true,
false
background
enum<string>

Alias for async=true.

Available options:
true,
false
compressionLevel
integer
default:75
Required range: 1 <= x <= 100
resize
enum<string>
default:original

Video only. Output resolution preset.

Available options:
original,
website,
email,
instagram,
linkedin,
ecommerce,
square,
width,
height
resizeWidth
integer

Used when resize=width or square.

Required range: x >= 1
resizeHeight
integer

Used when resize=height.

Required range: x >= 1

Response

Generated file or queued media tool job

files
object[]
required