---
title: "Test Escalation Config"
description: "Tests the escalation config by sending a test webhook, PagerDuty event, or Pushover notification. All body fields are optional and override DB values for testing."
---

`POST /api/escalation-config/:id/test`

## Request Body (all optional)

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | `pagerduty` or `pushover` for dedicated handlers |
| `config` | object | PagerDuty config `{routingKey}` or Pushover config `{userKey, apiToken}` |
| `webhookUrl` | string | Override webhook URL for test |
| `webhookMethod` | string | Override webhook method |
| `webhookHeaders` | object | Override webhook headers |
| `webhookBodyTemplate` | string | Override webhook body template |
| `webhookTimeout` | number | Override webhook timeout |
| `expectedStatusCodes` | string | Override expected status codes |

## Example (cURL): Webhook test

```bash
curl -X POST "$BASE_URL/api/escalation-config/1/test" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://httpbin.org/post",
    "webhookMethod": "POST",
    "webhookTimeout": 15
  }'
```

## Example (cURL): PagerDuty test

```bash
curl -X POST "$BASE_URL/api/escalation-config/1/test" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "pagerduty",
    "config": { "routingKey": "your-routing-key-here" }
  }'
```

## Response (webhook)

```json
{ "success": true, "statusCode": 200, "message": "Webhook delivered successfully" }
```

## Response (PagerDuty)

```json
{ "success": true, "message": "PagerDuty event enqueued successfully" }
```

## Common errors

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

