# Pushes your app sends

> Keep transactional pushes in your own backend and report each one with the $external_push event, so the per-app push limit counts every push a person gets.

Most apps already send transactional messages (receipts, sign-in codes, password resets, order and account updates) from their own backend. Keep doing that, and report each push to Herald with the $external_push event so it can count every push a person gets. If you'd rather Herald send them, use the Send API: those messages go out right away and skip the send-time checks. Use agents and campaigns for marketing and lifecycle messages.

## What to keep in your backend

- Sign-in codes, password resets and other security messages.
- Chat messages and other pushes that must arrive the moment something happens.
- Silent and data-only pushes your app uses to refresh itself.
- Pushes with sensitive content you'd rather not send through another service.

## What can move to Herald

Marketing and lifecycle pushes: onboarding, re-engagement, feature announcements, reminders and offers. Agents pick the message and time for each person, and campaigns send to an audience at a set time.

## Report each push

Send `$external_push` from your backend right after it sends a push, with the same ingest token you use for other server events:

```shell
curl -X POST "https://YOUR_HERALD_HOST/api/v1/events" \
  -H "Authorization: Bearer $HERALD_INGEST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "events": [
    { "id": "evt_123", "userId": "u_123", "name": "$external_push",
      "timestamp": "2026-11-21T08:00:00Z",
      "properties": { "category": "transactional", "message_id": "order-42-shipped", "source": "orders" } }
  ] }'
```

| Property | Rules |
|---|---|
| `category` | `transactional`, `marketing` or `other`. Optional; defaults to `other`. Any other value is refused. |
| `message_id` | Optional, 1 to 200 characters. A push with the same `message_id` for the same user counts once. |
| `source` | Optional, 1 to 100 characters, such as `orders`. |

Don't send the push's title or body: Herald drops every other property. The person's profile shows each one as "Push sent by your app", with its category and source.

## SDK auto-capture

From SDK 0.6.0, the SDKs also record pushes they see, with `trackExternalPushes` on (the default):

- **iOS:** a push that isn't from Herald, when the person taps it and your app forwards the tap to `handleNotificationResponse`.
- **Android:** a non-Herald FCM message with a notification, when it reaches `HeraldMessagingService` (`herald-fcm`). In your own FirebaseMessagingService, call `Herald.handleExternalPush(message.data, message.notification != null, message.messageId)`.

The SDKs also record some of these pushes on their own: on iOS when someone taps one, and on Android when one arrives. To count every push, report them from your backend. They never record silent or data-only pushes.

You can also report a push from the app: `trackExternalPush(messageId:category:source:)` on iOS, `Herald.trackExternalPush(messageId, category, source)` on Android. Turn auto-capture off with `trackExternalPushes = false` in `HeraldConfiguration` (iOS) or `HeraldOptions` (Android), or without an app update with **Track pushes your app sends** under Settings, [SDK settings](/docs/data-and-privacy/data-collection-controls#remote-sdk-settings) (0.6.0 and later).

## Count each push once

When both your backend and the SDK report the same push, give them the same ID. Put the `message_id` your backend reports in the push payload under `herald_external_id`, and the category under `herald_category`:

```json
{ "aps": { "alert": { "title": "Order shipped", "body": "…" } },
  "herald_external_id": "order-42-shipped", "herald_category": "transactional" }
```

On Android, put them in the FCM `data` block. Without `herald_external_id`, the SDK uses the notification's own ID (the iOS request identifier, the FCM message ID), so one push seen twice on a device still counts once, but it won't match your backend's report.

## The push limit

In Enforce mode the push limit is replaced by the app's messaging limits and attention budget: a `$external_push` event with `category: "transactional"` doesn't count toward the budget, and any other one counts toward the push channel only. See [Message priority and attention budget](/docs/concepts/message-priority). The rest of this section describes the push limit used in Observe mode.

Each app has a push limit across all sources, on by default at 3 pushes per person in the last 24 hours. It counts every mobile push the person got from the app: Herald agent, campaign and Send API pushes, plus the pushes your app reports. When someone has reached it, Herald makes no new push decisions for them (an agent with other channels can still pick one of those) and skips agent and campaign pushes due for them; Send API messages are never skipped, but they count. Campaigns sent through Braze aren't limited; Braze schedules those itself. Web push and other channels don't count. A push counts once however many of the person's devices it reached.

Change it in **Settings > General > Push limit across all sources**: turn **Limit pushes per person** off, or set **Pushes per 24 hours** from 1 to 20. A skipped push shows in campaign results under "Skipped at send time" as "push limit".

## Related

- [How delivery works](/docs/concepts/how-delivery-works)
- [Event payload spec](/docs/reference/event-payload)
- [Server API](/docs/reference/server-api)
- [Limits](/docs/reference/limits)
