POST /api/update

Change what one or more activities show.

Send only the fields that change. They merge into the saved state, so a call with just primaryText leaves everything else alone. See the state object.

Targets

Every call includes the widgetContainerId and one of:

  • activityId: one activity.
  • activityIds: a list of activities.
  • group: every activity in the group.

If none of the named ids exist in the container, the call answers 404. A group with no activities answers 200 with targeted: 0.

By activity id

1
2
3
4
5
6
7
8
9
10
11
12
13
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "acme-orders",
  "state": {
    "primaryText": "Out for delivery",
    "stage": "On the way",
    "progress": 0.7,
    "estimatedMinutes": 8
  }
}'

By multiple activity ids

1
2
3
4
5
6
7
8
9
10
11
12
13
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityIds": [
    "act-8f2cqa4mx7rd",
    "act-9k4d2bwh6tne"
  ],
  "widgetContainerId": "acme-orders",
  "state": {
    "secondaryText": "Running behind schedule"
  }
}'

By group

1
2
3
4
5
6
7
8
9
10
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "group": "order-tracker",
  "widgetContainerId": "acme-orders",
  "state": {
    "secondaryText": "Kitchen is busy tonight"
  }
}'

Response

targeted is how many activities the update was sent to. unknown lists ids that were not found in this container.

1
2
3
4
5
{
  "ok": true,
  "targeted": 3,
  "unknown": []
}

Examples

Quiet update

Every update alerts the phone, with primaryText as the title and secondaryText as the body. priority takes 10 (the default) or 5. Send priority: 5 for a quiet update: no alert on iPhone, no sound on Android. Any other value counts as 10. For timing and billing, see delivery and billing.

1
2
3
4
5
6
7
8
9
10
11
12
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "acme-orders",
  "priority": 5,
  "state": {
    "progress": 0.8,
    "estimatedMinutes": 4
  }
}'

Advance segmented steps

Send the full segments list with new complete values. The list is replaced, not merged.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "pizza-tracker",
  "state": {
    "primaryText": "On the way",
    "segments": [
      {
        "label": "Cooking",
        "complete": true
      },
      {
        "label": "On the way",
        "complete": false
      },
      {
        "label": "Delivered",
        "complete": false
      }
    ]
  }
}'

Update a versus score

The versus object merges one level down, so only send what changed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "csgo-scores",
  "state": {
    "versus": {
      "leftScore": "16",
      "rightScore": "14",
      "activeSide": "left",
      "leftStatus": "Winner"
    }
  }
}'

Change the layout

Send a new layout with that layout's fields. The card changes type.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "acme-orders",
  "state": {
    "layout": "countdown",
    "primaryText": "Ready for pickup",
    "secondaryText": "Pickup closes in",
    "countdownTo": 1795046400,
    "completionText": "Pickup closed"
  }
}'

Restart a card

A restart creates the card again instead of changing it in place. A restart always alerts and ignores priority. An update is sent as a restart when:

  • it has restart: true,
  • it adds a new image URL (the iPhone must download the image first), or
  • the card started more than 8 hours ago (iOS stops taking normal updates after 8 hours).

Use restart: true to bring back a card the user swiped away, or one that was ended. A normal update cannot. With no state, the card restarts with its saved state.

1
2
3
4
5
6
7
8
curl -X POST https://api.webliveactivity.com/api/update \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: wla_your_key' \
  -d '{
  "activityId": "act-8f2cqa4mx7rd",
  "widgetContainerId": "acme-orders",
  "restart": true
}'

Keep image URLs the same between calls. A URL with a changing query string counts as a new image and restarts the card on every update.

Ready To Start Building Live Activities Without “Building Them”?

Ready To Start Building Today?

No App Store submission, no native codebase to maintain. A link gets your activity onto your users’ screens, and an easy to use API keeps it live.

Includes: 7,000 Free Pushes per Month

Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
8 PM
Doing LaundryComplete This Task By 8:00 PM
Do LaundryClean FloorEat Lunch
Domino'sCooking
912
Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
Live
View LiveMoly’s Cat CamUpdated 3 Seconds AgoCat cam
In The Oven NowMat has your order in the oven.Domino's
CookingOn The WayDelivered
Thinking
Researching API EndpointPreparing changes to Foodscout
ThinkingWorkingComplete
Delivery in 30 MinutesMat is racing your way.Domino's
On The WayDelivered
GTA00:00
GTA00:00:00GTA VI
San Francisco ShockHome1
MapMidtown
3
Dallas FuelAwayOverwatch LeagueWatch Live
United 1423Gate B22 · Seat 14C · SFO → JFK
BoardingIn AirArrived
Boarding
Arriving in 6 MinutesMarcus · Toyota CamryToyota Camry
On The WayArrived
6 Min
Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
8 PM
Doing LaundryComplete This Task By 8:00 PM
Do LaundryClean FloorEat Lunch
Domino'sCooking
912
Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
Live
View LiveMoly’s Cat CamUpdated 3 Seconds AgoCat cam
In The Oven NowMat has your order in the oven.Domino's
CookingOn The WayDelivered
Thinking
Researching API EndpointPreparing changes to Foodscout
ThinkingWorkingComplete
Delivery in 30 MinutesMat is racing your way.Domino's
On The WayDelivered
GTA00:00
GTA00:00:00GTA VI
San Francisco ShockHome1
MapMidtown
3
Dallas FuelAwayOverwatch LeagueWatch Live
United 1423Gate B22 · Seat 14C · SFO → JFK
BoardingIn AirArrived
Boarding
Arriving in 6 MinutesMarcus · Toyota CamryToyota Camry
On The WayArrived
6 Min
Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
8 PM
Doing LaundryComplete This Task By 8:00 PM
Do LaundryClean FloorEat Lunch
Domino'sCooking
912
Movistar RidersMovistar RidersTerrorist9
MapOverpass
12HeroicHeroicCounter TerroristCSGOCSGO EsportsWatch Live
Live
View LiveMoly’s Cat CamUpdated 3 Seconds AgoCat cam
In The Oven NowMat has your order in the oven.Domino's
CookingOn The WayDelivered
Thinking
Researching API EndpointPreparing changes to Foodscout
ThinkingWorkingComplete
Delivery in 30 MinutesMat is racing your way.Domino's
On The WayDelivered
GTA00:00
GTA00:00:00GTA VI
San Francisco ShockHome1
MapMidtown
3
Dallas FuelAwayOverwatch LeagueWatch Live
United 1423Gate B22 · Seat 14C · SFO → JFK
BoardingIn AirArrived
Boarding
Arriving in 6 MinutesMarcus · Toyota CamryToyota Camry
On The WayArrived
6 Min