Webhooks

Hear about publishing outcomes and account health without polling.

Delivery is asynchronous, so a 202 from the publish endpoint tells you the post was accepted, not that it is live. Webhooks are how you find out what actually happened without polling: FoPost POSTs a signed JSON event to your endpoint when a post is scheduled or publishes, a delivery fails, an account connects or its credentials degrade, something new lands in the inbox, or an automation runs.

These endpoints need the webhooks scope, and work from the API, the SDKs, or the CLI.

Subscribe

POST /v1/webhooks
curl -X POST https://api.fopost.com/v1/webhooks \
  -H "X-API-Key: $FOPOST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "7d2b8c11-4e5a-4a8f-b0d9-3c5e6f7a8b90",
    "name": "Production",
    "url": "https://yourbrand.com/hooks/fopost",
    "events": ["post.published", "post.partially_failed", "delivery.failed"],
    "headers": { "Authorization": "Bearer your-own-token" }
  }'

workspaceId, url, and at least one event are required; the names are on the events page. Use an HTTPS URL your server exposes publicly; deliveries come from the open internet.

Optional fields:

FieldWhat it does
nameA label for the endpoint, up to 120 characters. Shown in the dashboard, never sent
secretYour own signing secret, 16 to 255 characters. Omit it and one is generated
headersUp to 10 custom headers sent with every delivery, such as an Authorization header your endpoint checks. Names use letters, digits and hyphens. The signing headers, Content-Type and Host cannot be set here. Values are write-only: responses carry headerNames, never the values

The response carries the webhook's signing secret. It is returned only on creation and on the update that rotates it, and is never shown by a GET. It is what you verify the signature with.

Manage

EndpointWhat it does
GET /v1/webhooksList your subscriptions, with lastTriggeredAt and failureCount. Spans every workspace you belong to
PUT /v1/webhooks/{id}Change the name, URL, events, headers, or active. headers replaces the set; give an existing header a null value to keep what is stored. Pass secret to rotate it: the new value comes back once in that response. Setting active: true also resets the failure count
POST /v1/webhooks/{id}/testSend a test event to this endpoint. See test deliveries for how it behaves
DELETE /v1/webhooks/{id}Delete it

Workspace viewers can list webhooks but not create, change, or delete them.

The shape of a delivery

Every event arrives as a POST with a three-key JSON body:

{
  "event": "delivery.published",
  "data": { "postId": "…", "accountId": "…", "platform": "linkedin", "externalUrl": "…" },
  "timestamp": "2026-09-01T09:00:12.000Z"
}

There is no id inside the body: the delivery id travels in the X-FoPost-Delivery header, which is also what you deduplicate on. The full per-event data shapes are on the events page.

In this section

Next

Related documentation
  • Events

    Every webhook event FoPost can send, when it fires, and its payload.

  • Verifying Signatures

    Prove a delivery came from FoPost before acting on it.

  • Retries and Failures

    Timeouts, retry backoff, auto-disable, and test deliveries.

  • API Overview

    Base URL, envelopes, pagination, and errors for the FoPost REST API.

  • SDKs Overview

    Every official FoPost client, what it covers, and how to pick one.

  • Automations and Webhooks

    Trigger automations and manage webhook subscriptions from the terminal.

Was this helpful?

On this page