# POST /apps/:app_id/tables

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

Add a table to an app: its key, name, columns and who sees which rows. At most 20 tables per app and 40 columns per table.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `app_id` | path | string | yes | The app's id. |
| `key` | body | string | yes | Short name used in paths and the manifest: lower case letters, digits and underscores, starting with a letter (for example "follow_ups"). |
| `name` | body | string | yes | What the table is called on screen. |
| `columns` | body | array | yes | The table's columns: a list of { key, label, type, options?, required? }. type is one of text, number, money, date, datetime, boolean, select, multi_select, file (one stored file), files (up to 20 stored files on one row, for example photos of a job), signature (a signature drawn on screen, kept with who signed and when), contact_ref, opportunity_ref, user_ref. select and multi_select need options (a list of short texts). Who may see and who may change each field: access: { view, edit }, each one of "everyone" (anyone the app is shared with, the default), "team" (workspace members only, never a client), "clients" (clients in their Client Portal only), "admins" (workspace admins only) or a list of version ids from list_app_audiences (only people given one of those versions). For example a price only the team may change: access: { edit: "team" }; an internal note clients must not see: access: { view: "team" }; an approval the client gives and the team only reads: access: { edit: "clients" }. Admins always see and change every field, and nobody can change a field they cannot see. On a table that keeps rows for a contact (portal_customer), one contact_ref column may say row_for: true: each row is then kept for the contact in that column, so picking a subcontractor on a booking gives that subcontractor the row (in their Client Portal or through a link sent with send_app_link). |
| `row_visibility` | body | string | no | "shared" (every team member with access sees every row), "own" (a member sees only rows they own; admins and shares marked can_see_all_rows see all) or "portal_customer" (each row belongs to one CRM contact; a client sees only their own contact's rows, the team sees all). Defaults to "shared". |
| `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"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"key":"...","name":"...","columns":"..."}'
```

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