Change a webhook endpoint, or turn it off or on
const url = 'https://api.crossmart.io/api/v1/workspaces/example/webhook-endpoints/example';const options = { method: 'PATCH', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"url":"example","description":"example","eventTypes":["order.created"],"enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.crossmart.io/api/v1/workspaces/example/webhook-endpoints/example \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "url": "example", "description": "example", "eventTypes": [ "order.created" ], "enabled": true }'Turning an endpoint off fails what it still had to receive; turning it on clears its failure count. Events from while it was off are not sent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where events are POSTed. https and a public address; plain http only outside production.
The events to receive. webhook.test cannot be subscribed to.
False turns the endpoint off; true turns it back on and clears its failures
Responses
Section titled “Responses”object
False when turned off by someone or after repeated failures
MANUAL: turned off by someone. FAILING: turned off by Crossmart.
Failed attempts since the last delivery that went through
The latest delivery attempt, whatever event it carried; null before the first
object
SUCCEEDED: the endpoint answered 2xx. FAILED: anything else, or no answer.
Null when no response came: a timeout or a connection error
Why the attempt failed; null on success
Until then deliveries are also signed with the secret the last rotation replaced
Example
{ "url": "https://example.com/crossmart/webhooks", "description": "Order notifications to n8n", "eventTypes": [ "order.created" ], "disabledReason": "MANUAL", "lastDelivery": { "outcome": "SUCCEEDED", "responseStatus": 200, "error": "The endpoint answered with HTTP 503" }}The URL is not https (in production), or not a public address