---
title: "Notification sent event"
method: POST
path: "notification.sent"
tags: ["Webhook Events"]
---

# Notification sent event

`POST notification.sent` (webhook)

Built for agents. One event for every notification we would email the account owner: a scheduled post failed to publish (`type: post_failed`), a connected account was disconnected (`type: account_disconnected`), or a removed team member's recently used API key was handed to the owner (`type: api_key_handed_over`).

It carries the email's `subject` and `text`, references to the post or account, and the `actions` that resolve it, so an agent subscribes to one event and handles every notification the same way.

### Agents or state sync

Subscribe to `notification.sent` when an agent or automation reads the alert and acts on it. Subscribe to `post.platform.failed`, `post.failed`, `post.partial` and `account.disconnected` when your system keeps post and account state in sync: they carry the structured post or account and fire on every state change.

### When it fires

Once for each such notification, in near real time, regardless of the user's email toggles, and even when the owner has no email address or the email is held back by the sender's limits. It fires alongside `post.failed` and `account.disconnected`, which stay as they are.

The user's notification channel (Slack or Telegram) follows the email toggles, so it only receives the alerts whose toggle is on. The exception is `api_key_handed_over` (category `securityAlerts`), which has no toggle and is always delivered.

- `post_failed`: once the failure is final (a permanent error, or a temporary one on its last retry), once per publish attempt that failed, for scheduled posts only (not "post now"). `refs.platforms` lists every platform that failed in that attempt.
- `account_disconnected`: every time an account is disconnected, never for creator-profile accounts. `reason` says why.
- `api_key_handed_over`: once per API key, when a departing team member's key used in the last 7 days moves to the workspace owner. It stops working within 24 hours: create a new key and switch to it. `refs.apiKey` carries the key id, preview and expiry.

### Payload notes

`text` is the email body without the greeting. When your content retention is set to keep no content, the post text is replaced by `Content not retained` and each platform error by a generic description of its category.

### How to act

Each entry of `actions` is a public API call with the ids already in the path: `retry_post` (`retryPost`, `POST /v1/posts/{postId}/retry`), `reconnect_account` (`getConnectUrl`, `GET /v1/connect/{platform}`) and `check_account` (`getAccountHealth`, `GET /v1/accounts/{accountId}/health`).

### Who receives it

Endpoints subscribed to `notification.sent`. Scoped endpoints receive it for their profiles and accounts. Restricted keys need the `publishing` resource group.

## Payload

- WebhookPayloadNotificationSent
  - `id` string, required: Stable webhook event ID: the dedupe key, also sent as the X-Zernio-Event-Id header and identical on every retry and redelivery. It identifies the event only, never an account or other resource.
  - `profiles` object[]: The profiles this event belongs to, each with the externalId you set on it (null when none is set). Use it to route the event to your tenant without storing Zernio profile ids. Present on every event tied to a profile, absent on events that belong to none. Events spanning several profiles (a post published to accounts of different profiles) list each once.
    - `id` string, required
    - `externalId` string, nullable, required
  - `test` boolean: Always true when present: only a sample sent by POST /v1/webhooks/test with an event carries it. Real deliveries never do.
  - `event` 'notification.sent', required
  - `notification` object, required
    - `category` 'postFailures' | 'accountIssues' | 'securityAlerts', required: The email notification preference this notification belongs to. securityAlerts has no preference: it is always sent.
    - `type` 'post_failed' | 'account_disconnected' | 'api_key_handed_over', required
    - `subject` string, required: The email subject.
    - `text` string, required: The email body as plain text, without the greeting.
    - `url` string, uri, required: Dashboard link for the notification.
    - `refs` object, required
      - `post` object
        - `id` string, required: The post id, as in GET /v1/posts/{postId}.
      - `platforms` object[]: Every platform of the post that failed in this notification.
        - `platform` string, required
        - `accountId` string, required
      - `account` object
        - `id` string, required: The disconnected account id.
        - `platform` string, required
        - `username` string, required
        - `profileId` string, required
      - `apiKey` object
        - `id` string, required: The handed-over API key id.
        - `keyPreview` string, nullable, required: The key prefix and suffix, never the secret.
        - `expiresAt` string, date-time, nullable, required: When the handed-over key stops working.
    - `reason` string: Why the account was disconnected. Only on account_disconnected.
    - `actions` object[], required: API calls that act on the notification, with the ids already in the path.
      - `type` 'retry_post' | 'reconnect_account' | 'check_account', required
      - `operationId` 'retryPost' | 'getConnectUrl' | 'getAccountHealth', required: The operationId of the public API call.
      - `method` 'GET' | 'POST', required
      - `path` string, required: The request path.
  - `timestamp` string, date-time, required: UTC time at which Zernio generated this event. Retries and redeliveries keep the original value.

## Acknowledgement `200`

Webhook received successfully

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/980f5c976703?raw)
