Create an endpoint
const url = 'https://api.clearance.rest/webhooks/endpoints';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"url":"example","event_types":["example"],"description":"example","enabled":true,"secret":"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 https://api.clearance.rest/webhooks/endpoints \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "url": "example", "event_types": [ "example" ], "description": "example", "enabled": true, "secret": "example" }'A project can have at most 20 endpoints. The signing secret is returned only in this response and when it is rotated.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Https URL (http is allowed only for localhost); at most 2048 characters.
Event types and patterns: an exact type, number.*, email_account.*, balance.* or *. At most 32 items.
At most 200 characters.
Defaults to true.
Signing secret (16-128 characters). Generated when omitted.
Examplegenerated
{ "url": "example", "event_types": [ "example" ], "description": "example", "enabled": true, "secret": "example"}Responses
Section titled “Responses”Default Response
object
A webhook subscription including its signing secret.
object
Subscribed event types and patterns.
Why the endpoint is disabled: manual (disabled through the API) or failing (disabled automatically after repeated failed deliveries); null while enabled.
UTC timestamp (ISO 8601).
UTC timestamp (ISO 8601).
Signing secret (whsec_…). Returned only when the endpoint is created or its secret is rotated.
Example
{ "success": true}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}Default Response
Error envelope returned by every JSON endpoint.
object
object
Machine-readable error code (snake_case).
Human-readable message.
Extra context for the error.
object
Example
{ "success": false}