# Files

Get files into the FynePDF API by upload URL, public URL or in the request body, and get results back out.

Every job works on files you've added. There are three ways in; pick by size and where the file lives.

## From a URL

The API fetches a public `http(s)` URL for you:

```bash
curl 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"}'
```

## By upload URL (large files)

Ask for an upload URL with the file's name and size, then `PUT` the bytes straight to storage. Large files never pass through the API.

```bash
curl https://api.fynepdf.com/v1/files \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename":"scan.pdf","size":48211330}'
```

The answer has `upload_url` (valid for 15 minutes, for exactly `size` bytes) and `upload_method: "PUT"`:

```bash
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/pdf" \
  --data-binary @scan.pdf
```

Send the same `Content-Type` the file was registered with (the API works it out from the name), and exactly the `size` you gave: storage refuses any other length. The file is ready for jobs once the upload ends, and from then on the URL can't change it.

## In the request (up to 25 MB)

Send the file itself as `multipart/form-data`:

```bash
curl https://api.fynepdf.com/v1/files \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -F "file=@report.pdf"
```

## What you get back

A **file**: its `id` (`file_…`) goes into jobs; `kind` (`pdf`, `word`, `excel`, `image`…) says which actions take it; `pages` and `bytes` are filled in once it's read.

- `GET /v1/files/{id}` gets one; `GET /v1/files` lists the last ones.
- `GET /v1/files/{id}/content` downloads it (a redirect to a short-lived link).
- `DELETE /v1/files/{id}` deletes it now.

## How long files are kept

Files and results are deleted after **24 hours**, or sooner with `ttl_seconds` (300 to 86,400) when you add them. Download links in job results work for an hour; ask for the file again for a fresh one.

## Sizes

| Key | Largest file |
|---|---|
| Test key | 10 MB |
| Live key | 50 MB |
| Live key, after buying credits | 250 MB |

See [Limits and pricing](https://fynepdf.com/developers/docs/limits) for the rest.


---

Open this page in a browser: https://fynepdf.com/developers/docs/files

More: [All tools](https://fynepdf.com/tools) · [AI agents](https://fynepdf.com/ai/agents) · [llms.txt](https://fynepdf.com/llms.txt) · [Sitemap](https://fynepdf.com/sitemap.xml)
