Send a test event
Use this endpoint to check that a webhook endpoint receives, verifies and handles a signed delivery before relying on it for real events. It queues a single webhook.test delivery and returns its identifier, so you can trace the attempt through lastDelivery.
What the call does
Send POST /v2/webhooks/{id}/test with no request body. The id path parameter is the webhook identifier. Authorization uses a bearer API key carrying the webhooks:write scope. A successful call returns 202 and a deliveryId; the same identifier is sent as the VT-Delivery-Id header on the delivery. Because no operation is created, the delivery result is followed through the webhook's lastDelivery rather than through an operation record.
Checklist for a useful test
Before you send: confirm the key has webhooks:write, confirm the webhook id is correct and not revoked, and make sure your endpoint can verify the signature and return a success status. After you send: capture the deliveryId from the 202 response, confirm the signed webhook.test event arrives with the usual headers, then check lastDelivery for the recorded outcome. If nothing arrives, check the endpoint URL, signature verification and any pause state before sending another test.
Delivery behaviour to expect
The test delivery is signed and uses the same headers as any other event, but it is attempted only once and never retried. It is also sent to paused webhooks. A 410 Gone response from your endpoint pauses the webhook with pausedReason: endpoint-gone. The Idempotency-Key and X-On-Behalf-Of headers have no effect on this call.
Errors worth distinguishing
A 403 means the key owner no longer exists, 404 means the webhook was not found, and 409 means the webhook has been revoked. Other documented responses include 400 for validation, 401 for a missing or unrecognised key, 429 for rate limiting and 500 for an internal error. Match the error code and requestId in the response body when diagnosing a failure.
| Status | Meaning for this call | What to check |
|---|---|---|
| 202 | Test delivery queued | Save deliveryId and check lastDelivery |
| 400 | Validation failed | Fields listed in details.fields |
| 401 | Key missing or unrecognised | Authorization bearer key |
| 403 | Key owner no longer exists | Key ownership and validity |
| 404 | Webhook not found | Webhook id in the path |
| 409 | Webhook revoked | Create a new webhook |
| 429 | Rate limited | Wait and retry |
| 500 | Internal error | Retry later and quote requestId |
Statuses documented for this endpoint; error bodies follow the shared error envelope.
Frequently asked questions
Does sending a test event create an operation?
No. This call does not create an operation. Use the returned deliveryId, also sent as VT-Delivery-Id, and check the webhook's lastDelivery to see the outcome.
Will a paused webhook receive a test event?
Yes. Paused webhooks still receive the test delivery. If the endpoint answers 410 Gone, the webhook is paused with pausedReason: endpoint-gone.
Is a failed test delivery retried?
No. The test delivery is attempted once and is not retried, even though it is signed and carries the same headers as other events.
Do Idempotency-Key or X-On-Behalf-Of affect this call?
They are ignored for this call, as is any request body. Send the POST with authorization and the webhook id in the path only.
curl -X POST "$API_BASE_URL/v2/webhooks/wh_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93/test" \
-H "Authorization: Bearer "{
"data": {
"deliveryId": "dlv_1790157600000_8a47c61e2b7f4d5e9c613f1c2b9e1d93"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"name": "ValidationError",
"description": "Example post details.",
"resolution": "Fix the fields listed in details.fields and send the request again.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
"details": {
"fields": [
{
"path": "startDate",
"message": "\"startDate\" is required"
}
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"name": "Unauthorized",
"description": "Example post details.",
"resolution": "Send a valid API key in the Authorization header as Bearer followed by the full vt_live_ key.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "INSUFFICIENT_SCOPE",
"name": "InsufficientScope",
"description": "Example post details.",
"resolution": "Add the scopes listed in details.requiredScopes to the key in the OnlyLeave dashboard.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
"details": {
"requiredScopes": [
"leaves:write"
]
}
}
}{
"error": {
"code": "WEBHOOK_NOT_FOUND",
"name": "Webhook not found",
"description": "Example post details.",
"resolution": "Check the webhook ID.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "WEBHOOK_REVOKED",
"name": "Webhook revoked",
"description": "Example post details.",
"resolution": "Delete the webhook and create a new one.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "RATE_LIMITED",
"name": "RateLimited",
"description": "Example post details.",
"resolution": "Wait a few seconds and retry, using the same Idempotency-Key for writes.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"name": "InternalError",
"description": "Example post details.",
"resolution": "Retry later, and if it keeps happening, contact OnlyLeave support and quote the requestId.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | string | Yes | webhook ID. |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | object | Yes | ||
| response.data.deliveryId | string | Yes | the ID of the test delivery, sent as the VT-Delivery-Id header |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |