# Register an endpoint

`POST /api/v1/webhook-endpoints`

Requires `webhooks.manage`. The URL must be https on a publicly routable host (loopback, private and link-local ranges are refused, at registration and again at connect time; redirects are never followed). `events` must be event types from the catalogue. The signing secret is returned ONCE; verify `x-mint-signature: t=<unix>,v1=<hex>` as HMAC-SHA256 over `${t}.${rawBody}`. Each event is tried up to 12 times over about 3 days (immediately, 5 s, 5 min, 30 min, 2 h, 5 h, 10 h, then every 10 h); any 2xx within 10 s is a delivery. After 3 days of failures the endpoint is disabled and its undelivered events are kept 30 days for replay.

Needs the `webhooks:write` scope, or a full-access key.

## Request body

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "customer.created",
          "subscription.created",
          "subscription.updated",
          "subscription.paused",
          "subscription.resumed",
          "subscription.canceled",
          "subscription.renewed",
          "invoice.created",
          "invoice.finalized",
          "invoice.paid",
          "invoice.payment_failed",
          "invoice.voided",
          "invoice.uncollectible",
          "payment.refunded",
          "payment_method.attached",
          "dunning.retry.scheduled",
          "dunning.campaign.exhausted",
          "entitlements.updated",
          "credit_note.issued",
          "subscription.discount_applied",
          "subscription.discount_removed",
          "customer.balance_updated",
          "checkout.session.completed",
          "subscription.trial_will_end",
          "customer.updated",
          "payment.succeeded",
          "subscription.renewal_upcoming",
          "subscription.price_change_scheduled",
          "subscription.price_change_applied",
          "subscription.price_change_canceled",
          "api_key.expiring"
        ],
        "description": "An event GlobalyMint delivers."
      }
    }
  },
  "required": [
    "url"
  ]
}
```

## Responses

### 201

The endpoint and its one-time signing secret.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "events": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Empty means EVERY event type."
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "disabled"
              ]
            },
            "mode": {
              "type": "string",
              "enum": [
                "test",
                "live"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time"
            },
            "disabledReason": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "delivery_failures",
                null
              ],
              "description": "Set when GlobalyMint disabled the endpoint after 3 days of failed deliveries; null when a person disabled it."
            },
            "disabledAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "failingSince": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "First failed try since the last delivery."
            },
            "previousSecretExpiresAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "During a rotation overlap: until when the previous signing secret also signs."
            },
            "delivered24h": {
              "type": "integer",
              "description": "Events delivered in the last 24 hours."
            },
            "failed24h": {
              "type": "integer",
              "description": "Deliveries given up on in the last 24 hours."
            },
            "retrying": {
              "type": "integer",
              "description": "Deliveries that failed and have another try scheduled."
            },
            "waiting": {
              "type": "integer",
              "description": "Undelivered events from the last 30 days that a replay would send."
            }
          },
          "required": [
            "id",
            "url",
            "events",
            "status",
            "mode",
            "createdAt",
            "disabledReason",
            "disabledAt",
            "failingSince",
            "previousSecretExpiresAt",
            "delivered24h",
            "failed24h",
            "retrying",
            "waiting"
          ]
        },
        {
          "type": "object",
          "properties": {
            "secret": {
              "type": "string",
              "example": "whsec_..."
            }
          },
          "required": [
            "secret"
          ]
        }
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
