Live Activities
Start, update and end Live Activities by your own key, make broadcast keys, read each device's last result, and the SDK's token routes.
Your server addresses each Live Activity by a key of its own, such as order-A1001: 1 to 64 letters, digits and _ . : -. The Live Activities guide covers the app’s side, the iOS versions and the Broadcast capability.
Every private activity key must be unguessable. Any install of your app can follow an activity the app started under a key it knows, so for anything private (an order, a ride) include a random or secret part: order-A1002-7f3c9a, not order-A1002. A key your server started is followed only by the devices its start reached.
A start, an update and an end are queued and answer 202 with { "key": "…", "status": "queued" }. Each device’s result then shows in GET /v1/live-activities/{key}. Apple’s payload is at most 4,096 bytes: Pushwren builds it when it accepts the call, and a larger one answers payload_too_large with nothing queued.
Once an end is accepted, the key takes nothing more until the end is sent, usually within seconds: an update or end answers conflict, and a start answers conflict too, saying to start again in a moment. A call that met another one changing the same key at the same moment answers try_again (503) with nothing changed: retry it.
A per-device activity is over 12 hours after its last start, update or end (Apple ends an activity after 8 hours and keeps it on the Lock Screen up to 4 more). It then shows as ended and is treated as one, and is removed 7 days later. A broadcast key is never over until you end it.
POST /v1/live-activities
Secret key. Starts an activity on the devices in target with a push (iOS 17.2 and later), under key.
{
"key": "order-A1002",
"attributesType": "OrderAttributes",
"attributes": { "orderNumber": "A1002" },
"contentState": { "status": "Received", "etaMinutes": 25 },
"target": { "userIds": ["u_123"] },
"alert": { "title": "Order A1002", "body": "We have your order." },
"staleDate": "2026-12-01T19:00:00Z",
"relevanceScore": 0.5
}
{ "key": "order-A1002", "status": "queued" }
key,attributesType,attributes,contentState,targetandalertare required. Apple requires an alert on a remote start.attributesTypeis your Swift type’s name,String(describing: OrderAttributes.self), which is how the SDK reports it.- Pushwren adds the key to
attributesaspushwrenKey, so the app tracks the activity under it. targetis one of the notification targets. Only devices that have reported a push-to-start token forattributesTypeare reached.- Updates and the end reach a device the start reached only after the person allows Live Activities from your app (Apple’s prompt, shown with the first remote-started activity). Until then, that device’s
atstays at the start’s time. See the guide. - On an active key your server started, of the same type, the start adds the devices it reaches; another type answers
conflict. On an active key the app started it answersconflict: start a new one under a different key. On an ended (or over) key it begins a new activity. On a broadcast key, iOS 18 devices start following its channel. - A start that reaches no device fails the activity:
reasonisNoPushToStartTokenwhen no target device has reported a push-to-start token for the type (the app callsenableRemoteStart(for:)on iOS 17.2 and later), or Apple’s reason when Apple refused each one. - Takes an
Idempotency-Keyheader, as sends do. - In an account’s first 7 days, a start to
allor tags reaching over 10,000 devices answersforbidden: send a regular notification to that audience first, and start again once it is released. - With no working APNs key it answers
apns_not_configured.
PATCH /v1/live-activities/{key}
Secret key. Updates the activity on every device that has it, or on its broadcast channels.
{
"contentState": { "status": "Preparing", "etaMinutes": 12 },
"alert": { "title": "Order A1002", "body": "Your order is being prepared." },
"staleDate": "2026-12-01T19:30:00Z",
"relevanceScore": 0.8,
"priority": "low"
}
contentStateis required;alert,staleDate,relevanceScoreandpriorityare optional.priorityishigh(the default) orlow. Apple limits how often high-priority updates reach a device; a low-priority one doesn’t count against that budget, and iOS applies it when it chooses.- A key that doesn’t exist, or expired 7 days after it ended, answers
not_found. An ended key answersconflict: start a new activity under it instead. So does a key with an end waiting to be sent. Afailedkey takes updates.
POST /v1/live-activities/{key}/end
Secret key. Ends the activity on every device or channel. The body is optional:
{
"contentState": { "status": "Picked up", "etaMinutes": 0 },
"dismissalDate": "2026-12-01T18:30:00Z"
}
Without a contentState, the end sends the newest content when it is accepted: that of the last update you sent, even one still queued. It is measured against the 4,096 bytes then. dismissalDate says when iOS removes the ended activity from the Lock Screen. Unknown and ended keys answer as for an update, and so does a second end. Once ended, a per-device activity is kept for 7 days, then removed.
POST /v1/live-activities/broadcasts
Secret key. Makes a broadcast key (iOS 18 and later), with an Apple channel in each environment where the app has a valid APNs key. Answers 201:
{ "key": "game-4521" }
{ "key": "game-4521", "channels": { "sandbox": "dHN0LTE=", "production": "cHJkLTE=" } }
- The app’s App ID needs Apple’s Broadcast capability, or it answers
broadcast_not_enabled. - A key already in use, broadcast or not, answers
conflict; so does reaching Apple’s limit of 10,000 channels per app. - Any other refusal from Apple answers
invalid_request(422) with Apple’s reason, and a rejected APNs keyapns_not_configured.
Updates and ends to a broadcast key go to its channels: one request to Apple per channel, so there are no per-device results. A broadcast key never expires, even once ended.
DELETE /v1/live-activities/broadcasts/{key}
Secret key. Deletes the broadcast key and its Apple channels. Answers 204. A key that isn’t a broadcast key answers not_found.
GET /v1/live-activities
Secret key. Your app’s activities in key order, with pagination, optionally only those in ?state= (active, ended or failed, as shown: one that is over counts as ended): { "activities": [...], "cursor": "…" }. Each is shaped as below, without devices.
GET /v1/live-activities/{key}
Secret key. One activity and each device’s last result:
{
"key": "order-A1002",
"attributesType": "OrderAttributes",
"origin": "server",
"state": "active",
"contentState": { "status": "Preparing", "etaMinutes": 12 },
"deviceCount": 2,
"startedAt": "2026-12-01T17:58:03Z",
"updatedAt": "2026-12-01T18:04:41Z",
"devices": [
{ "deviceId": "dev_01JD3Q8Z4T7M2K9XW5B6C0HFRA", "environment": "production", "status": "accepted", "at": "2026-12-01T18:04:41Z" },
{ "deviceId": "dev_01JD3QB7N2W4X8K5P9R6T3M0SE", "environment": "sandbox", "status": "failed", "reason": "TooManyRequests", "at": "2026-12-01T18:04:40Z" }
]
}
originisapp(the app started it),server(a remote start) orbroadcast. A broadcast key haschannels, and itsattributesTypeis empty until a remote start gives it one.stateisactive,ended(withendedAt) orfailed(withreason). It fails when an update reaches no device (every token gone, every channel refused, Apple refused the Live Activity topic, or the app’s APNs key can’t send) or a start reaches none. An ended activity hasdeviceCount0. One that is over shows asended, withendedAt12 hours after its last write.- A device’s
statusisaccepted(Apple accepted the push; Apple never confirms that a device displayed it) orfailedwith Apple’s or Pushwren’sreason, explained in Delivery failures. A device whose token Apple says is gone leaves the activity, so it isn’t listed.deviceslists up to 100 devices with a result.
SDK routes
The Swift SDK calls these for you, with the app’s publishable key and the device’s X-Device-Secret, as for devices. A wrong secret answers forbidden; an unknown device, not_found.
PUT /v1/devices/{deviceId}/live-activities/{key}
Publishable key with the device secret. Reports the device’s update token for the activity under key, and again whenever Apple rotates it; the server keeps only the latest. Starts an app activity when the key has none live (none, ended or over). Answers 204.
{
"token": "80f4b1c2d3e4a5b6978812ab34cd56ef7890a3f1c2e4b5d6978812ab34cd56ef",
"attributesType": "OrderAttributes"
}
- A key holding another type’s activity, or a broadcast key, answers
conflict. - A key your server started takes a token only from a device its start reached; any other device answers
conflict. A key the app started takes any install of the app, which is why private keys must be unguessable. - While an end is waiting to be sent, or when the key changed under the request, it answers
try_again: the SDK retries, and after the end a token starts the key afresh. - The SDK drops a report answered
409and retries a503.
DELETE /v1/devices/{deviceId}/live-activities/{key}
Publishable key with the device secret. The activity ended on this device: updates stop going to it. The activity goes on for other devices; when the last one leaves a per-device activity with nothing queued for it, the activity ends. Answers 204, whether or not the device had a token.
PUT /v1/devices/{deviceId}/start-tokens/{attributesType}
Publishable key with the device secret. Reports the device’s push-to-start token for an activity type (iOS 17.2 and later), and again whenever Apple rotates it. Answers 204.
{ "token": "c9d8e7f6a5b4c3d2e1f00918273645546372819aa1b2c3d4e5f60718293a4b5c" }
GET /v1/live-activities/{key}/channel
Publishable key with the device secret. Takes ?deviceId= and answers { "channelId": "…" }: the broadcast channel for key in that device’s APNs environment. It never makes one; a key with no channel there answers not_found.