docs/api/files

API

Files

Upload a file before a job reads it. Uploads and outputs are deleted after 24 hours.

Upload a file

Send the file as the body of POST /v1/files, with its name in X-File-Name as percent-encoded UTF-8. The body needs a Content-Length and can be up to 32 MiB. The file is ready when the response comes back.

The format comes from the content. X-File-Format names it instead, and replaces detection.

The body is always the file, whatever its content type, JSON too.

Terminal
$ export CV_API_KEY=cv_sk_…

Set your key once. Every cv command reads it.

Terminal
$ curl -X POST https://api.convert.dev/v1/files \  -H "Authorization: Bearer $CV_API_KEY" \  -H "X-File-Name: lease.docx" \  --data-binary @lease.docx
response12 lines
{  "object": "file",  "id": "file_01JC9W3TQ6V8ZK2N5R7M4H1XEB",  "status": "ready",  "name": "lease.docx",  "size": 4007,  "format": {"id": "docx", "mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},  "source": "inline",  "url": "https://…",  "expires_at": "2026-11-04T09:12:31Z",  "created_at": "2026-11-03T09:12:31Z"}

Upload a large file

For a larger file, leave the body of POST /v1/files empty and give the size in X-File-Size. The file starts as uploading, and its upload lists every part with a URL to send it to.

  • A file has at most 100 parts. Each is part_size bytes but the last: 16 MiB, or more for a file over 1.6 GB.
  • PUT the bytes of each part to its URL, in any order and several at once if you like. The URLs need no key and work for an hour. POST /v1/files/{id}/parts answers with the file and fresh URLs.
  • Then call POST /v1/files/{id}/complete. It checks that every part arrived, names any part that did not, and makes the file ready once its format is known.

The plan sets the largest file you can upload.

Terminal
$ curl -X POST https://api.convert.dev/v1/files \  -H "Authorization: Bearer $CV_API_KEY" \  -H "X-File-Name: survey.pdf" \  -H "X-File-Size: 48210944"
response18 lines
{  "object": "file",  "id": "file_01JC9W6A4N9R3K7T2Q8V5M1HXE",  "status": "uploading",  "name": "survey.pdf",  "size": 48210944,  "source": "upload",  "expires_at": "2026-11-04T09:20:05Z",  "created_at": "2026-11-03T09:20:05Z",  "upload": {    "part_size": 16777216,    "parts": [      {"number": 1, "url": "https://…", "expires_at": "2026-11-03T10:20:05Z"},      {"number": 2, "url": "https://…", "expires_at": "2026-11-03T10:20:05Z"},      {"number": 3, "url": "https://…", "expires_at": "2026-11-03T10:20:05Z"}    ]  }}
Terminal

Send every part first, such as with curl -T. Completing a ready file answers with it again, so a retry is safe.

$ curl -X POST https://api.convert.dev/v1/files/file_01JC9W6A4N9R3K7T2Q8V5M1HXE/complete \  -H "Authorization: Bearer $CV_API_KEY"

The file object

Field
idThe file's id, such as file_01JC9W6C8T2M5Q9K3V7N1R4XBF. A job names its inputs by it.
statusuploading, ready or expired. A job takes a ready file.
nameThe file name you gave, or the name of an output.
sizeBytes.
formatThe format id and mime, from the content or from the format you declared.
pagesThe page count of a PDF.
revThe revision of the content, once a job has read the file. An edit names it. An edited output whose refs moved has none, so read it before the next edit.
sourceinline for a file sent as the body of POST /v1/files, upload for one whose bytes went to its upload URLs, or output for a file a job made.
urlA signed link to download an output. It needs no key and works for an hour. A file you uploaded has none, and neither does a job's output that is its input handed back unchanged.
indexFor an output, its place among the outputs of its job, from 0.
expires_atWhen the file is deleted.
uploadHow to send the bytes, while the file is uploading, in the answers to POST /v1/files with x-file-size and to POST /v1/files/{id}/parts.

List, get and delete

GET /v1/files lists files newest first, up to limit (1 to 100) at a time. Pass next_cursor as cursor for the next page, and source to list only some, such as upload,inline.

A limit outside 1 to 100, or a source the API does not know, fails with invalid_request.

GET /v1/files/{id} returns one file, and an output with a fresh url. A file you uploaded has no url, since its bytes are already yours. DELETE /v1/files/{id} deletes it now and answers 204.

Terminal
$ curl https://api.convert.dev/v1/files?source=upload,inline&limit=20 \  -H "Authorization: Bearer $CV_API_KEY"

How long files are kept

Uploads and outputs are deleted 24 hours after they are made. X-File-Ttl on POST /v1/files keeps a file for less, and a job's output.ttl_s does the same for its outputs. Neither keeps a file longer.

Uploads that are still kept count against the organization's storage. See Pricing and limits.

Updated 3 November 2026