# PATCH /opportunities/:id

**Resource:** [Opportunities](./opportunities.md)  
**Scopes:** `opportunities:write`  
**Write operation:** yes

Update an existing opportunity. Only include fields you want to change. Every successful PATCH emits a field-level audit row to crm_field_change_log (viewable at /data/crm-logs with the crm_audit:read scope). Legacy alias: PATCH /deals/:id.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Opportunity ID |
| `name` | body | string | no | Opportunity name |
| `contact_id` | body | uuid | no | Primary contact ID |
| `customer_id` | body | uuid | no | Company ID |
| `currency` | body | string | no | Currency code |
| `lead_source` | body | string | no | Lead source |
| `tags` | body | object[] | no | Tags. Each tag is {name: string, color?: string}. Plain strings are also accepted. Replaces entire tags array. |
| `notes` | body | string | no | Notes |
| `metadata` | body | object | no | Custom field values as { field_id: value } pairs. Replaces entire metadata object -- read first with GET /opportunities/:id and merge locally. Reserved key: "quick_links" stores per-opportunity Quick Link URLs as { <type-uuid>: <url> }. UUID-shaped keys at metadata root are rejected (400). |

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