POST
/
apps
/
{app_id}
/
live_activities
/
{activity_id}
/
notifications
curl --request POST \
  --url https://api.onesignal.com/apps/{app_id}/live_activities/{activity_id}/notifications \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "event": "update",
  "event_updates": {},
  "name": "<string>",
  "contents": {
    "en": "<string>"
  },
  "stale_date": 123,
  "dismissal_date": 123,
  "priority": 5,
  "ios_relevance_score": 123
}'
{
  "id": "<string>"
}

Overview

Update or terminate running iOS Live Activities using our REST API. This endpoint enables real-time content updates and activity termination, ensuring dynamic, context-aware user experiences.

Before using this API, ensure your app is properly configured by following the Live Activities developer setup.

How to Use this API

  1. Select the Live Activity to update by specifying its activity_id in the URL. This is set when using the:
  1. Update the state of the Live Activity by setting the event_updates parameter to a JSON object that matches the structure of the ActivityAttributes.ContentState struct defined in your Live Activity widget extension.

  2. When ready to terminate the Live Activity, set the event parameter to \"end\" and include a dismissal_date if you want the Live Activity to be dismissed in less than 4 hours.


Headers

Content-Type
string
default:application/json
required
Authorization
string
default:Key YOUR_APP_API_KEY
required

Your App API key with prefix Key. See Keys & IDs.

Path Parameters

app_id
string
required

Your OneSignal App ID in UUID v4 format. See Keys & IDs.

activity_id
string
required

An identifier you set when starting the Live Activity to uniquely identify it and associated devices with the event. This value is crucial for maintaining a consistent reference to the Live Activity across different devices and sessions. Consider using a UUID, CUID, or NanoID for this parameter.

Body

application/json

Response

201
application/json

201

The response is of type object.