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

# Webhooks Overview

> Learn how real-time event notifications work in Posttu.

# Webhooks Overview

Posttu webhooks deliver real-time notifications to your system whenever events occur in your Posttu account or across connected platforms (including Fansly and OnlyFans).

Instead of polling our API for updates, webhooks allow your application to automatically react when posts are published, comments are created, accounts are connected, or new subscriber actions take place.

***

## Event Payload Structure

All Posttu webhooks use a standardized **JSON Envelope** format. Regardless of the event type, every payload includes top-level metadata alongside the event-specific `payload`.

### Standard Envelope Schema

```json theme={null}
{
  "type": "post.publish.success",
  "organizationId": "org_123456789",
  "channelId": "chan_987654321",
  "platform": "INSTAGRAM",
  "timestamp": "2026-07-29T18:00:00.000Z",
  "payload": {
    "postId": "post_555111",
    "url": "https://instagram.com/p/Example"
  }
}
```

### Top-Level Envelope Fields

| Field | Type | Description |
| :- | :- | :- |
| `type` | `string` | The unique event identifier (e.g., `channel.connected`, `fansly.posts.created`, `onlyfans.transactions.new`). |
| `organizationId` | `string` | The ID of the Posttu organization that owns the event. |
| `channelId` | `string` (optional) | The ID of the associated social channel, if applicable. |
| `platform` | `string` (optional) | The platform associated with the event (e.g., `INSTAGRAM`, `FANSLY`, `ONLYFANS`). |
| `timestamp` | `string` | ISO-8601 timestamp representing when the event occurred. |
| `payload` | `object` | The event-specific data payload. |

***

## Delivery & Response Requirements

When receiving webhooks from Posttu:

* **Respond Quickly**: Send a `200 OK` HTTP status response immediately after receiving the payload.
* **Async Processing**: Process long-running background tasks (e.g., image downloading, data sync) asynchronously outside of the HTTP request lifecycle.
* **Idempotency**: Always process webhooks idempotently using event unique IDs or timestamps, as webhooks may occasionally be retried.

***

## Delivery Retries

If your server fails to respond with a 2xx status code or times out, Posttu automatically retries webhook delivery with exponential backoff for up to 24 hours.


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