latestOpenAPI 3.0.32026-08-227451,2751.8 MB

d0fc0114da66

AnalysisCache

Trigger a stats refresh for a cache scope

Enqueues an AI_ANALYSIS_CACHE_REFRESH task for the given scope; the queue-consumer worker recomputes stats and regenerates the LLM narrative asynchronously. Requires the ai_analysis write scope. Because it triggers a downstream LLM call, the workspace must have generative_ai enabled and not excluded; otherwise the endpoint returns 403. Supports test scope (scope_key = test invariant id) and workspace scope (scope_key = *:*); other scope types, and any other workspace scope_key, return 400.

post/workspaces/{workspace_id}/analysisCache/refresh

Path parameters

workspace_idstring required

ID of the workspace

Request body

scope_type'test' | 'plan' | 'workspace' required

Cache scope level

scope_keystring required

Scope identifier. For test scope, the test invariant id with the -j suffix (e.g. abc123-j). For workspace scope, the composite {app_id or '*'}:{env_id or '*'} — v1 accepts *:* only.

initiating_request_idstring

Optional idempotency key. The dataflow trigger generates a UUID per debounced refresh and sends it here; a Beam retry of the HTTP step replays the same key. Server-side dedup on this key is a follow-up; today the field is accepted by the contract but not yet acted on.

Response

Refresh task accepted and enqueued for asynchronous processing.