Send a test event to a webhook endpoint
const url = 'https://api.emite.cr/v1/webhooks/example/test';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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.emite.cr/v1/webhooks/example/test \ --header 'Authorization: Bearer <token>'Sends one webhook.test event to this endpoint right now, signed with its secret like any delivery, and answers what happened. data carries endpointId and a fixed message; environment is the endpoint's, as in every event it receives. Nobody subscribes to webhook.test, it describes no document, and it is not retried: a receiver verifies its signature, answers 2xx and does nothing else with it. On an active endpoint the failure count and last success or failure stay as they were; on a paused or disabled one, a test that gets through brings it back (resumed: true) and what waited goes out. A failed delivery is an answer (200 with delivered: false), not an error. 404 WEBHOOK_ENDPOINT_NOT_FOUND for an endpoint that is not the company's, and 429 WEBHOOK_TEST_RATE_LIMITED (with Retry-After) past 10 tests in 10 minutes per company.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”What the endpoint answered.
object
Whether the endpoint answered with a 2xx. The test is not retried, and on an active endpoint it leaves the failure count, lastSuccessAt and lastFailureAt as they were.
Whether this test brought the endpoint back: a paused one resumes (what waited goes out) and a disabled one is reactivated. false on an active endpoint, and when it failed.
The id of the test event, as the endpoint received it — to find it in its logs.
The type of the event sent: always webhook.test.
The HTTP status the endpoint answered; null when it never answered.
How long it took, in milliseconds, from the URL check to the end of the answer.
Why it failed; null when it was delivered. url_invalid: the URL does not pass the safety check any more (it resolves to a private address, or not at all), so nothing was sent. timeout: no answer within 10 seconds. tls: the TLS handshake failed (an expired or self-signed certificate, a name that does not match). connection: the connection could not be made or broke. http_status: it answered with something other than a 2xx — a redirect included, which is never followed.
More about the failure, when there is more: the reason of url_invalid (private_address, unresolvable…) or the system code of a tls or connection failure (CERT_HAS_EXPIRED, ECONNREFUSED). null otherwise.
The first 500 characters of what the endpoint answered, as text; null when it answered nothing or never answered.
When the test was sent.
Example
{ "eventType": "webhook.test", "statusCode": 200, "durationMs": 184, "failure": "url_invalid", "failureDetail": "ECONNREFUSED", "responseExcerpt": "{\"error\":\"invalid signature\"}"}