Skip to content

Send a test event to a webhook endpoint

POST
/v1/webhooks/{id}/test
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.

id
required
string

What the endpoint answered.

Media typeapplication/json
object
delivered
required

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.

boolean
resumed
required

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.

boolean
eventId
required

The id of the test event, as the endpoint received it — to find it in its logs.

string format: uuid
eventType
required

The type of the event sent: always webhook.test.

string
Allowed values: webhook.test
statusCode
required

The HTTP status the endpoint answered; null when it never answered.

number
nullable
durationMs
required

How long it took, in milliseconds, from the URL check to the end of the answer.

number
failure
required

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.

string
nullable
Allowed values: url_invalid timeout tls connection http_status expired
failureDetail
required

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.

string
nullable
responseExcerpt
required

The first 500 characters of what the endpoint answered, as text; null when it answered nothing or never answered.

string
nullable
sentAt
required

When the test was sent.

string format: date-time
Example
{
"eventType": "webhook.test",
"statusCode": 200,
"durationMs": 184,
"failure": "url_invalid",
"failureDetail": "ECONNREFUSED",
"responseExcerpt": "{\"error\":\"invalid signature\"}"
}