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.

https://api.postfa.st/Auth: pf-api-keyRate limit: 600 requests per day, 60 per hour, 10 per minute

What 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)required

The endpoint's id, from POST /webhook-endpoints or GET /webhook-endpoints. A non-UUID returns 400.

Request body

sampleEventstringoptional

Send 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.disconnected

Values of error

errorWhat happened
nullThe receiver answered 2xx.
timeoutNo answer within 15 seconds.
connectionPostFast could not connect to the receiver.
tlsThe receiver's certificate or TLS setup was refused.
redirectThe receiver answered 3xx. Redirects are not followed.
http_4xxThe receiver answered 4xx, other than 410.
goneThe receiver answered 410, which also turns the endpoint off.
http_5xxThe receiver answered with any other status, typically 5xx.
blocked_addressThe hostname now resolves to an address that is not public.

Errors

StatusmessageWhen
400webhook.disabledTest route only: webhooks are switched off across PostFast for the moment.
404webhook.notFoundNo 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.

eventIdstringrequired

The delivery's event id (evt_<uuid>), the same value your receiver saw as webhook-id.

typestringrequired

What was sent: webhook.test or the sampleEvent you asked for.

deliveredbooleanrequired

true when the receiver answered 2xx.

statusCodeinteger | nulloptional

The status your receiver answered, or null if it never answered.

latencyMsintegerrequired

How long the attempt took, in milliseconds.

errorstring | nulloptional

Why the attempt did not count as delivered. See the table of values.