> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.plextera.com/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.plextera.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.plextera.com/_mcp/server.

# Files

Files are the input to everything else in the Plextera Public API: you upload a document once, get back a `fileId`, and reference it in [document extractions](/guides/core-guides/document-extraction) and [workflow runs](/guides/core-guides/workflow-runs).

## Upload a file

Send the document as a multipart `file` part:

```bash
curl -X POST https://api.plextera.com/api/public/v1/files \
  -H "Authorization: api-key YOUR_API_KEY" \
  -F "file=@invoice.pdf"
```

```json
{
  "id": "file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM",
  "fileName": "invoice.pdf",
  "mimeType": "application/pdf",
  "size": 63877,
  "contentUrl": "https://files.plextera.com/acme/2026/06/23/invoice_01JY7M4ZVX.pdf?Expires=1782825600&KeyName=key1&Signature=abc123"
}
```

Store the `id` - it is the `fileId` you pass to other endpoints.

**Constraints:**

* Maximum size: **50 MB** (larger uploads return `413 PAYLOAD_TOO_LARGE`).
* Supported types: PDF, JPEG, PNG, TIFF, WebP, DOCX, XLSX, PPTX, plain text, CSV, HTML, archives, audio, and video.
* Executable and script files are rejected with `415 UNSUPPORTED_MEDIA_TYPE`.

> **Info**
>
> You do not always need a separate upload call. Document Insights accepts a direct multipart upload (`POST /document-insights/extractions/upload`) and public HTTPS URLs, and workflow runs accept multipart file parts. Use `POST /files` when you want to reuse one document across several calls or upload it ahead of time.

## Get file metadata

```bash
curl https://api.plextera.com/api/public/v1/files/file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM \
  -H "Authorization: api-key YOUR_API_KEY"
```

The response has the same shape as the upload response: `id`, `fileName`, `mimeType`, `size`, and a fresh `contentUrl`.

## Download file content

There is no separate download endpoint. Instead, every metadata response carries `contentUrl` - a temporary, pre-signed link to the raw content. Download it directly, with no Authorization header:

```bash
# 1. Fetch metadata and extract the download link
CONTENT_URL=$(curl -s https://api.plextera.com/api/public/v1/files/file_01JY7M4ZVX5R1P3M3Q0TA1S7ZM \
  -H "Authorization: api-key YOUR_API_KEY" | jq -r .contentUrl)

# 2. Download the content
curl -o invoice.pdf "$CONTENT_URL"
```

> **Warning**
>
> `contentUrl` expires. Use it promptly and never store it - request `GET /files/{fileId}` again whenever you need a fresh link. The extraction document returned by Get extraction carries the same kind of temporary `contentUrl` for the source document.

## Lifecycle and reuse

* Reference the same `fileId` in any number of extractions and workflow runs.
* Uploaded files are staged for processing, not long-term storage. Once a file is referenced by an extraction or a workflow run, Plextera keeps it with that run's history; keep your own copy of anything you need independently of processing.

## Related reference

* [Document Extraction](/guides/core-guides/document-extraction) - submit a file for field extraction
* [Workflow Runs](/guides/core-guides/workflow-runs) - pass files to workflows
* [API Reference](/api/api-reference) - full Files endpoint reference