> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Create webhook endpoint


`POST /v1/webhook_endpoints`

The signing secret is returned once, at creation, and never again. An omitted or empty `enabledEvents` subscribes the endpoint to ALL events.

Auth: a secret key with the `webhookEndpoints.create` permission. Returns `201` with Webhook endpoint.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string · HTTPS URL | Yes | The HTTPS URL that receives webhook events. |
| `enabledEvents` | body | array | No | Event types delivered to this endpoint. An empty array subscribes to every event. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/webhook_endpoints" \
  -H "Authorization: Bearer $MYELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/webhooks/myela",
  "enabledEvents": [
    "invoice.paid",
    "payment.settled",
    "payment.refunded"
  ]
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/webhook_endpoints", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://example.com/webhooks/myela",
    "enabledEvents": [
      "invoice.paid",
      "payment.settled",
      "payment.refunded"
    ]
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/webhook_endpoints",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
    },
    json={
        "url": "https://example.com/webhooks/myela",
        "enabledEvents": [
            "invoice.paid",
            "payment.settled",
            "payment.refunded"
        ]
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique endpoint identifier. |
| `object` | "webhook_endpoint" | Stable resource discriminator. |
| `url` | string | Delivery destination. |
| `description` | string \| null | Optional endpoint description. |
| `enabledEvents` | string[] | Subscribed event types. |
| `status` | string | Endpoint state. |
| `secretLast4` | string | Last four characters of the signing secret. |
| `createdAt` | string | ISO 8601 creation timestamp. |

```json
{
  "id": "whe_01JEXAMPLE",
  "object": "webhook_endpoint",
  "url": "https://example.com/webhooks/myela",
  "description": null,
  "enabledEvents": [
    "invoice.paid",
    "payment.settled"
  ],
  "status": "enabled",
  "secretLast4": "m9Qx",
  "createdAt": "2026-08-10T20:49:51.653Z",
  "secret": "whsec_shown_once_after_creation"
}
```

Source: https://docs.merchantservicedepot.com/api-reference/create-webhook-endpoint/
