Webhooks_create
const url = 'http://localhost:3000/api/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"example","eventTypes":["example"],"enabled":true}'};
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:3000/api/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "example", "eventTypes": [ "example" ], "enabled": true }'Create a resource
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body for creating a webhook endpoint
object
Destination URL (absolute http or https)
Event names to receive; empty or absent means all events
Whether the endpoint receives deliveries (default true)
Example generated
{ "url": "example", "eventTypes": [ "example" ], "enabled": true}Responses
Section titled “Responses”The request has succeeded and a new resource has been created as a result.
Outbound webhook endpoint. The HMAC signing secret is deliberately absent: it is never returned through the external API (view it in the app).
object
Unique identifier
Destination URL events are POSTed to
Event names this endpoint receives; empty means all events
Whether the endpoint receives deliveries
Why the endpoint turned itself off; absent when an owner disabled it or it is enabled
Present while deliveries are failing; cleared by the next 2xx
object
Deliveries that failed in a row
When the current run of failures began
When the latest delivery failed
Kind of the latest failure
HTTP status of the latest failure; present only for kind http_status
Creation timestamp
Last update timestamp
Example
{ "disabledReason": "gone", "failure": { "kind": "timeout" }}RFC 7807 bad request response
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}RFC 7807 unauthorized response
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}RFC 7807 validation response
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}RFC 7807 too many requests response: a rate limit was exceeded (ADR 0025)
RFC 7807 Problem Details
object
Why the request was refused, when the client should act on it
A URI reference that identifies the problem type
A short, human-readable summary of the problem type
HTTP status code
A human-readable explanation specific to this occurrence
A URI reference that identifies the specific occurrence
Validation errors grouped by field
object
Form-level validation error
Field validation errors
object
Seconds to wait before retrying; set on a 429 so a client that only sees the body can show the wait
Why a 500 happened, sent only by a development server (SPHERICON_ENV=development)
object
The error that failed the request, or the panic value
The goroutine stack of a panic; absent for an error a handler returned
The request id the server log carries for this request
The HTTP method of the failed request
The path of the failed request
Example
{ "code": "second_factor_required"}Headers
Section titled “Headers”Seconds to wait before retrying
The request budget of the window that was exceeded
Requests left in the current window
Unix time at which the window resets