POST/webhook-endpoints/{id}/test
Sends one signed delivery to the endpoint and returns the result: webhook.test, or a sample of any event with sampleEvent.
pf-api-keyRate limit: 600 requests per day, 60 per hour, 10 per minuteWhat gets sent
One signed delivery goes out while you wait, with the same headers and signature as a real event. It is not retried.
Without a body the delivery is webhook.test.
With sampleEvent the delivery is a fixed sample of that event in the real shape: ids of zeros (00000000-0000-4000-8000-000000000000), content "Sample post from PostFast", one image image/00000000-0000-4000-8000-000000000000.jpg, platform X, platformPostId sample-platform-post-id when published, a lastError with code SAMPLE when failed, and the account @sample on X. No customer data is read for it.
The sample account's followerCount is the number 0. On a real event it is a numeric string, as on GET /social-media/my-social-accounts.
A test counts like a real delivery
A failed test adds to the endpoint's failure streak, a successful one clears it, and a 410 turns the endpoint off.
The route also works on a disabled endpoint, which is a way to check a fixed receiver before re-enabling it. A test never turns the endpoint back on.
Path parameters
idstring (UUID)requiredThe endpoint's id, from POST /webhook-endpoints or GET /webhook-endpoints. A non-UUID returns 400.
Request body
sampleEventstringoptionalSend a sample of this event. It does not have to be one of the endpoint's events. Leave the body out to send webhook.test.
post.publishedpost.failedaccount.connectedaccount.disconnectedValues of error
error | What happened |
|---|---|
null | The receiver answered 2xx. |
timeout | No answer within 15 seconds. |
connection | PostFast could not connect to the receiver. |
tls | The receiver's certificate or TLS setup was refused. |
redirect | The receiver answered 3xx. Redirects are not followed. |
http_4xx | The receiver answered 4xx, other than 410. |
gone | The receiver answered 410, which also turns the endpoint off. |
http_5xx | The receiver answered with any other status, typically 5xx. |
blocked_address | The hostname now resolves to an address that is not public. |
Errors
| Status | message | When |
|---|---|---|
400 | webhook.disabled | Test route only: webhooks are switched off across PostFast for the moment. |
404 | webhook.notFound | No endpoint with this id in the workspace: it was deleted, it never existed, or it belongs to another workspace. |
A sampleEvent that is not one of the four event names returns the usual validation 400, with message as an array of strings.
Response
200 OK The result of the delivery. The status is 200 even when your receiver failed, so read delivered, statusCode and error.
eventIdstringrequiredThe delivery's event id (evt_<uuid>), the same value your receiver saw as webhook-id.
typestringrequiredWhat was sent: webhook.test or the sampleEvent you asked for.
deliveredbooleanrequiredtrue when the receiver answered 2xx.
statusCodeinteger | nulloptionalThe status your receiver answered, or null if it never answered.
latencyMsintegerrequiredHow long the attempt took, in milliseconds.
errorstring | nulloptionalWhy the attempt did not count as delivered. See the table of values.