# PATCH /opportunities/:opportunity_id/retention

**Resource:** [JOB_COSTING](./job-costing.md)  
**MCP tool:** `set_job_retention`  
**Scopes:** `opportunities:write`  
**Write operation:** yes

Set the retention on a job: the percent held back from every progress invoice (0 to 20), billed later with release_retention. Applies to progress invoices made from now on; earlier ones keep what they held.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `opportunity_id` | path | string | yes | UUID of the opportunity (the job), from list_opportunities. |
| `retention_percent` | body | number | no | Retention: the percent held back from every progress invoice on this job, 0 to 20 (for example 5). Send 0 or null for none. Applies to progress invoices made from now on. |
| `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/opportunities/:opportunity_id/retention"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"retention_percent":"...","require_approval":"..."}'
```

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