Reference

Webhooks

When a batch job finishes or fails, posty.ro POSTs a JSON notification to the job's options.callback_url or, if it has none, to your organisation's default webhook URL. Webhooks are included on the Growth, Scale and Enterprise plans. Verify the X-Posty-Signature header before trusting the payload.

batch.completed

The batch job finished. Download the results from results_url (kept for 30 days).

{
  "event": "batch.completed",
  "batch_id": "bat_550e8400e29b4123",
  "status": "done",
  "row_count": 1200,
  "processed": 1200,
  "results_url": "https://api.posty.ro/v1/addresses/batch/bat_550e8400e29b4123/results",
  "finished_at": "2026-10-14T12:00:00Z"
}
batch.failed

The batch job failed. error_message describes the cause.

{
  "event": "batch.failed",
  "batch_id": "bat_550e8400e29b4123",
  "status": "failed",
  "row_count": 1200,
  "processed": 310,
  "results_url": "https://api.posty.ro/v1/addresses/batch/bat_550e8400e29b4123/results",
  "finished_at": "2026-10-14T12:00:00Z",
  "error_message": "..."
}

Endpoint URL and signing secret

In the dashboard, open Settings → Webhooks (owners and admins). There you set the default endpoint URL and reveal or copy your organisation's signing secret (whsec_…). Every organisation has its own secret. Rotating it takes effect immediately, including for deliveries still being retried, so update your receiver right after. The URL must be HTTPS with a public host.

Delivery and retries

Notifications are sent as POST with Content-Type: application/json. Your endpoint must answer with a 2xx within 10 seconds; redirects are not followed. A failed delivery is retried, up to 5 attempts in total, roughly 1, 4, 9 and 16 minutes apart; every attempt carries a fresh timestamp and signature. The same notification can arrive twice, so deduplicate on batch_id and event.

Plans

On Free and Starter, a callback_url is accepted but ignored: the submit response contains "webhook": "not_available_on_plan". On Growth, Scale and Enterprise it contains "queued", or "none" when there is no URL at all. If you move to a plan without webhooks, deliveries stop.

Verifying the signature

Every notification carries the X-Posty-Signature header: t=<unix>,v1=<hex>. v1 is the HMAC-SHA256 of "<t>." followed by the raw request body, keyed with your organisation's secret (the whole string, including whsec_). Recompute it, compare in constant time and reject stale timestamps (e.g. older than 5 minutes) to block replays.

import { createHmac, timingSafeEqual } from 'node:crypto'

// header = req.headers['x-posty-signature'], rawBody = the exact bytes received
function verifyPostySignature(header, rawBody, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(',').map(p => p.split('=')))
  const t = Number(parts.t)
  if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false
  const expected = createHmac('sha256', secret).update(`${parts.t}.`).update(rawBody).digest('hex')
  const got = Buffer.from(parts.v1 ?? '', 'hex')
  return got.length === 32 && timingSafeEqual(got, Buffer.from(expected, 'hex'))
}

© 2026 posty.ro. Posty is operated by Gurulabs SRL, Str. Emile Zola nr. 1, et. III, ap. 6, 400112 Cluj-Napoca, Cluj county, Romania. Trade Register no. J2017005457128, tax ID RO38156938, EUID ROONRC.J2017005457128. Contact: support@posty.ro. Terms of Service · Privacy Policy · Cookies