---
name: transactional-push
description: Integrate server-triggered push notifications and events with notification.dev. Use for direct user targeting, events that trigger journeys, transactional server API-key provisioning, retries, and delivery reporting.
---

# Transactional push and server events

Read `notification-platform` and select the user's project before workspace work.
One request targets one project. Each app uses its own project and server key.

## Authentication and server keys

MCP tools authenticate through the existing OAuth connection. They do not require
an API key. Your app backend calls HTTP APIs with `Authorization: Bearer <key>`.
Mobile SDK installation credentials cannot call these server endpoints.

| MCP tool                       | Arguments                                                                                                             | Required permission                                                      |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `create_transactional_api_key` | `projectId`, `name`, `permissions`, optional `expiresAt`                                                              | `transactional-keys:manage` plus every requested permission; owner/admin |
| `list_transactional_api_keys`  | `projectId`, optional `cursor`, `limit`                                                                               | `transactional-keys:manage`; owner/admin                                 |
| `revoke_transactional_api_key` | `projectId`, `apiKeyId`                                                                                               | `transactional-keys:manage`; owner/admin                                 |
| `send_message`                 | `projectId`, `idempotencyKey`, `audience`, `message`                                                                  | `messages:send`                                                          |
| `ingest_event`                 | `projectId`, `eventId`, `name`, `occurredAt`, exactly one of `subscriberId` / `externalUserId`, optional `properties` | `events:write`                                                           |
| `get_operation`                | `projectId`, `operationId`                                                                                            | `project:read` plus `messages:send` for direct sends                     |

Create a server key when the user requests backend integration or key provisioning:

```json
{
  "projectId": "<project UUID>",
  "name": "Example Project backend",
  "permissions": [
    "events:write",
    "messages:send",
    "project:read",
    "reports:read"
  ]
}
```

Only those four permissions are allowed. Request just the permissions the backend
needs; all must also be approved on the current connection. `project:read` allows
operation polling; `reports:read` allows delivery reporting. The management scope
is OAuth-only and cannot be issued on a key.

The creation result contains `secret` **once**. Store it in the app backend's
secret configuration. Never put it in mobile code, source control, or public
documentation. Listing returns metadata only; existing secrets cannot be retrieved.
Creation is not idempotent: after a lost response, inspect key metadata and revoke
an unused key before creating a replacement rather than retrying blindly.

Keys remain valid after the originating OAuth connection is disconnected, until
their expiry or explicit revocation. Revocation stops backend callers using that
key. These tools list and revoke only keys entirely within the transactional
permission allowlist. Use separate keys for dev and production projects.

## Identify the recipient

Use the same `externalUserId` that the app supplies during SDK login, or the
notification.dev subscriber UUID. Users must already exist in the project; neither
endpoint automatically creates them. SDK login currently trusts the external ID
supplied by the app; it does not verify account ownership. Account for that limit
when selecting notification content.

## Send a direct push

For photos, offer images or chat avatars, read `push-images`
(`skill://push-images/SKILL.md`) for the message fields, image limits and native
SDK prerequisites. `send_message` accepts those fields in its `message` object.

`send_message` takes:

```json
{
  "projectId": "<project UUID>",
  "idempotencyKey": "order:123:shipped:push",
  "audience": {
    "type": "external_users",
    "externalUserIds": ["example-user-123"]
  },
  "message": {
    "title": "Your order has shipped",
    "body": "Order 123 is on its way.",
    "deepLink": "/orders/123",
    "data": { "orderId": "123" }
  }
}
```

For HTTP, send the same `audience` and `message` body to
`POST <API origin>/v1/projects/{projectId}/messages`, with headers:

```http
Authorization: Bearer <server API key>
Idempotency-Key: order:123:shipped:push
Content-Type: application/json
```

- Alternative audience: `{ "type": "subscribers", "subscriberIds": ["<UUID>"] }`.
- Supply 1–1,000 unique IDs in one mode. `all` and `segment` use campaigns instead.
- The same message goes to every eligible installation for those users. Use
  separate requests when users need different text or data.
- The backend supplies finished text. Custom JSON data is supported. Choose a
  `deepLink` or `placement: { versionId, parameters }` (from `list_placements`), not both. Destination
  strings are interpreted by the host app; placement parameters are resolved once.
- Title/body must not be blank. Message content must fit within 3,000 UTF-8 bytes
  including custom data; the provider also checks its final payload.
- Unknown, archived, or foreign-project users reject the whole request with
  `400 INVALID_AUDIENCE`. No partial send is created.
- Existing users without eligible devices are accepted and counted as unreachable.
  Zero eligible devices is a valid completed preparation.

Both paths return `{ operationId, statusUrl }`; HTTP returns `202`. Preparation is
atomic and completes before acceptance. Poll with `get_operation`, or GET the
HTTP `statusUrl`. A direct send result includes `directSendId`, `recipientCount`,
`queuedDeliveryCount`, and `unreachableRecipientCount`, with `campaignId: null`.
Completion means durably queued, not received by a device.

## Submit an event for journeys

`ingest_event` takes:

```json
{
  "projectId": "<project UUID>",
  "externalUserId": "example-user-123",
  "eventId": "order:123:shipped",
  "name": "order_shipped",
  "occurredAt": "2026-10-30T12:00:00Z",
  "properties": { "orderId": "123" }
}
```

For HTTP, omit `projectId` from the body and POST it to
`<API origin>/v1/projects/{projectId}/events` with bearer authentication and JSON
content type. No `Idempotency-Key` header is needed; `eventId` deduplicates events.
Supply exactly one of `subscriberId` or `externalUserId`. Unknown or archived users
return `404 NOT_FOUND`. Success returns `{ eventId, accepted: true }` with HTTP `200`.

The event can start a published journey with a matching `event_trigger` or wake a
matching `wait_for_event`. Read `journeys` when building the flow. Event properties
are stored but are not inserted into journey message text or destinations. Use a
direct send when the backend needs to personalize content. Do not emit reserved
automatic lifecycle event names.

Events can cause real sends. Establish the intended event and active-journey
effects before submitting production events. Emitting an event and directly
sending for the same action can produce two notifications.

## Retries and delivery reporting

- Use a stable business-event ID for `eventId` and a stable action-specific
  `Idempotency-Key` for direct sends. Keys are project-scoped; send keys and event
  IDs use separate namespaces. Keep IDs within 1–255 characters.
- Retry the same input with the same ID after timeouts or transient failures.
  Conflicting reuse returns `409 IDEMPOTENCY_CONFLICT` or `409 EVENT_ID_CONFLICT`.
  Correct validation/authentication failures rather than retrying them in a loop.
- Direct-send retries replay the original operation, even if recipients or
  placements have since changed. Recipient order and JSON object-key order do not
  change the direct-send fingerprint. Receipts use the existing 35-day horizon;
  do not assume indefinite deduplication.
- GET `/v1/projects/{projectId}/deliveries?directSendId={directSendId}` with
  `reports:read`; paginate using `nextCursor`. Delivery detail and `/attempts`
  expose outcomes. `openedAt` records SDK-reported opens when present.
- Work shares existing provider budgets and queue scheduling, retries transient
  errors, and expires after 24 hours. Opt-outs, revoked installations, archived
  users, and identity changes can suppress pending deliveries.
- `provider_accepted` proves provider acceptance, not device receipt. Ambiguous
  provider network outcomes mean exactly-once device delivery is not guaranteed.
- When a business transaction must survive a backend crash before submission,
  use an outbox in the calling application and retry with stable IDs.
