Webhooks
Let your tools react when a post is due, published or failed.
A webhook sends a project's events to an address you choose, as they happen. An automation or an agent can then react: post a manual publication where Postdot cannot, warn a team when a delivery fails, or start a review flow when a post is created.
Webhooks are available from 0.1.0-alpha.10.
Webhook or custom HTTP channel?
Both send HTTP requests, for different jobs:
- A custom HTTP channel is a destination. Postdot sends the post itself to your system at its scheduled time and records the outcome. Use it when your system publishes on its own and answers at once.
- A webhook observes. Postdot tells your system that something happened, with identifiers and links only. Your system decides what to do and reports back through the API if needed. Use it when a person or an agent works through the queue.
Add a webhook
In Studio, open Project settings, then Webhooks and Add webhook. Enter the endpoint URL and choose the events. Manual posts due, published, failed and unconfirmed results are selected by default.
Postdot shows the signing secret once. Copy it into your tool: it is what proves a request came from your instance. New secret in the webhook's menu replaces it; the previous secret keeps working for 24 hours so you can switch without losing events.
Only project owners manage webhooks. API keys need the webhook:manage capability for the
project.
The endpoint must use HTTPS. Plain HTTP is accepted only for an address your administrator allowed as a private destination, for example an n8n instance on the same network. Addresses inside the instance's network are refused otherwise.
Events
| Event | Sent when |
|---|---|
post.created | A post and its first publications were created |
post.updated | The post text, title or media changed |
post.deleted | A post was moved to the trash |
post.restored | A post was restored from the trash |
publication.scheduled | A publication got a date, or its date changed |
publication.cancelled | A scheduled publication was cancelled |
publication.review_requested | A publication was submitted for approval |
publication.review_decided | An approval request was approved or rejected |
publication.due | A manual publication reached its time |
publication.published | A publication went out, or was recorded as published by hand |
publication.removed | A published publication was deleted on its platform |
publication.failed | An automatic delivery failed with no retry left |
publication.needs_review | Postdot could not confirm whether a delivery happened |
webhook.test | You sent a test event from Studio or the API |
Deleting a post sends publication.cancelled for each channel that was still
scheduled, then post.deleted. Deleting a post permanently, by hand or when its
time in the trash ends, sends nothing more. A published post stays on the
platform in every case. Deleting it on the platform is a separate action that
sends publication.removed once the platform confirms it, or when the post was
already gone.
What a request contains
POST /postdot HTTP/1.1
content-type: application/json
x-postdot-event: publication.due
x-postdot-delivery-id: 0f6c…
x-postdot-timestamp: 1763546400
x-postdot-signature: sha256=5d2a…
x-postdot-webhook-version: 1{
"id": "evt_…",
"type": "publication.due",
"createdAt": "2026-11-19T10:00:00Z",
"projectId": "…",
"data": {
"postId": "…",
"publicationId": "…",
"channelId": "…",
"state": "ready",
"scheduledAt": "2026-11-19T10:00:00Z",
"deliveryMode": "manual",
"externalUrl": null
},
"links": {
"studio": "https://postdot.example.com/dashboard/projects/…/publications/…",
"api": "/api/projects/…/publications/…"
}
}The body never contains the post text, titles or media. Read them through the API with your own key, which keeps private drafts out of third-party logs and applies your key's permissions.
Verify the signature
The signature is an HMAC SHA-256 of the timestamp, a dot and the raw body, keyed with the secret. Compare it in constant time and reject old timestamps.
import { createHmac, timingSafeEqual } from 'node:crypto'
export function verifyPostdot(rawBody: string, headers: Headers, secret: string): boolean {
const timestamp = headers.get('x-postdot-timestamp') ?? ''
const signature = headers.get('x-postdot-signature') ?? ''
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false
const expected =
'sha256=' + createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')
const a = Buffer.from(signature)
const b = Buffer.from(expected)
return a.length === b.length && timingSafeEqual(a, b)
}import hashlib, hmac, time
def verify_postdot(raw_body: bytes, headers, secret: str) -> bool:
timestamp = headers.get("x-postdot-timestamp", "")
signature = headers.get("x-postdot-signature", "")
if abs(time.time() - int(timestamp or 0)) > 300:
return False
digest = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256)
return hmac.compare_digest(signature, "sha256=" + digest.hexdigest())During the 24 hours after New secret, accept a signature made with either secret.
Delivery, retries and order
Answer with any 2xx status within 10 seconds. Postdot delivers each webhook's events one
at a time, in the order they happened, at least once: use the event id to ignore a
repeat.
When your endpoint fails, Postdot retries after about 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, then every 12 hours, and holds later events until that one passes. After 3 days of failure the webhook pauses itself. Project owners get a "Webhook paused" notification in Studio, by e-mail if they turned on e-mail alerts, naming the webhook's host and linking to the project's webhook settings. The "Paused webhooks" notification preference turns the Studio alert off. Resume continues from the event that failed: nothing is skipped.
Deliveries shows the last 100 attempts with their result. Send test event in the
webhook's menu sends a webhook.test event at once and shows the answer. From the API you
can also deliver a past event again. Test events and redeliveries are marked Manual in
Deliveries. They never start, extend or restart the automatic retry window, so
redelivering a failing event does not delay the pause.
Recipe: publish a manual post from a tool
- Subscribe to
publication.due. - When the event arrives, read the publication's content with the API
(
GET /api/projects/{projectId}/publications/{publicationId}/editor). - Post it on the platform.
- Record it, with the URL, right after posting:
POST /api/projects/{projectId}/publications/{publicationId}/publishwith{ "externalUrl": "…" }, orpostdot publications publish --external-url …, or the MCP toolpublish_manual_publication.
If two tools handle the same event, the second recording is refused because the publication is already published. Record as soon as the post is live to keep that window short.
API, MCP and CLI
The routes live under /api/projects/{projectId}/webhooks (list, show, create, update, pause,
resume, rotate secret, delete, deliveries, test, redeliver); see the API reference. MCP
offers list_webhooks, get_webhook, create_webhook, update_webhook, pause_webhook,
resume_webhook, rotate_webhook_secret, delete_webhook, list_webhook_deliveries,
test_webhook and redeliver_webhook_event; changes ask for confirmation. The CLI has the
same operations under postdot webhooks (list, show, create, update, pause,
resume, rotate-secret, delete, deliveries, test, redeliver).