# PATCH /api/v1/ap-approval/thresholds

> Update approval thresholds

- **Tag:** ap-approval
- **Operation ID:** `update_thresholds_api_v1_ap_approval_thresholds_patch`

## Description

Update amount thresholds and/or escalation timeout without re-provisioning. Only provided fields are changed; the rest retain their current values.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `UpdateThresholdsRequest`

- `auto_approve_max_cents` (integer) — Max bill amount (cents) for auto-approval. Must be less than ops threshold.
- `ops_approve_max_cents` (integer) — Max bill amount (cents) for ops-tier approval. Must be greater than auto threshold.
- `escalation_hours` (integer) — Hours before a pending approval automatically escalates to the next tier. Applies to ops and advisor gates. Set to null to use per-gate defaults.

## Responses

### 200 — Successful Response

Schema: `UpdateThresholdsResponse`

- `workflow_id` (string · required) — Workflow UUID.
- `auto_approve_max_cents` (integer · required) — Auto-approve threshold in cents.
- `ops_approve_max_cents` (integer · required) — Ops approval threshold in cents.
- `escalation_hours` (integer) — Escalation timeout in hours (null = per-gate default).

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PATCH 'https://api.ondayzero.com/api/v1/ap-approval/thresholds' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "auto_approve_max_cents": 0,
  "ops_approve_max_cents": 0,
  "escalation_hours": 0
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/ap-approval/thresholds', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "auto_approve_max_cents": 0,
  "ops_approve_max_cents": 0,
  "escalation_hours": 0
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "auto_approve_max_cents": 0,
  "ops_approve_max_cents": 0,
  "escalation_hours": 0
}

response = httpx.patch("https://api.ondayzero.com/api/v1/ap-approval/thresholds", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/ap-approval/update-thresholds
- OpenAPI slice: https://www.ondayzero.com/docs/reference/ap-approval/update-thresholds/openapi.json
- Other endpoints in **ap-approval**: https://www.ondayzero.com/docs/reference/ap-approval
