# PATCH /opportunities/lead-segments/:segment_id

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

Change a lead segment's name, purpose, rules, daily limit, or switch it on or off. Changing the rules or switching it on records who is in it at that moment without starting anything.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `segment_id` | path | string | yes | The lead segment ID (from list_lead_segments). |
| `name` | body | string | no | Short name, up to 80 characters, e.g. "Hot, not contacted". |
| `description` | body | string | no | What the segment is for, one sentence. Send "" to clear. |
| `rules` | body | object | no | Who is in it. rules = { "include": [condition, ...], "exclude": [condition, ...] }. A lead is in the segment when it matches EVERY include and NO exclude. At least one include is required.
A condition is { "field", "op", "value" }:
- score \| fit \| interest: op "gte" or "lte", value 1 to 10 (unresearched leads never match).
- band: op "in", value from ["hot","warm","cool","none"] (hot is 8+, warm 5 to 7, cool under 5, none is not scored).
- kind: op "in", value from ["business","person","unknown","none"].
- status: op "in", value from ["open","won","lost"].
- feedback: op "in", value from ["not_a_fit","wrong_person","none"].
- contacted \| replied \| researched: op "is", value true or false.
- age_days: op "gte" (arrived at least N days ago) or "lte" (arrived in the last N days), value 0 to 365.
- quiet_days: op "gte", value 1 to 365 (days since the team last called, texted, emailed or met them, or since arrival).
- source: op "in", value a list of lead source names.
- pipeline \| stage: op "in", value a list of workflow or stage ids.
- assigned: op "in", value a list of user ids, or "none" for nobody assigned.
- custom: { "field": "custom", "key": "<custom field id>", "op": "eq" \| "neq" \| "contains" \| "empty" \| "not_empty", "value": "<text>" } (no value for empty / not_empty). |
| `daily_cap` | body | number | no | The most leads a day that can join and start its automations (1 to 1000, default 25). Leads over the limit still join, quietly. |
| `is_active` | body | boolean | no | false pauses it: no one joins and nothing starts. Switching it on records who is already in it without starting anything. |
| `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/lead-segments/:segment_id"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","description":"...","rules":"..."}'
```

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