> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Get PostSyncer events as signed JSON requests at your own address

A webhook endpoint is an https address on your side. When something happens in PostSyncer, such as a post failing or an account needing a reconnect, PostSyncer sends a signed JSON request to every endpoint that listens for that event.

You can manage endpoints in the app under **Settings → Notifications → Webhooks** (`/settings/notifications/webhooks`), or with the API and MCP tools on these pages.

## Permissions

API keys use the `webhooks` permission group.

| Permission | Allows |
| - | - |
| `webhooks:read` | List and get endpoints, list their deliveries |
| `webhooks:create` | Create endpoints |
| `webhooks:update` | Edit endpoints and send test events |
| `webhooks:delete` | Delete endpoints |

The key's person also needs a role in the endpoint's workspace:

* Reading works for every role: owner, manager, content manager, content creator and client.
* Creating, editing, deleting and testing an endpoint need the owner or a manager. Any other role gets `403`.
* An endpoint with `workspace_ids` sends events from other workspaces too. To name a workspace there, you need to be its owner or a manager. Only the workspace's owner can set `["*"]`, every workspace they own. An endpoint that reaches a workspace you can't manage can't be edited, deleted or tested by you: ask the person who set it up.

## Rules

* The address must use `https` and be public. Private, loopback and reserved addresses are refused, and PostSyncer checks again each time it sends.
* A workspace can have 20 endpoints.
* An endpoint gets only the events in its `events` list. [Webhook events](/docs/webhooks/events.md) lists them all, with what each one carries.
* By default an endpoint gets events of its own workspace. Add `account_ids` to limit it to some social accounts, or `workspace_ids` to also get events of other workspaces you manage. [Which events an endpoint gets](/docs/webhooks/events.md#which-events-an-endpoint-gets) has the details.

## What PostSyncer sends

Each event is a `POST` with this JSON body:

```json theme={null}
{
  "type": "post.failed",
  "id": "01q9aa9wn8k5r6t1n0xwdq7h3m",
  "timestamp": "2030-03-15T09:00:41+00:00",
  "workspace_id": 12,
  "data": { }
}
```

Every request carries `webhook-id`, `webhook-timestamp` and `webhook-signature` headers. Check them before you trust the body: see [Verify webhook signatures](/docs/guides/verify-webhooks.md).

`id` is the event's id and is also the `webhook-id` header. It stays the same on every retry and on every **Send again**, so use it to ignore an event you already handled. `timestamp` is when the event happened.

`data` is built once, the first time the event is sent, and every retry and every **Send again** sends that same `data`. A retry hours later still tells you what happened then, not what the post looks like now. Fetch the post with [Get a post](/docs/api-reference/posts/get.md) when you need its current state.

Events can arrive out of order. A post-level event such as `post.published` or `post.partially_published` can arrive before the last `post.account_published` or `post.account_failed` of the same post.

## Post events

`post.published`, `post.partially_published`, `post.failed`, `post.account_published`, `post.account_failed`, `post.scheduled` and `post.needs_media` send the post: the same fields as [Get a post](/docs/api-reference/posts/get.md), with each account's result and what to do about a failure. `post.deleted` sends only `id`, `workspace_id` and `deleted_at`. [Post data](/docs/webhooks/events.md#post-data) lists those fields and the fix codes, and each event has its full example on [Webhook events](/docs/webhooks/events.md).

## Other events

Approvals (`approval.requested`, `approval.approved`, `approval.rejected`), accounts (`account.needs_reconnect`, `account.expires_soon`, `account.paused`, `account.connected`, `account.disconnected`, `account.posts_to_put_back`), comments and reviews (`comment.mentioned`, `comment.received`, `share.comment_received`, `review.received`), AI media (`media.generated`, `media.generation_failed`), the brand brain (`brand.learned`), the team (`team.member_joined`), removals by an agent (`posts.bulk_removed`) and the test event (`webhook.test`). [Webhook events](/docs/webhooks/events.md#events-at-a-glance) says when each one is sent and shows its `data`.

## Delivery and retries

Answer with any `2xx` status within 10 seconds. Redirects aren't followed: a `3xx` answer fails, so use the address it redirects to.

A `408`, `429` or `5xx` answer, no answer within 10 seconds, or a connection error is tried again after 1 minute, 10 minutes, 1 hour, 4 hours, 12 hours and 24 hours. That's 7 attempts in all, the first and 6 retries, over about 41 hours. Any other answer fails at once and is not tried again.

Each delivery keeps its number of attempts and the last attempt's request, answer and error: see [List webhook deliveries](/docs/api-reference/webhooks/deliveries.md). In the app, **Send again** sends a failed delivery once more, as a new delivery of the same event, while the endpoint is on.

An endpoint that has been failing for 3 days, with no delivery going through in that time, is turned off. PostSyncer tells the person who set the endpoint up, while they're still in the workspace, and the workspace owner after that person leaves. Turn it on again with [Update a webhook](/docs/api-reference/webhooks/update.md) (`"active": true`).

## Endpoints

* [List webhooks](/docs/api-reference/webhooks/list.md)
* [Create a webhook](/docs/api-reference/webhooks/create.md)
* [Get a webhook](/docs/api-reference/webhooks/get.md)
* [Update a webhook](/docs/api-reference/webhooks/update.md)
* [Delete a webhook](/docs/api-reference/webhooks/delete.md)
* [Send a test event](/docs/api-reference/webhooks/test.md)
* [List webhook deliveries](/docs/api-reference/webhooks/deliveries.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.