# POST /apps/:app_id/tables/:table_key/files

**Resource:** [App Data](./app-data.md)  
**MCP tool:** `start_app_file_upload`  
**Scopes:** `app-data:write`  
**Write operation:** yes

Step 1 of adding a file to a row of an app table (a column of type "file", "files" or "signature"). Answers `file` (the reference to store in the row), `upload_url` and `upload_headers`. Then PUT the file's bytes to upload_url with exactly those headers (a plain HTTP PUT, no TrustPager key), call finish_app_file_upload, and store `file` in the row's file column with add_app_rows or update_app_row: as the value itself for a "file" column, inside a list for a "files" column (up to 20 files, send the whole list each time), or as { file, name } for a "signature" column (name is who signed; a PNG picture of at most 1 MB; a signed field must be cleared with null before it is signed again). Files can be up to 15 MB: pictures, PDFs, Word, Excel and PowerPoint files, CSV and text files. The caller needs a share that lets them write rows. A file reference not made this way is refused, so a row can only hold files uploaded to its own table.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `app_id` | path | string | yes | The app's id. |
| `table_key` | path | string | yes | The table's key (for example "job_files"), as shown by list_app_tables. |
| `column` | body | string | yes | The key of a file column of this table: a column of type "file" (one file), "files" (up to 20, one upload each) or "signature" (a PNG picture of the signature, at most 1 MB). |
| `name` | body | string | yes | The file's name with its extension, for example "quote.pdf". |
| `size` | body | number | yes | The file's exact size in bytes (at most 15728640 bytes, 15 MB). |
| `content_type` | body | string | yes | The file's type, for example "application/pdf" or "image/png". Pictures, PDFs, Word, Excel and PowerPoint files, CSV and text files are accepted; the real type is checked from the file itself. |
| `row_id` | body | string | no | Only when replacing the file of an existing row: that row's id. Leave it out when the file is for a new row. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/apps/:app_id/tables/:table_key/files"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"column":"...","name":"...","size":"..."}'
```

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