Schedule a Live Activity

.md

Have the server turn a meeting's Live Activity around at the start and take it away at the end.

POST/v1/me/activities

For Propper Calendar's meeting on the lock screen. iOS never ends a Live Activity by itself and does not draw it again because the clock moved, so a meeting would stand at 0:00 until somebody opened the app. The app starts the activity, and hands its push token here. The server then sends two pushes: an update when the meeting starts, and the end when it ends, which takes the activity away at once.

Nothing is stored and nothing of the account is read. content_state is sent back to the phone exactly as it came, so it is in the app's own shape. Needs no scope, the same as registering for notifications.

Request

curl -X POST https://api.proppertrading.com/v1/me/activities \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Idempotency-Key: 2d6f8a0c-4e1b-4c3d-9a5e-7f9b1d3e5a7c" \
  -H "Content-Type: application/json" \
  -d '{
    "environment": "production",
    "token": "80f2d4c6e8a0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c6e8b0d2f4a6c8e0b2d4f6a8",
    "starts_at": "2026-09-30T13:00:00Z",
    "ends_at": "2026-09-30T13:45:00Z",
    "content_state": { "title": "Weekly check-in", "startsAt": 781016400, "endsAt": 781019100 }
  }'
FieldDescription
environmentsandbox for a development build, production for TestFlight and the App Store
tokenThe activity's own push token as hex, not the device's
starts_atWhen the meeting starts. No push for the start when that has already passed
ends_atWhen it ends, and the activity with it. In the future, and at most a day away
content_stateThe activity's content state, sent back with both pushes. At most 2 KB as JSON

Response

202: the pushes are queued.

{
    "data": {
        "object": "live_activity",
        "starts_at": "2026-09-30T13:00:00.000000Z",
        "ends_at": "2026-09-30T13:45:00.000000Z"
    },
    "meta": {
        "request_id": "req_01kza4b6c8d0e2f4g6h8j0k2m4n6"
    }
}

Calling it again for the same activity, when iOS hands out a new token, queues the pushes again for the new one. A push that reaches an activity that is already gone is ignored by the phone.

Errors

StatusCodeMeaning
401invalid_tokenNot a token, or the secret is wrong
422validation_failedA field is missing, has a bad shape, or the end is past
429rate_limit_exceededMore than 30 in a minute