Create a webhook endpoint
/v1/webhooksCreates a webhook endpoint. The response includes a signing_secret (prefixed whksec_…) that is returned only once — store it immediately and use it to verify the HMAC-SHA512 signature on each incoming request.
mode is immutable after creation — a test-mode endpoint only receives test-mode events, and likewise for live. Pass events: ["*"] to subscribe to every event type.
Body parameters
modeenum<'test' | 'live'>requiredWhich mode this endpoint receives events for. Immutable after creation — create separate endpoints for test and live traffic.
urlstringrequiredHTTPS URL TagPay will POST event payloads to.
eventsarray<string>requiredEvent types to deliver to this endpoint, or ["*"] to subscribe to all events.
Response
200idstringEndpoint ID (`whk_…`).
modeenum<'test' | 'live'>Mode this endpoint receives events for.
urlstringThe URL events will be POSTed to.
eventsarray<string>Event types this endpoint is subscribed to.
signing_secretstringHMAC-SHA512 secret for verifying deliveries. **Only returned at creation.**
created_atstringISO-8601 creation timestamp.
Errors
INVALID_URL400URL must be a valid HTTPS URL.INVALID_EVENTS400Events array must be non-empty and contain valid event types.INVALID_KEY401API key missing or invalid.