---
title: "Update Escalation Config"
description: "Updates the escalation config. The :id parameter is the organization ID. If no config exists, one is upserted."
---

`PATCH /api/escalation-config/:id`

## Request Body (all optional)

| Field | Type | Description |
|-------|------|-------------|
| `webhookUrl` | string\|null | Webhook URL. Set to `null` to deactivate the webhook channel. |
| `webhookMethod` | string | HTTP method: `POST`, `PUT`, or `PATCH` |
| `webhookHeaders` | object\|string | JSON headers object |
| `webhookBodyTemplate` | string | JSON body template with `{{variables}}` |
| `webhookTimeout` | integer | Timeout in seconds |
| `webhookRetryAttempts` | integer | Number of retries |
| `webhookRetryDelay` | integer | Seconds between retries |
| `expectedStatusCodes` | string | Comma-separated expected status codes |
| `isActive` | boolean | Enable or disable the webhook |
| `defaultEmail` | string | **Side-effect:** creates/updates an org-level email notification channel |
| `defaultPhoneNumber` | string | **Side-effect:** creates/updates an org-level SMS notification channel |

## Example (cURL)

```bash
curl -X PATCH "$BASE_URL/api/escalation-config/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://deinkunde.com/webhook",
    "webhookMethod": "POST",
    "webhookHeaders": { "Content-Type": "application/json" },
    "webhookTimeout": 30,
    "webhookRetryAttempts": 3,
    "isActive": true,
    "defaultEmail": "alerts@deinkunde.com"
  }'
```

## Common errors

- `401 Unauthorized` when not authenticated
- `403 Forbidden` with insufficient permissions

## Response

Returns the updated escalation config object. See [Error Codes](/api/error-codes-and-known-pitfalls) for error responses.
