---
title: "Trigger an AI analysis of an ended activeflow."
method: POST
path: "/timeline-analyses"
tags: ["Timeline"]
---

# Trigger an AI analysis of an ended activeflow.

`POST /timeline-analyses`

Analyzes a completed (ended) activeflow asynchronously, producing a structured verdict. Returns the progressing record on a fresh trigger, or the existing record when one is already present (idempotent unless `reanalyze` is set). Requires CustomerAdmin or CustomerManager permission. The analysis is scoped to the authenticated customer; the activeflow must belong to that customer and must be in the ended state.

## Request body

- object
  - `activeflow_id` string, uuid, required — The ID of the ended activeflow to analyze. Returned from the `GET /activeflows` response.
  - `reanalyze` boolean — When true, discards the existing completed/failed verdict and runs a fresh analysis (subject to a short cooldown). When false or omitted, an existing record is returned unchanged.

## Response `200`

The progressing or existing analysis record.

- TimelineManagerAnalysis — AI analysis of an ended activeflow. Produced on demand, stored once, and optionally re-analyzed. The structured verdict lives in `result` once the analysis completes.
  - `id` string, uuid — The unique identifier of the analysis. Returned from the `POST /timeline-analyses` or `GET /timeline-analyses` response.
  - `customer_id` string, uuid — The customer who owns this analysis.
  - `activeflow_id` string, uuid — The ended activeflow that was analyzed. Returned from the `GET /activeflows` response.
  - `status` 'progressing' | 'completed' | 'failed' — Lifecycle state of the analysis.
  - `result` object — The structured analysis verdict. Null while progressing or on failure. Present on successful completion. Includes an overall status, a narrative, detected issues with evidence pointers, and per-type resource usage.
  - `error` string — Sanitized failure reason when status is failed.
  - `tm_create` string, date-time — Timestamp when the analysis was created.
  - `tm_update` string, date-time, nullable — Timestamp when the analysis was last updated.

## Other responses

- `400` — Invalid request (INVALID_ARGUMENT).
- `401` — Authentication required (UNAUTHENTICATED).
- `403` — Insufficient permission (PERMISSION_DENIED).
- `404` — Resource not found (NOT_FOUND).
- `409` — State conflict (ALREADY_EXISTS or FAILED_PRECONDITION).
- `429` — Rate or quota exceeded (RESOURCE_EXHAUSTED).
- `500` — Internal error (INTERNAL).

---

[API](https://skmtc.net/voipbin/apis/voipbin-api.md) · [All operations](https://skmtc.net/voipbin/apis/voipbin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voipbin/voipbin-api/revisions/79e779080bcc/schema)
