Add a webhook; its signing secret is in this answer only
POST
/v1/webhooks
const url = 'https://api.sotirea.com/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"description":"example","events":["example"],"url":"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.sotirea.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "events": [ "example" ], "url": "example" }'Sotirea sends each event you choose to the address, signed to the Standard Webhooks specification with the secret in this answer, which is never shown again. Keep it beside the key, on your server.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
description
string
events
required
The event types to send it, from GET /v1/webhook-events.
Array<string>
url
required
An https address on the public internet.
string
Example generated
{ "description": "example", "events": [ "example" ], "url": "example"}Responses
Section titled “Responses”Done.
Media typeapplication/json
object
data
required
object
secret
required
The signing secret, whsec_…: verify every delivery with it. Shown once.
string
webhook
required
object
created_at
required
string format: date-time
created_by_name
required
The person or API key that added it.
string
description
required
string
disabled_reason
required
string
events
required
The event types sent to it.
Array<string>
failing
required
How many deliveries gave up.
integer
id
required
integer
url
required
string
waiting
required
How many deliveries are still being tried.
integer
meta
object
request_id
Quote it when asking about a request; it is in the X-Request-Id header too.
string
success
required
Example
{ "success": true}default
Section titled “default”Refused or failed, in words a person can act on.
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
meta
object
request_id
Quote it when asking about a request.
string
success
required
Example
{ "success": false}