Skip to main content
To send a notification, your application calls a single mutation — emitNotification — with the event key of a notification type and a target (who should receive it). Archie does the rest: it resolves the recipients, checks their preferences, renders the templates, and delivers on each channel. You describe intent (“notify these users that their build failed”); you never build per-recipient rows yourself. Endpoint
Required headers

The input at a glance

Choosing a target

A target is exactly one of:
  • userIds — an explicit list of user ids. Use this for transactional notifications (“notify this user”).
  • audience — a named group:
    • SUBSCRIBERS — everyone whose preference for this type is enabled (respecting per-user opt-in).
    • ALL_PROJECT_USERS — every user in the project (use sparingly; respects mandatory and anomaly rules).

Examples

Notify specific users

Response

Notify everyone subscribed to a type

For an audience send, delivery happens asynchronously: accepted: true means the request was queued. recipientCount is therefore null and a fanoutJobId is returned that identifies the broadcast.

Make a send idempotent

If your service might retry, pass a stable dedupKey. The same key is never delivered twice:

Understanding the result

EmitNotificationResult tells you what happened synchronously:

When a send is rejected

If accepted is false, check rejectedReason. Common reasons:
A rejection is a normal, expected response (the mutation still returns 200); it is not a server error.

Large broadcasts

To protect your users from accidental mass-sends, an audience broadcast that resolves to an unusually large number of recipients is held unless you explicitly confirm it. If you intend to reach a very large audience, set broadcastConfirm: true:

Next step

See how recipients read and stream their notifications in In-app inbox & real-time updates.