---
title: "Register a Live Activity push token"
method: POST
path: "/activities/register"
tags: ["Activities"]
---

# Register a Live Activity push token

`POST /activities/register`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/activities/register`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `/api/oauth/authorize`, token URL `/api/oauth/token`, scopes: `activities:write`)

iOS app calls this on every `Activity.pushTokenUpdates` emission. The backend stores the token, keyed by (user, post_id_hash, push_token), and uses it to send `apns-push-type: liveactivity` updates as platforms complete. Idempotent — re-posting the same triple bumps the TTL. Tokens auto-expire after 1 hour of inactivity (or when the publish completes and the dispatcher sends a final update).

## Request body

- RegisterActivityRequest
  - `push_token` string, required: ActivityKit push token for a single in-flight Live Activity. Hex-encoded. Treated as a credential — never echoed back. Apple emits one per Activity.request(pushType:.token); mobile clients POST it as soon as `pushTokenUpdates` fires.
  - `post_id_hash` string, required: SHA-256 prefix of the post ID, matching `PostPublishingAttributes.postIdHash` on the iOS client. Backend dispatcher uses this as the key when fanning out platform-completion pushes.
  - `apns_environment` 'production' | 'sandbox': Set to "sandbox" for dev/TestFlight builds. Defaults to "production".
  - `bundle_id` string, required: The Live Activity widget extension bundle ID. Used as `apns-topic: <bundle-id>.push-type.liveactivity` when sending updates. MUST match the extension target on the device.

## Response `201`

Live Activity registered

- object
  - `data` LiveActivityRegistration, required
    - `id` string, required: MongoDB ObjectId (24-character hex string)
    - `post_id_hash` string, required
    - `apns_environment` 'production' | 'sandbox', required
    - `bundle_id` string, required
    - `created_at` string, date-time, required
    - `last_seen_at` string, date-time, required

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/sociahive/apis/sociahive-api.md) · [All operations](https://skmtc.dev/sociahive/apis/sociahive-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociahive/apis/sociahive-api/revisions/791b8548d288?raw)
