Create a webhook endpoint (secret answered once)
const url = 'http://localhost:3000/capture/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"connectionId":"example","url":"https://example.com","payloadFormat":"unified","events":["example"],"description":"example","brevoAuth":{"type":"none"},"customHeaders":[{"key":"example","value":"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/capture/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "connectionId": "example", "url": "https://example.com", "payloadFormat": "unified", "events": [ "example" ], "description": "example", "brevoAuth": { "type": "none" }, "customHeaders": [ { "key": "example", "value": "example" } ], "enabled": true }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Responses
Section titled “Responses”Created.
object
object
object
Example
{ "payloadFormat": "unified", "canonicalEvents": [ "email.sent" ], "unsupportedEvents": [ "email.sent" ], "brevoAuth": { "type": "none" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Error: validation_error
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Error: unauthorized
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Sent with every 401.
Sent with every 401.
Error: forbidden
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Error: payload_too_large
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Error: validation_error
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Error: internal_error
object
object
Example
{ "error": { "code": "unauthorized" }}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.