# PATCH /email/ai-sorting

**Resource:** [Email](./email.md)  
**MCP tool:** `update_ai_sorting`  
**Scopes:** `email:write`  
**Write operation:** yes

Turn Inbox AI Sorting on or off for the whole workspace. Only a workspace admin can. On: each inbound email, text and WhatsApp message is sorted (1 credit per message) and Needs you shows only what needs each person; turning it on also sorts the last 7 days. Off: Needs you shows every unread message again.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `enabled` | body | boolean | yes | true turns AI Sorting on for the whole workspace (1 credit per message sorted; turning it on also sorts the last 7 days). false turns it off and Needs you goes back to showing every unread message. |
| `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 PATCH   "https://api.trustpager.com/functions/v1/api/v1/email/ai-sorting"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"enabled":"...","require_approval":"..."}'
```

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