π Most agents should use the MCP server instead β itβs the recommended way to read live activity. This page is the optional REST fallback for agents that canβt speak MCP. It returns the same data via plain HTTP.
product_id and a user_id, and the connector hands back the last few things that user did.
π The endpoint
| Part | Meaning |
|---|---|
{product_id} | Your Autoplay product id β the same YOUR_PRODUCT_ID you registered in the Quickstart. |
{user_id} | The stable user identifier your activity source stamps events with (e.g. the id you pass to posthog.identify(...); the Amplitude user_id; β¦). This match is the linchpin; see Identity. |
?limit= | Optional. Max recent actions to return. Omitted or <= 0 falls back to the configured cap (50). |
Authorization: Bearer YOUR_UNKEY_TOKEN (the Unkey token from your Quickstart product registration).
- 401 β token missing or invalid.
- 403 β the token is valid but its
external_iddoesnβt match the{product_id}in the URL (a key for product A canβt read product B).
π¦ The response
The envelope, withactions ordered oldest β newest:
type, title, description, timestamp_start, timestamp_end, raw_url, canonical_url, and index. The user_id lives on the envelope, not inside each action.
β³ Before activity appears
This surface only returns something once the connector has recorded activity for that user β your activity source must be wired up and the user must have generated events. With PostHog (the source used in the Quickstart): complete Quickstart Steps 1β4 β the snippet,posthog.identify(...), product registration, and the webhook. You do not need Quickstart Step 5 (the SSE stream consumer); thatβs a separate push-style integration. Other sources (e.g. Amplitude) follow the same idea through their own ingestion path.
Retention β this is short-lived βliveβ memory, not an archive:
- 24-hour TTL (
ACTIVITY_TTL_S=86400) β activity older than a day expires. - 50 actions max per user (
ACTIVITY_MAX_EVENTS=50) β older ones are trimmed.