# POST /apps/:app_id/tables/attach

**Resource:** [Apps](./apps.md)  
**MCP tool:** `attach_app_spreadsheet`  
**Scopes:** `apps:write`  
**Write operation:** yes

Give an app one of the workspace's spreadsheets as a table, under the app's own key for it (spreadsheet_id from list_app_spreadsheet_choices, which the person picked). Nothing is copied: the app reads and writes the spreadsheet itself, which stays open to the team in the Spreadsheet Builder, with the app's own rules on top. By default the app sees every sheet of it (one per opportunity, say) and each row says which record it is for; send sheet_id to use one sheet only. Every column with no key gets a readable one, kept for good. The app cannot change the spreadsheet's columns: that is done in the Spreadsheet Builder. Workspace admins only.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `app_id` | path | string | yes | The app's id. |
| `spreadsheet_id` | body | string | yes | The spreadsheet to use: an id from list_app_spreadsheet_choices (a spreadsheet template id). |
| `key` | body | string | yes | What this app calls the table in its code and manifest: lower case letters, digits and underscores, starting with a letter (for example "jobs"). |
| `sheet_id` | body | string | no | Use one sheet of the spreadsheet only. Leave out to use every sheet (one per opportunity, say): each row then says which record it is for. |
| `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/attach"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"spreadsheet_id":"...","key":"...","sheet_id":"..."}'
```

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