---
title: "Start a failure analysis for a test run"
method: POST
path: "/analysis/{workspace_id}/testRun/{test_run_id}/summary"
tags: ["Analysis"]
---

# Start a failure analysis for a test run

`POST /analysis/{workspace_id}/testRun/{test_run_id}/summary`

## Request

- Base URL: `https://api.mabl.com`
- URL: `https://api.mabl.com/analysis/{workspace_id}/testRun/{test_run_id}/summary`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

Starts the results analysis agent on a failed TestRun that has no analysis, and saves a queued FailureAnalysis that the agent result supersedes. Rejected with 409 while the TestRun has an analysis or one is still in progress.

## Path parameters

- `workspace_id` string, required
- `test_run_id` string, required

## Response `201`

The queued FailureAnalysisResponse

- FailureAnalysisResponse: Generative AI failure analysis for an execution
  - `execution_id` string: Identifier of the associated execution for the FailureAnalysis
  - `status` 'queued' | 'done' | 'unavailable' | 'skipped': Analysis state
  - `analysis` FailureAnalysis: Generative AI failure analysis for a PlanRun
    - `id` string: Analysis ID - may be different when analysis regenerated
    - `execution_id` string: Execution identifier (e.g. plan run ID)
    - `workspace_id` string: Owning workspace ID
    - `execution_entity_type` 'plan_run' | 'test_run' | 'deployment': Analysis type
    - `synopsis` string: A synopsis of the failure summary
    - `summary_text` string: A summary describing the PlanRun failure and potential root cause
    - `prompt_id` string: ID of the prompt used to generate this entity
    - `created_by_id` string: ID of the user who created this entity
    - `created_time` integer: Time of entity creation in epoch milliseconds
    - `generated_time` integer: Time of successful analysis generation for this entity in epoch milliseconds
    - `agent_session_id` string: ID of the agent session that generated this analysis
    - `evidence_details` string: Agent-generated detailed evidence with visual and technical evidence
    - `content_blocks_json` string: Pre-computed structured content blocks for rich rendering of evidence_details, stored as a JSON array string. Parsed by the UI into ContentBlock[] for rendering.
    - `expire_datetime` string, date-time: Date time entity will be automatically purged from storage
    - `dedup_fingerprint_hash` string: SHA-256 of the per-failing-test signature multiset, used by plan-FA dedup.
    - `reused_from_run_id` string: When the failure analysis was reused from a prior run, the ID of the original run that produced the analysis.
    - `analysis_source` 'auto' | 'user_correction': Who authored this analysis. `auto` is the automatic analysis agent; `user_correction` is a correction a user made in the results chat, which supersedes the automatic reading and is not overwritten by a later automatic analysis of the same execution. Absent on rows written before this field existed, which are automatic.
    - `failing_step_number` string: The step number the run terminally failed at (e.g. "12.4"), from the execution log when the server could determine it, otherwise from the analysis agent. Test-run analyses only.
  - `skip_reason` 'plan_run_fraction' | 'workspace_burst': Why automatic analysis was skipped during a failure burst

## Other responses

- `400`: Invalid or missing parameter
- `401`: User not authenticated
- `403`: User not authorized
- `404`: No such Test Run
- `409`: Conflicts with the current state of the resource
- `default`: Unknown error

## Changes

- **2026-10-19** `b602223aa51f`: 6 info
  - added the optional property `guardrail/allOf[#/components/schemas/GuardrailRefusal]/approval` to the response with the `400` status
  - added the optional property `guardrail/allOf[#/components/schemas/GuardrailRefusal]/approval` to the response with the `401` status
  - added the optional property `guardrail/allOf[#/components/schemas/GuardrailRefusal]/approval` to the response with the `403` status
  - added the optional property `guardrail/allOf[#/components/schemas/GuardrailRefusal]/approval` to the response with the `404` status
  - …2 more
- **2026-10-17** `91ff383fb7f9`: 1 warning, 1 info
  - added the new `skipped` enum value to the `status` response property for the response status `201`
  - added the optional property `skip_reason` to the response with the `201` status
- **2026-10-15** `4e32d22292af`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mabl/apis/mabl-api/changes/analysis/:workspace_id/testRun/:test_run_id/summary/post.md)

---

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