Outcome
Persist one workspace digest for a window whose end is greater than its start. Every invocation creates a new digest; configured notification transport is attempted separately and has no delivery receipt in the response.
Before you start
- Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
- Development stores content without encryption and uses scoped SHA-256 identifier hashes. Staging and production require envelope encryption and a provisioned application root; missing custody does not permit plaintext.
- The published application permission is feed:write. Discover a granted Feed workspace and bind that exact resource. Supplied identifiers and query selectors do not grant access.
- Authorize the documented mirror, security, external-fetch, reporting, privacy or archival effects before CLI --confirm or MCP confirm:true. A GET request can initialize a local mirror.
Discover the target
topolo whoami --json
topolo actions get app_topolo_feed.analytics.digest.generate --detail --json
topolo resources topolo-feed --json
topolo workspaces list topolo-feed --json
- Select the exact granted workspace id as FEED_WORKSPACE_ID. Fixture ids authorize no live operation.
Request
POST /api/analytics/digests
Save action input as payload.json. Inspect the plan for the exact path, query and body. Set FEED_WORKSPACE_ID from granted resource discovery.
Inspect and test this action in the signed action console, then perform the verification below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
windowStart | Required | integer | Inclusive reporting-window start in Unix milliseconds, a non-negative integer.; {"minimum":0,"maximum":9007199254740991} |
windowEnd | Required | integer | Inclusive reporting-window end in Unix milliseconds, a positive integer strictly greater than windowStart.; {"maximum":9007199254740991} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"windowStart": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Inclusive reporting-window start in Unix milliseconds, a non-negative integer."
},
"windowEnd": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Inclusive reporting-window end in Unix milliseconds, a positive integer strictly greater than windowStart."
}
},
"required": [
"windowStart",
"windowEnd"
],
"additionalProperties": false
}
Effects
- Resolves the workspace through platform grants and can insert its identity-only local mirror before the route permission check. GET is therefore a mutation for action planning; it does not create a canonical workspace or change its name.
- Aggregates event counts and summed durations in the window, stores an encrypted summary under a new digest id and returns the readable summary.
- Attempts feed.digest.ready only when notification transport is configured. A delivery error can occur after persistence; there is no shared transaction or idempotency key.
Interpret the response
Use response path $.digest.id for feed_digest. An empty list does not discover a target.
Retain digest.id and the exact window and summary. The response confirms the persisted local workflow result, not notification delivery. After an uncertain write, an independently authorized organization privacy export can inspect matching digest records; avoid blind retries that create another digest.
The success schema below was checked against captured handler responses. Polymorphic configuration and protected device assignment fields vary; exact envelope and SQL row fields are source-reviewed. Error examples retain their actual refusal shapes.
Success schema:
{
"type": "object",
"properties": {
"digest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"windowStart": {
"type": "number"
},
"windowEnd": {
"type": "number"
},
"summary": {
"type": "array",
"items": {
"type": "object",
"properties": {
"event_type": {
"type": "string"
},
"event_count": {
"type": "number"
},
"total_duration": {
"type": "number"
}
},
"required": [
"event_type",
"event_count",
"total_duration"
],
"additionalProperties": false
}
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"windowStart",
"windowEnd",
"summary",
"createdAt"
],
"additionalProperties": false
}
},
"required": [
"digest"
],
"additionalProperties": false
}
Worked examples
Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. SQL result shapes are also reviewed against migrations and handlers; empty captures do not exercise every populated export store. Live publication and read-back are separate environment evidence. Refused examples demonstrate boundaries and must not be executed as successful workflows.
Successful request
Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. Captured scenario: digest and anomaly actions persist workspace-scoped terminal state.
Input · payload.json:
{
"windowStart": 0,
"windowEnd": 100
}
CLI:
topolo actions validate app_topolo_feed.analytics.digest.generate --data @payload.json --json
topolo actions plan app_topolo_feed.analytics.digest.generate --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_feed.analytics.digest.generate --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_feed.analytics.digest.generate",
"input": {
"windowStart": 0,
"windowEnd": 100
},
"resourceType": "workspace",
"resourceId": "<identifier returned by granted resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"digest": {
"id": "digest_827c505d-8c8d-4c34-9df5-0f0fc8c1ab4a",
"windowStart": 0,
"windowEnd": 100,
"summary": [
{
"event_type": "impression_start",
"event_count": 1,
"total_duration": 10
}
],
"createdAt": "2026-10-04T04:12:42.924Z"
}
}
HTTP 201. Retain digest.id and the exact window and summary. The response confirms the persisted local workflow result, not notification delivery. After an uncertain write, an independently authorized organization privacy export can inspect matching digest records; avoid blind retries that create another digest.
Refused request · HTTP 400
Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. Captured scenario: digest and anomaly actions persist workspace-scoped terminal state.
Input · payload.json:
{
"windowStart": 100,
"windowEnd": 100
}
CLI:
topolo actions validate app_topolo_feed.analytics.digest.generate --data @payload.json --json
topolo actions plan app_topolo_feed.analytics.digest.generate --resource-type workspace --resource-id "$FEED_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 400:
{
"error": "invalid_reporting_window"
}
HTTP 400. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.
Verify the result
- Retain digest.id and the exact window and summary. The response confirms the persisted local workflow result, not notification delivery.
- After an uncertain write, an independently authorized organization privacy export can inspect matching digest records; avoid blind retries that create another digest.
Errors and recovery
invalid_reporting_window(HTTP 400): Inspect the exact handler refusal and correct the target, window, URL or confirmation before preparing another authorized request.
Auth, action-input validation and platform resource resolution can refuse a request before its handler. Retain the exact error, request id and context; requesting another context is not a legitimate way to bypass a refusal.
Recovery boundary
No narrow digest deletion or update action is published. Preserve the record and correct the analysis with a separately authorized new digest; organization erasure is not a rollback for reporting.
Related actions
- Export Feed organization data: Export all local Feed stores for the authenticated organization, including readable protected fields and per-workspace KV configuration and assignments. This operation is organization-wide and is not limited by a workspace header.
Evidence
Actual Feed Worker response using synthetic Auth, workspace grants, in-memory D1/KV and simulated source/notification transport. No live provider, encryption audit, device enrollment or external delivery is established. Credentials are excluded or explicitly redacted. SQL result shapes are also reviewed against migrations and handlers; empty captures do not exercise every populated export store. Live publication and read-back are separate environment evidence. Capture digests and test scenarios are retained in the source fixture records.