# POST /files/document-upload-url

**Resource:** [Files](./files.md)  
**MCP tool:** `create_document_upload_url`  
**Scopes:** `files:write`  
**Write operation:** no

Step 1 of uploading a PDF (up to 25MB) to the Documents library without sending the file inside the tool call. Returns an upload_url that works for 1 hour: PUT the raw file bytes to it with exactly the returned required_headers (e.g. curl -X PUT --data-binary @guide.pdf), then call complete_document_upload. Use this for a PDF too big for upload_file through MCP (about 3MB). Needs a caller that can send the file itself (a script or a shell); a model cannot pass the bytes through this tool. The PDF is private, like every document; to put it on a lead magnet page, use the id complete_document_upload returns. Free.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | body | string | yes | The filename with its extension (e.g. "2027-calendar.pdf"). |
| `size` | body | number | yes | The exact file size in bytes (max 26214400, 25MB). Must match the Content-Length of the PUT. |
| `mime_type` | body | string | no | Optional. Only application/pdf is accepted; must match the Content-Type of the PUT. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/files/document-upload-url"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","size":"...","mime_type":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`