---
title: "Generate an AI analysis summary"
method: POST
path: "/ai-analysis"
tags: ["AI Analysis"]
---

# Generate an AI analysis summary

`POST /ai-analysis`

Kicks off asynchronous AI summary generation for the given resource token. Returns `202` immediately if generation was enqueued, or `200` with the existing summary if one has already been generated for the resource.

An `ai_analysis_completed` webhook is delivered once generation finishes. To receive webhooks instead of polling, see [Webhook Events](https://developer.alloy.com/public/docs/webhook-events).

## Request body

- object
  - `resource_token` string, required — Token of the resource to summarize. Accepts an Evaluation (`L-`), Journey Application (`JA-`), or Investigation (`INV-`) token.

## Response `200`

A summary already exists for this resource.

- object
  - `summary` string, required — Generated AI summary text.
  - `summary_message_uuid` string, required — UUID of the LLM message that produced the summary.
  - `created_at` string, date-time, required — ISO 8601 timestamp when the summary was first created.
  - `updated_at` string, date-time, required — ISO 8601 timestamp when the summary was last updated.
  - `resource_type` 'evaluation' | 'journey_application' | 'investigation', required — Type of resource the summary belongs to.
  - `is_stale` boolean, required — Whether the summary predates a material change to the underlying resource and may be out of date.

## Other responses

- `202` — Summary generation was enqueued.
- `400` — Invalid or missing resource_token in the request body.
- `401` — Missing or invalid credentials.
- `404` — No resource found for the provided token.
- `429` — Too many requests.

---

[API](https://skmtc.dev/alloy/apis/alloy-api.md) · [All operations](https://skmtc.dev/alloy/apis/alloy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/alloy/alloy-api/revisions/405799de4d2a/schema)
