Webhooks
Postory sends a signed POST to your https:// endpoint when something happens. Add one in Postory → Settings → Webhooks, or with the API (POST /api/v1/webhooks). The signing secret (whsec_…) is shown once.
Create, test and remove endpoints from code: the Webhook endpoints reference.
Request
POST /your-endpoint
content-type: application/json
webhook-id: 6f1c0e0a-… (the event id; the same on every retry)
webhook-timestamp: 1763150400
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{"id": "6f1c0e0a-…", "type": "post.published", "timestamp": "2026-11-14T20:00:00Z", "data": {…}}
Verify a request
Verify every request before you trust it (Standard Webhooks): HMAC-SHA256 of “webhook-id.webhook-timestamp.raw body”, keyed by the base64 part of your secret, compared with each v1 signature; refuse a timestamp more than 5 minutes off.
import crypto from "node:crypto";
// secret: "whsec_…" from Postory; body: the raw request body (a string, unparsed).
export function verify(secret, headers, body) {
const id = headers["webhook-id"];
const ts = headers["webhook-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // more than 5 minutes off
const key = Buffer.from(secret.slice("whsec_".length), "base64");
const expected = crypto.createHmac("sha256", key).update(`${id}.${ts}.${body}`).digest("base64");
return headers["webhook-signature"].split(" ").some((part) => {
const [version, signature] = part.split(",");
return version === "v1" && signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
});
}
# pip install standardwebhooks
from standardwebhooks import Webhook
payload = Webhook("whsec_…").verify(raw_body, headers) # raises on a bad signature or an old timestamp
Answer and retries
Answer 2xx within 5 seconds. Anything else is retried 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h after the event, with the same webhook-id, so drop an id you have already handled. 410 Gone turns the webhook off. Events about replies and imports need a key with Read your account data.
Events
import.completed
data.account? | WebhookAccount |
data.account.connection_id | string |
data.account.handle? | string |
data.account.platform | string |
data.error_code? | string |
data.kind | string |
data.mode? | string |
data.new_posts | integer |
data.new_received_replies | integer |
data.new_replies | integer |
data.run_id | string |
data.status | string |
post.failed
data.account | WebhookAccount |
data.account.connection_id | string |
data.account.handle? | string |
data.account.platform | string |
data.delivery | WebhookDeliveryRef |
data.delivery.id | string |
data.delivery.kind | "scheduled" | "now" |
data.failure_code? | string |
data.post_id | string |
data.published_parts | integer |
post.published
data.account | WebhookAccount |
data.account.connection_id | string |
data.account.handle? | string |
data.account.platform | string |
data.delivery | WebhookDeliveryRef |
data.delivery.id | string |
data.delivery.kind | "scheduled" | "now" |
data.permalink? | string |
data.post_id | string |
data.published_parts | integer |
post.scheduled
data.account | WebhookAccount |
data.account.connection_id | string |
data.account.handle? | string |
data.account.platform | string |
data.created_via? | string |
data.delivery | WebhookDeliveryRef |
data.delivery.id | string |
data.delivery.kind | "scheduled" | "now" |
data.mode | string |
data.post_id | string |
data.scheduled_at | string |
reply.received
data.account | WebhookAccount |
data.account.connection_id | string |
data.account.handle? | string |
data.account.platform | string |
data.author | ReplyAuthor |
data.author.display_name? | string |
data.author.username? | string |
data.parent_post_id | string |
data.permalink? | string |
data.posted_at? | string |
data.reply_id | string |
data.text? | string |
webhook.test
data.endpoint_id | string |
data.message | string |