Webhook
A webhook destination sends each new item to your own server as a signed JSON request for your own code to handle. It's an outgoing webhook: Publishedt calls your URL, not the other way around. With a body template and a header of your own, it can post to other services too. See Recipes.
Connect
- Go to Destinations, then Connect a destination, and choose Webhook.
- Enter the URL. It has to start with
https://and be reachable from the internet. - If you need them:
- Add up to 5 headers, such as an
Authorizationheader that your server checks. - Open Body template (optional) to send your own JSON instead of the standard body. See Body templates.
- Check Also send links to posts from other destinations to get a
syndicationevent each time another destination posts. See Events. - Check Send replies, likes, and reposts to get an event for each response collected in the workspace. See Response events.
- Add up to 5 headers, such as an
- Choose Connect webhook.
- Copy the Signing secret. It's only shown once, and your server uses it to check each request.
- Choose Send a test post to check that it works.
If it worked, your server gets a test event and Publishedt shows Test post sent. If your server responded with a url, View it opens it. Activity lists the post as Test post with the status Posted, and the destination shows as Working. If it didn't work, the message gives the reason, in the same words Activity uses.
You can change any of these later under Webhook settings on the destination's page. A saved header's value remains hidden, so leave it empty to keep it.
Next, route a feed to it, then shape each request with a body template. To send replies, likes, and reposts to your server too, see Responses.
Headers
Every request includes these headers:
| Header | What it contains |
|---|---|
Content-Type |
application/json |
User-Agent |
Publishedt/1.0 (+https://publishedt.app/bot) |
Publishedt-Event |
post, test, syndication, response.created, response.updated or response.deleted. |
Publishedt-Delivery |
The delivery id, the same as id in the body. |
Idempotency-Key |
The delivery id again. |
Publishedt-Signature |
t=<unix seconds>,v1=<hex HMAC-SHA256>. See Checking the signature. |
Up to 5 headers of your own follow, as you set them on the destination. You can't set a header that Publishedt sets itself, such as Content-Type or any Publishedt- header.
Events
post is a feed item, or a post from the API. An API post's feed is null, and its item only includes the link, tags, and images.
{
"id": "5b0e1c3a-7d2f-4e8b-9a6c-1f4d2e8b7a90",
"event": "post",
"created_at": "2026-11-26T17:00:00Z",
"text": "Version 2.4 is out\n\nhttps://example.com/blog/version-2-4",
"item": {
"title": "Version 2.4 is out",
"url": "https://example.com/blog/version-2-4",
"summary": "Search is faster, and filters stay put.",
"author": "Sam Rivera",
"tags": [
"release"
],
"published_at": "2026-11-26T16:58:00Z",
"images": [
{
"url": "https://example.com/images/search.png",
"alt": "The new search results page"
}
]
},
"feed": {
"id": "c7a1e2b3-4d5f-4a6b-8c9d-0e1f2a3b4c5d",
"title": "Example blog",
"url": "https://example.com/feed.xml"
}
}
test is what Send a test post sends, from the destination's page.
{
"id": "8e2d4c6b-1a3f-4b5d-9c7e-2f4a6b8d0c1e",
"event": "test",
"created_at": "2026-11-26T17:05:00Z",
"text": "This is a test post from Publishedt. If you can read it, posts from your feeds will arrive here.\n\nhttps://publishedt.app",
"item": {
"title": "",
"url": "https://publishedt.app",
"summary": "",
"author": "",
"tags": [],
"published_at": null,
"images": []
},
"feed": null
}
syndication means another destination posted and gave back the address of its post. It's sent when Also send links to posts from other destinations is on.
{
"id": "2a4c6e8f-0b1d-4e3f-8a5c-7e9f1b3d5a7c",
"event": "syndication",
"created_at": "2026-11-26T17:01:00Z",
"item_url": "https://example.com/blog/version-2-4",
"destination": {
"id": "3f6c2a9e-8b1d-4c7a-9e2f-5d8b1a6c4e07",
"kind": "mastodon",
"name": "Example on Mastodon"
},
"remote_url": "https://example.social/@example/113555000000000001",
"sent_at": "2026-11-26T17:00:42Z"
}
Response events
With Send replies, likes, and reposts checked, a webhook gets the responses collected on any Mastodon or Bluesky destination in the workspace, and the Webmentions that its sites receive:
response.createdis a new reply, like, or repost. Itsresponseis the same JSON that the API lists.response.updatedis a reply whose text or content warning was edited. It has the same shape, with the new text. A reply behind a warning includes it assummary, along withsensitive, so collapse the reply behind it.response.deletedis a response that was removed. Itsresponseonly includes what identifies it: itsid,wm-id,platform,url,wm-property, andwm-target, pluswm-sourcefor a Webmention, withdeletedset totrue. It has no author and no text. Every response, deleted or not, includes itswm-id.
{
"id": "c1d3e5f7-9a2b-4c4d-8e6f-1a3b5c7d9e0f",
"event": "response.created",
"created_at": "2026-11-26T17:15:00Z",
"response": {
"author": {
"name": "Alex Chen",
"photo": "https://example.social/avatars/alex.png",
"type": "card",
"url": "https://example.social/@alex"
},
"content": {
"html": "<p><span><a href=\"https://example.social/@example\" rel=\"nofollow ugc\">@<span>example</span></a></span> Search feels instant now. Nice work!</p>",
"text": "@example Search feels instant now. Nice work!"
},
"id": "7c9e1a3b-5d2f-4e8a-9b6c-0d1e2f3a4b5c",
"in-reply-to": "https://example.com/blog/version-2-4",
"platform": "mastodon",
"published": "2026-11-26T17:12:30Z",
"type": "entry",
"url": "https://example.social/@alex/113555000000000042",
"wm-property": "in-reply-to",
"wm-received": "2026-11-26T17:15:00Z",
"wm-target": "https://example.com/blog/version-2-4"
}
}
{
"id": "f2a4c6e8-0b1d-4f3a-9c5e-7b9d1f3a5c7e",
"event": "response.deleted",
"created_at": "2026-11-27T09:30:00Z",
"response": {
"deleted": true,
"id": "7c9e1a3b-5d2f-4e8a-9b6c-0d1e2f3a4b5c",
"platform": "mastodon",
"type": "entry",
"url": "https://example.social/@alex/113555000000000042",
"wm-property": "in-reply-to",
"wm-target": "https://example.com/blog/version-2-4"
}
}
- They're signed and retried like every other request. Dedupe on
id, as you do for posts.response.idis the response's own ID. - Posts and
syndicationevents go first, and response events wait behind them. A webhook gets one request at a time, at least 15 seconds apart. After a burst of responses, the last ones can take a while to arrive. - A
response.createdorresponse.updatedevent still waiting after 3 days is skipped. Aresponse.deletedevent is never skipped, so your site gets every removal. - If a response is removed before its
response.createdevent is sent, that event is dropped. Your site only getsresponse.deleted, for a response it never saw. - Unchecking Send replies, likes, and reposts stops new events, but events that are already waiting are still sent.
- Activity only lists a response event when it failed or might not have been sent.
Responding
- Respond with any 2xx status.
- To have Activity and syndication links point to your post, respond with JSON that includes an http(s)
url.
Retries
- Dedupe on
id, because a retry repeats it with the same body. - A timeout, a network error, a 408, a 425, or a 5xx gets retried, with a longer wait each time, before the post fails.
- A 429, or a 503 with
Retry-After, waits as long as your server requests, then retries. - A 401, 403, 404, or 410 sets the destination to Needs attention, and its posts are queued until you fix it. See When your server stops accepting posts.
- Any other response fails the post without a retry. Publishedt doesn't follow redirects.
Body templates
A body template replaces the standard body of post and test events. syndication and response events always send the body above, and the headers are the same either way.
A body template is a JSON document, and each string value in it is a template:
{
"text": "{{ title }} {{ url }}",
"source": "publishedt",
"notify": true
}
- Each string value renders, then is sent as an escaped JSON string, so the body is always valid JSON.
- Keys, numbers,
true,false, andnullare sent unchanged. - A value is always a string. A list such as
tagscan't be sent as a JSON array, so{{ tags }}renders as one string, with the tags joined by commas. - If the template has a mistake, you'll see its line and column when you save.
Checking the signature
Publishedt-Signature looks like t=1795712400,v1=ab9c71dab221fc506f5215f64ce536d0498cf2687a8cb06b4f18d3e9fc380dd9. To check it:
- Split
Publishedt-Signatureon commas intotandv1. - Compute HMAC-SHA256 of
<t>.<body>with the destination's signing secret, over the raw body bytes as they arrived. - Compare its hex to v1 in constant time.
- Reject a t more than 5 minutes from now, either way.
Rotating the signing secret takes effect immediately, so the old secret stops verifying. Choose Rotate signing secret on the destination's page, then update your server.
Go
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"errors"
"strconv"
"strings"
"time"
)
// Verify checks a request's Publishedt-Signature header against its raw body. Pass the
// body exactly as it arrived: re-encoded JSON won't match.
func Verify(secret, header string, body []byte, now time.Time) error {
var ts, sig string
for _, part := range strings.Split(header, ",") {
key, value, _ := strings.Cut(part, "=")
switch key {
case "t":
ts = value
case "v1":
sig = value
}
}
t, err := strconv.ParseInt(ts, 10, 64)
if err != nil || sig == "" {
return errors.New("malformed signature header")
}
if age := now.Sub(time.Unix(t, 0)); age > 5*time.Minute || age < -5*time.Minute {
return errors.New("signature timestamp is too old or too new")
}
got, err := hex.DecodeString(sig)
if err != nil {
return errors.New("malformed signature")
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(ts + "."))
mac.Write(body)
if !hmac.Equal(got, mac.Sum(nil)) {
return errors.New("signature doesn't match")
}
return nil
}
JavaScript
For Node:
import { createHmac, timingSafeEqual } from 'node:crypto';
// Checks a request's Publishedt-Signature header against its raw body, a Buffer or string.
// Pass the body exactly as it arrived: re-encoded JSON won't match.
export function verifyWebhook(secret, header, rawBody, now = Date.now()) {
const parts = {};
for (const part of String(header ?? '').split(',')) {
const at = part.indexOf('=');
if (at > 0) parts[part.slice(0, at)] = part.slice(at + 1);
}
if (!/^[0-9]+$/.test(parts.t ?? '') || !/^[0-9a-f]{64}$/i.test(parts.v1 ?? '')) {
throw new Error('malformed signature header');
}
if (Math.abs(now / 1000 - Number(parts.t)) > 5 * 60) {
throw new Error('signature timestamp is too old or too new');
}
const expected = createHmac('sha256', secret).update(parts.t + '.').update(rawBody).digest();
if (!timingSafeEqual(Buffer.from(parts.v1, 'hex'), expected)) {
throw new Error("signature doesn't match");
}
}
Test your check
With the signing secret whsec_q8Xm2Lr5Vt9Nb3Kp7Wd1Hc6Jf4Gs0Ya2Ze8Ux5Ri3Mo, the post body above, sent as one line, has this signature:
Publishedt-Signature: t=1795712400,v1=ab9c71dab221fc506f5215f64ce536d0498cf2687a8cb06b4f18d3e9fc380dd9
{"id":"5b0e1c3a-7d2f-4e8b-9a6c-1f4d2e8b7a90","event":"post","created_at":"2026-11-26T17:00:00Z","text":"Version 2.4 is out\n\nhttps://example.com/blog/version-2-4","item":{"title":"Version 2.4 is out","url":"https://example.com/blog/version-2-4","summary":"Search is faster, and filters stay put.","author":"Sam Rivera","tags":["release"],"published_at":"2026-11-26T16:58:00Z","images":[{"url":"https://example.com/images/search.png","alt":"The new search results page"}]},"feed":{"id":"c7a1e2b3-4d5f-4a6b-8c9d-0e1f2a3b4c5d","title":"Example blog","url":"https://example.com/feed.xml"}}
Recipes
A webhook can post to any service whose API takes one JSON request per post. Check a recipe against the service's own API docs before you rely on it.
linkding
Save each item as a bookmark in your own linkding.
- URL:
https://<host>/api/bookmarks/, with your linkding's address as the host. - Header:
Authorization: Token <token>. EnterAuthorizationas the header's name andToken <token>as its value, using the token from linkding's settings page. - Body template:
{"url": "{{ url }}", "title": "{{ title }}", "description": "{{ summary }}"}
linkding stores one bookmark per URL. Sending a URL it already has updates that bookmark, which means a retry never saves it twice.
linkding's response includes the bookmark's own URL, so Activity's Posted link and syndication links point at the original article.
Tags can't be passed yet, because linkding takes tags as a list and a body template's values are always strings.
Your linkding has to be reachable from the internet over https, because Publishedt never connects to a private network.
Slack
Post each item to a channel through an incoming webhook.
- URL:
https://hooks.slack.com/services/..., the webhook URL from your Slack app. Keep it secret. - Header: none.
- Body template:
{"text": "{{ title }} {{ url }}"}
Telegram
Telegram is a destination of its own: see Telegram.
What the Slack recipe can't do
- It doesn't fit a post to a length. A long title is sent in full.
- It sends no images.
- It can't tell that the webhook is broken.
- Slack doesn't dedupe on
id. A resend may post twice. - Activity shows no Posted link, because Slack's response has no
url.
When your server stops accepting posts
If the destination shows Needs attention, its posts are queued until you fix it. What to fix depends on the message it shows:
- "Your webhook's address doesn't exist anymore." Your server responded with 404 or 410. Fix the URL under Webhook settings on the destination's page.
- "Your webhook's server rejected Publishedt. Check its headers." Your server responded with 401 or 403. Check the headers under Webhook settings, such as an
Authorizationheader that has changed.
What each failure means
| Activity shows | What it means |
|---|---|
| Your webhook's address doesn't exist anymore. | Your server responded with 404 or 410. Posts wait. Fix the URL in Webhook settings. |
| Your webhook's server rejected Publishedt. Check its headers. | Your server responded with 401 or 403. Posts wait. Check the headers in Webhook settings. |
| That address isn't a public website. | The address now leads to a private network, which Publishedt never connects to. The post fails without a retry. |
| Your webhook rejected the post. | The destination rejected this post and gave a reason. It isn't retried. Fix what it names, then choose Try again in Activity. |
| Your webhook had an error. | The destination kept responding with an error. Publishedt retried, waiting longer each time, then stopped. Choose Try again in Activity. |
| Your webhook took too long to respond. | Each try timed out before the post was sent. Nothing posted. Choose Try again in Activity. |
| Publishedt couldn't reach your webhook. | Publishedt couldn't connect on any try. Nothing posted. Choose Try again in Activity. |
| Publishedt couldn't confirm whether this posted. Check your webhook before posting it again. | The post was sent, but no response came, so Publishedt can't tell whether it was posted. Check the destination. If the post isn't there, post it again from Activity. |
For failures any destination can run into, see Getting started.
Something wrong on this page? Contact support@publishedt.app.