# Create a webhook endpoint (/docs/api/webhook-endpoints/create-webhook-endpoint)

## Create a webhook endpoint

`POST https://runepay.co/api/v1/webhook_endpoints`

Returns the signing `secret` once. A retry with the same Idempotency-Key gets `409 secret_not_replayable` with the endpoint id instead of the secret.

Scope: `webhook_endpoints:write`

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Makes a retry safe: the same key and body within 24 hours does not repeat the request. |

Body:

| Field | Type | Description |
| --- | --- | --- |
| `api_version` | string | Event envelope version. Defaults to 2026-12-15. |
| `description` | string or null |  |
| `metadata` | object | Your own key-value strings, returned as sent. |
| `url` (required) | string | A public HTTPS URL. |
| `enabled_events` (required) | array | Event types to deliver, or `["*"]` for all. |

Example request body:

```json
{
  "url": "https://merchant.example/hooks",
  "enabled_events": [
    "*"
  ]
}
```

Response `201`:

```json
{
  "id": "we_01KA9F6G8H0J2K4M6N8P0Q2R4S",
  "object": "webhook_endpoint",
  "url": "https://merchant.example/hooks",
  "livemode": false,
  "enabled_events": [
    "*"
  ],
  "status": "enabled",
  "api_version": "2026-12-15",
  "description": null,
  "metadata": {},
  "created": 1767225600,
  "secret": "whsec_9fK2mQ7xR4tV1wY8zA3bC6dE0gH5jL"
}
```

Errors: 400, 401, 403, 409, 413, 422, 500, 503, with the [error shape](/docs/api/errors).
