Docs menuWebhooks

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

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.

Node.js
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));
  });
}
Python
# 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_idstring
data.account.handle?string
data.account.platformstring
data.error_code?string
data.kindstring
data.mode?string
data.new_postsinteger
data.new_received_repliesinteger
data.new_repliesinteger
data.run_idstring
data.statusstring

post.failed

data.accountWebhookAccount
data.account.connection_idstring
data.account.handle?string
data.account.platformstring
data.deliveryWebhookDeliveryRef
data.delivery.idstring
data.delivery.kind"scheduled" | "now"
data.failure_code?string
data.post_idstring
data.published_partsinteger

post.published

data.accountWebhookAccount
data.account.connection_idstring
data.account.handle?string
data.account.platformstring
data.deliveryWebhookDeliveryRef
data.delivery.idstring
data.delivery.kind"scheduled" | "now"
data.permalink?string
data.post_idstring
data.published_partsinteger

post.scheduled

data.accountWebhookAccount
data.account.connection_idstring
data.account.handle?string
data.account.platformstring
data.created_via?string
data.deliveryWebhookDeliveryRef
data.delivery.idstring
data.delivery.kind"scheduled" | "now"
data.modestring
data.post_idstring
data.scheduled_atstring

reply.received

data.accountWebhookAccount
data.account.connection_idstring
data.account.handle?string
data.account.platformstring
data.authorReplyAuthor
data.author.display_name?string
data.author.username?string
data.parent_post_idstring
data.permalink?string
data.posted_at?string
data.reply_idstring
data.text?string

webhook.test

data.endpoint_idstring
data.messagestring