Menu

Notifications

Send or schedule a notification, cancel it, and read its status and per-device results.

POST /v1/notifications

Secret key. Sends a notification now, or at sendAt. Answers 202 Accepted with its id and status: queued, scheduled, or held, for a broadcast (all or tags) to over 10,000 devices in an account’s first 7 days, until Pushwren reviews it.

{
  "target": { "userIds": ["u_123"] },
  "alert": { "title": "Order shipped", "subtitle": "Arriving Friday", "body": "Your order A1001 is on its way." },
  "badge": 1,
  "sound": "default",
  "data": { "orderId": "A1001" },
  "options": {
    "collapseId": "order-A1001",
    "threadId": "orders",
    "interruptionLevel": "time-sensitive"
  }
}
{ "id": "ntf_01JD3QF1V6N8R2Y4P7S9T0AKME", "status": "queued" }

target is exactly one of:

  • { "deviceIds": [...] } or { "userIds": [...] }, up to 1,000 each;
  • { "tags": [...] }, up to 10, matching devices with any of them;
  • { "all": true };
  • { "testDevices": true }, the devices you marked as test devices in the portal.

Content: alert (title, subtitle, body), badge, sound and data. data keys arrive beside aps in the payload, and as opened.data in the app. The payload Pushwren builds must be 4,096 bytes or less, or the request answers payload_too_large.

image is an https URL of up to 1,024 characters that the app’s Notification Service Extension helper downloads and attaches. It needs an alert push with alert: a background push, a send without alert, or one with a raw apns payload answers 422. It also sets mutable-content, and the 4,096-byte check includes it.

Reserved data keys: aps, _h, _i and _r answer 422. Pushwren uses _h for the notification ID, _i for the image and _r for the delivery receipt.

options: pushType (alert or background), priority, collapseId, expiresAt, interruptionLevel, relevanceScore, threadId, category and mutableContent, each as Apple defines it.

A silent push sets "options": { "pushType": "background" } with no alert, badge or sound:

{
  "target": { "tags": ["pro"] },
  "data": { "refresh": "inbox" },
  "options": { "pushType": "background" }
}

Scheduling: sendAt (ISO 8601, up to 30 days ahead) schedules it:

{
  "target": { "all": true },
  "alert": { "title": "Sale starts now", "body": "20% off everything until Sunday." },
  "sendAt": "2026-12-01T17:00:00Z"
}

Local time: sendAtLocal sends when each device’s own clock reads a date and time, so one send reaches every device at 09:00 where it is. date is YYYY-MM-DD and time is HH:MM, 24-hour. Use it instead of sendAt:

{
  "target": { "all": true },
  "alert": { "title": "Sale starts now", "body": "20% off everything until Sunday." },
  "sendAtLocal": { "date": "2026-12-01", "time": "09:00" },
  "fallbackTimeZone": "America/New_York"
}

fallbackTimeZone is an IANA name such as America/New_York, for devices that report no time zone or one Pushwren doesn’t know; it defaults to UTC and is allowed only with sendAtLocal. The send is accepted as scheduled. Each of these answers 400 invalid_request naming the field: both sendAt and sendAtLocal; fallbackTimeZone without sendAtLocal; a date that doesn’t exist; an unknown time zone; or a send whose latest device time is more than 30 days ahead. The Local-time sends guide explains how devices are grouped, times that have passed, and daylight saving.

Retries: send an Idempotency-Key header and retry with the same key; see Idempotency.

Errors: a send needs a working APNs key for each environment it reaches, or it answers apns_not_configured. Over a plan limit it answers plan_limit_exceeded.

GET /v1/notifications

Secret key. Your notifications, newest first, with pagination: { "notifications": [...], "cursor": "…" }.

GET /v1/notifications/{id}

Secret key. One notification’s status, counts and the payload as sent:

{
  "id": "ntf_01JD3QF1V6N8R2Y4P7S9T0AKME",
  "status": "completed",
  "source": "api",
  "target": { "userIds": ["u_123"] },
  "counts": { "targeted": 2, "accepted": 1, "failed": 0, "invalidated": 1, "opened": 1, "delivered": 1, "receiptsRequested": 1 },
  "createdAt": "2026-12-01T16:58:03Z",
  "completedAt": "2026-12-01T17:00:02Z"
}

A local-time send shows sendAtLocal, fallbackTimeZone and, once Pushwren has planned it, slices in place of sendAt. Each slice is a group of devices sent at one moment:

{
  "id": "ntf_01JD3QF1V6N8R2Y4P7S9T0AKME",
  "status": "sending",
  "sendAtLocal": { "date": "2026-12-01", "time": "09:00" },
  "fallbackTimeZone": "America/New_York",
  "slices": [
    { "at": "2026-12-01T09:00:00.000Z", "devices": 410, "status": "completed" },
    { "at": "2026-12-01T14:00:00.000Z", "devices": 3120, "status": "sending" },
    { "at": "2026-12-01T17:00:00.000Z", "devices": 980, "status": "scheduled" }
  ]
}

A slice’s status is scheduled, sending, completed, failed or canceled, and a failed slice has a reason. The send is scheduled until its first slice goes, sending until the last one finishes, then completed; it is failed if every slice failed or a stop such as SendsPaused ended it. counts.targeted is the devices planned, less any removed before their slice.

status is held, scheduled, queued, sending, completed, canceled or failed. In counts, accepted means Apple accepted the push; Apple never confirms that a device showed it. invalidated counts devices Apple said are gone. receiptsRequested is how many accepted pushes asked the device for a receipt, and delivered how many confirmed, by a receipt or by an open: a lower bound that is never above receiptsRequested. Only alert pushes to devices whose app has the helper ask, and a send to over about 1,000 devices asks a sample of about 1,000. See Images and delivery receipts.

GET /v1/notifications/{id}/deliveries

Secret key. The result for each device, with pagination: { "deliveries": [...], "cursor": "…" }. Each has deviceId, status (accepted, failed or invalidated) and, when it failed, Apple’s or Pushwren’s reason, explained in Delivery failures. Each has deliveredAt when its receipt arrived (or its open, for a push that asked) and receiptRequested when it was asked. Sends to over 1,000 devices keep a row only for devices that didn’t succeed, and for opens.

DELETE /v1/notifications/{id}

Secret key. Cancels a scheduled or held notification. Answers 200 with the notification, now canceled. An ordinary send that is queued, sending or finished answers not_cancelable: a send without sendAt is queued at once, so only a scheduled one can be stopped.

A local-time send can be canceled while it is scheduled or sending. Slices that haven’t started are canceled; a slice that is already running finishes, and slices already sent keep their results.