fynepdf logo
Docs menu

Add a file

Three ways in:

  • {filename, size}: get an upload_url, then PUT the bytes to it (large files never pass through the API).
  • {url}: we fetch a public URL (redirects followed, private addresses refused).
  • multipart/form-data with a file field: up to 25 MB, ready at once. Files are deleted after 24 hours, or sooner with ttl_seconds or DELETE.

POST /v1/files

Request

curl -X POST https://api.fynepdf.com/v1/files \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/report.pdf","filename":"report.pdf"}'

Body

Form 1

ParameterTypeRequiredWhat it does
filenamestringyes
sizeintegeryes
content_typestring
ttl_secondsinteger

Form 2

ParameterTypeRequiredWhat it does
urlstringyes
filenamestring
ttl_secondsinteger

Or upload in the body

Send multipart/form-data instead:

ParameterTypeRequiredWhat it does
filestring
ttl_secondsstring

Response

The file. For an upload URL: upload_url to PUT exactly size bytes to, valid 15 minutes..

Errors

Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.