Skip to content
API console (try a request with your own key)Get early access

Send a webhook endpoint a test event

POST
/v1/webhooks/{webhookId}/test
#!/usr/bin/env bash
set -euo pipefail
API=https://api.speccapture.com
AUTH="Authorization: Bearer $SPECCAPTURE_API_KEY"
WEBHOOK_ID=0f8fad5b-d9cb-469f-a165-70867728950e # the webhookId from adding the endpoint
delivery=$(curl -sS --fail-with-body -X POST "$API/v1/webhooks/$WEBHOOK_ID/test" \
-H "$AUTH") || { echo "$delivery" >&2; exit 1; }
jq -r '"Test event \(.eventId): \(.status)"' <<<"$delivery"
if [[ "$(jq -r '.lastError' <<<"$delivery")" != null ]]; then
jq -r '" \(.lastError)"' <<<"$delivery"
fi

Sends the endpoint a webhook.test event at once, signed with its secret exactly as every event is, so a receiver can be checked end to end without reading a drawing: it costs no credits. Its body carries the endpoint under data.webhook, as GET /v1/webhooks/{webhookId} returns it. It is sent once and never retried, and goes into the endpoint’s delivery log like any delivery. The answer is 200 with that delivery: status delivered when the endpoint answered 2xx within 10 seconds, else dead, with lastResponseCode and lastError saying what happened. An endpoint that answers 410 Gone is stopped, as for any event. A workspace may send 5 test events a minute; past that, 429 rate_limited with Retry-After. A stopped endpoint is 409 webhook_stopped: turn it back on first. A key acting as the workspace’s owner or an admin.

webhookId
required
string format: uuid

The endpoint’s id: the webhookId POST /v1/webhooks answered with, or one GET /v1/webhooks lists.

OK

Media typeapplication/json

One event’s delivery to one endpoint, as the delivery log records it: GET /v1/webhooks/{webhookId}/deliveries. Never the body or the signature.

object
deliveryId
required

The delivery’s number in the endpoint’s log.

integer format: int64
eventId
required

The event’s id (evt_...): the webhook-id header every attempt carried.

string
eventType
required

What happened: extraction.completed, extraction.failed, extraction.reviewed, extraction.updated or export.ready - or webhook.test, a test event sent when the workspace asked for one.

string
jobId
required

The extraction the event is about; null for an export’s event (exportId) and for a test event, which is about neither.

null | string format: uuid
url
required

Where it was sent: the endpoint’s URL when the event was queued.

string
status
required

Where the delivery stands.

string
Allowed values: pending delivered dead
attempts
required

How many attempts have started, the one under way included.

integer format: int32
lastResponseCode
required

The HTTP status the endpoint last answered with; null when it never answered (refused, timed out).

null | integer format: int32
lastAttemptAt
required

When the latest attempt started; null before the first.

null | string format: date-time
nextAttemptAt
required

While pending, when the next attempt may start; null once delivered or given up.

null | string format: date-time
lastError
required

What went wrong with the latest attempt, in words; null once delivered.

null | string
createdAt
required

When the event was queued for this endpoint.

string format: date-time
deliveredAt
required

When the endpoint answered 2xx; null until it has.

null | string format: date-time
exportId

The export the event is about (export.ready); null for an extraction’s event and for a test event.

null | string format: uuid

Examples

The endpoint took the test event at once

{
"deliveryId": 1044,
"eventId": "evt_9c1d4e7a2b5f8063c4d1e9a7b2f5c8d0",
"eventType": "webhook.test",
"jobId": null,
"url": "https://erp.example.com/hooks/speccapture",
"status": "delivered",
"attempts": 1,
"lastResponseCode": 200,
"lastAttemptAt": "2026-10-14T11:20:03+00:00",
"nextAttemptAt": null,
"lastError": null,
"createdAt": "2026-10-14T11:20:03+00:00",
"deliveredAt": "2026-10-14T11:20:03+00:00",
"exportId": null
}

Forbidden: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong with this request and what to do about it, in a sentence or two for a person. Present on nearly every problem.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplerole_not_allowed

This key's role does not allow this.

{
"type": "https://speccapture.com/docs/api/errors#role_not_allowed",
"title": "This key's role does not allow this.",
"status": 403,
"detail": "This key acts with the member role of the person who created it, which cannot do this. Use a key created by the workspace's owner or an admin.",
"instance": "/v1/webhooks/0f8fad5b-d9cb-469f-a165-70867728950e/test",
"code": "role_not_allowed",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"keyRole": "member"
}

Not Found: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong with this request and what to do about it, in a sentence or two for a person. Present on nearly every problem.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplenot_found

Not found.

{
"type": "https://speccapture.com/docs/api/errors#not_found",
"title": "Not found.",
"status": 404,
"detail": "There is no webhook with this id in your workspace.",
"instance": "/v1/webhooks/0f8fad5b-d9cb-469f-a165-70867728950e/test",
"code": "not_found",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Conflict: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong with this request and what to do about it, in a sentence or two for a person. Present on nearly every problem.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplewebhook_stopped

The webhook endpoint is stopped.

{
"type": "https://speccapture.com/docs/api/errors#webhook_stopped",
"title": "The webhook endpoint is stopped.",
"status": 409,
"detail": "This endpoint is stopped: it answered 410 Gone, which says it accepts no more events, so nothing is sent to it - a test event included. Turn it back on with POST /v1/webhooks/{webhookId}/resume, then send the test again.",
"instance": "/v1/webhooks/0f8fad5b-d9cb-469f-a165-70867728950e/test",
"code": "webhook_stopped",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"stoppedAt": "2026-10-09T18:44:02+00:00"
}

Too Many Requests: a problem with a stable code. See Errors for every code and what to do about it.

Media typeapplication/problem+json

Every error: a problem with a stable code. https://speccapture.com/docs/api/errors lists every code.

object
type
required

A link to the code’s entry in the docs.

string
title
required

What went wrong, in a few words for a person: the same for every problem with this code.

string
status
required

The HTTP status of the answer.

integer format: int32
detail

What went wrong with this request and what to do about it, in a sentence or two for a person. Present on nearly every problem.

string
instance
required

The path of the request that was refused.

string
code
required

What went wrong, as a stable code to branch on: a published code never changes meaning.

string
traceId
required

This request’s trace: quote it when asking for help.

string

Examples

Examplerate_limited

Too many requests.

{
"type": "https://speccapture.com/docs/api/errors#rate_limited",
"title": "Too many requests.",
"status": 429,
"detail": "A workspace may send 5 test events a minute, and this one has. Try again in 38 seconds.",
"instance": "/v1/webhooks/0f8fad5b-d9cb-469f-a165-70867728950e/test",
"code": "rate_limited",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"retryAfterSeconds": 38
}