# Register a webhook endpoint

Registers a URL to receive events. The response includes
`signing_secret`, shown only this once: store it, and use it to
verify the `X-Dime-Signature` header on every delivery.
The URL must be `https://`, must not contain a username or password,
and must resolve to a public internet address; Dime checks this
before saving. Leave `enabled_events` out to receive every event, or
list the ones you want from `GET /webhook-event-types`.

Endpoint: POST /webhook-endpoints
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `url` (string, required)
    Must be `https://` and resolve to a public address.
    Example: https://example.com/webhooks/dime

  - `description` (string)
    Example: Production order events

  - `enabled_events` (array)
    Event types to receive, from `GET /webhook-event-types`. Omit for every event.
    Example: ["payment.succeeded","payment.failed"]

## Request examples:

  - `Every event` (unknown)

  - `Payment outcomes only` (unknown)

## Response 201:

  - `201` (unknown)
    The endpoint, with its signing secret.

## Response 201 fields (application/json):

  - `token` (string)
    Identifies the endpoint. Used in URLs, and as `endpoint_id` on an event's deliveries.
    Example: hep_kBXRfasu_Ard5VWhe_xECb9iAV_IyX1JdD

  - `object` (string)
    Enum: "webhook_endpoint"

  - `url` (string)
    Example: https://example.com/webhooks/dime

  - `description` (string | null)
    Example: Production order events

  - `is_active` (boolean)
    `false` stops deliveries; events are still recorded.
    Example: true

  - `enabled_events` (array | null)
    Event types this endpoint receives. `null` means every event.
    Example: null

  - `created_at` (string)
    Example: 2026-10-28T14:02:11.000Z

  - `signing_secret` (string)
    HMAC key for verifying deliveries. Returned only when the
endpoint is created or the secret is rotated.
    Example: whsec_V1StGXR8_Z5jdHi6BmyT2kQ4pL7nR9sW1xZ3cE5v

## Response 400:

  - `400` (unknown)
    The URL or event list was rejected.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 201 examples:

  - `Store the secret now` (unknown)

## Response 400 examples:

  - `The URL is not public` (unknown)

  - `An event type is not in the catalogue` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

