Create webhook endpoint
const url = 'http://localhost:8080/v1/webhook-endpoints/endpoints';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"example","description":"example","events":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/v1/webhook-endpoints/endpoints \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "example", "description": "example", "events": [ "example" ] }'Returns the endpoint plus its signing secret (shown once). Event names are validated against the emit catalog — subscribing to an event Hardcount never emits is a 422, not silence. Omitted/empty events = all events (“”); “invoice.”-style prefix wildcards are supported.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Makes the call safe to retry. Send a unique value (a UUID works) and
the same value on every retry. For 24 hours, a repeat with the same
key, method, path and body gets the first response again, with an
Idempotent-Replayed: true header, instead of running again. The
error cases are in docs/api-surface.md. The usage routes do not take
it: each usage event carries its own idempotency_key.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "url": "example", "description": "example", "events": [ "example" ]}Responses
Section titled “Responses”Endpoint created (response carries the one-time signing secret)
A new webhook endpoint and its signing secret. The secret is shown only here.
object
object
Subscribed event types. * means all.
False = paused.
The previous signing secret, during a rotation grace period.
The signing secret (whsec_…). Store it now; Hardcount does not show it again.
Example generated
{ "endpoint": { "id": "example", "tenant_id": "example", "livemode": true, "url": "example", "description": "example", "secret_last4": "example", "events": [ "example" ], "active": true, "secondary_secret_last4": "example", "secondary_secret_expires_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z", "updated_at": "2026-04-15T12:00:00Z" }, "secret": "example"}Invalid URL or unknown event type