# POST /apps/:app_id/audiences

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

Add a version of an app for a group of people (the Views and access panel): its name, whether it is for the team or for clients, the pages it shows, the TrustPager information it shows and the actions (buttons) it has. Give it to people with share_app and its audience_id. A button only works when the version has it AND the person's own role allows it. Workspace admins only.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `app_id` | path | string | yes | The app's id. |
| `name` | body | string | yes | What the version is called, 1 to 60 characters and different from the app's other versions, for example "Managers", "Staff" or "Clients". |
| `side` | body | string | yes | "team" for a version your team members open in TrustPager, or "portal" for one your clients open in their Client Portal. |
| `view_keys` | body | array | no | The pages this version shows: a list of page keys from the app's manifest (get_app lists them). Team versions take team pages and client versions take client pages. Leave out for none. |
| `reads` | body | array | no | The TrustPager data this version can see: a list of the app's declared reads, for example "opportunities:read" (Opportunities), "tasks:read" (Tasks), "scheduling:read" (Bookings), "invoices:read" (Invoices), "activities:read" (Activities), "referrals:read" (Referrals). Only reads the app's manifest declares (crm_reads) are allowed. A client version can see none: send []. Leave out for none. |
| `actions` | body | array | no | The buttons this version has: a list of the app's declared actions, for example "opportunities:write" (move an opportunity, set its next action), "tasks:write" (create or complete a task), "activities:write" (log an activity), "scheduling:write" (mark a booking attended, late or no-show), "invoices:write-approval" (send an invoice reminder), "referrals:write-approval" (ask for a referral). Only actions the manifest declares (crm_actions) are allowed. A button works only when the version has it AND the person's own role allows it. A client version can only have "tasks:write", which for clients means "tell the team" (it creates a task for your team). list_app_audiences shows, for every button, what else it can set off, such as automations. Leave out for none. |
| `can_write_rows` | body | boolean | no | true lets people with this version add and change rows in the app's own tables. Clients can then only add and change rows linked to themselves. Default true for a new version. |
| `can_see_all_rows` | body | boolean | no | true lets people with this version see everyone's rows in tables that keep rows per person. Team versions only: a client version always sees only the rows linked to that client. Default false. |
| `position` | body | number | no | Order of the versions (0 first). When one person is given two versions by equally specific shares, the lower number wins. Defaults to after the last version. |
| `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/audiences"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","side":"...","view_keys":"..."}'
```

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