---
title: "Update the summary for an assessment"
method: PUT
path: "/api/v1/assessments/{id}/summary"
tags: ["client-api-assessment-rest-resource"]
---

# Update the summary for an assessment

`PUT /api/v1/assessments/{id}/summary`

## Request

- Base URL: `https://app.visotrust.com`
- URL: `https://app.visotrust.com/api/v1/assessments/{id}/summary`
- Auth: none declared
- TypeScript: <https://skmtc.dev/visotrust/apis/viso-trust-api-documentation/docs/api/v1/assessments/:id/summary/put.ts> (a function with typed inputs; its response is checked against the schema)

Replaces the assessment summary with an edited version, the same as editing it in the app. The generated
summary is kept: the edit is shown in its place, is recorded in the summary's edit history, and is discarded
when the summary is regenerated (which happens automatically when a new assessment completes). Only the
summary of a completed assessment that has an AI-generated summary can be edited.

Send the summary as Markdown (`format=markdown`) to have it rendered with the report's styling, or as HTML.
Either way, unsupported markup (scripts, event handlers, external stylesheets, remote images and so on) is
removed before the summary is stored. Images must be embedded as `data:` URIs.

To avoid overwriting a summary that changed after you read it, pass the `version` from the read; the update
is then rejected with 409 Conflict if the summary is no longer that version.

Returns the updated summary in the same format it was sent in.

## Path parameters

- `id` integer, required

## Request body

- UpdateAssessmentSummaryInput
  - `summary` string, required: The edited summary, in the format named by 'format'
  - `format` 'html' | 'markdown': The format 'summary' is written in. Markdown is rendered with the report's own styling; HTML is accepted as-is. Either way the content is sanitized before it is stored.
  - `version` string: The 'version' returned when the summary was read. When given, the update is rejected with 409 Conflict if the summary has changed since then (for example, because it was regenerated), instead of overwriting it.

## Response `200`

OK

- AssessmentSummaryView
  - `id` integer: The assessment's identifier
  - `summary` string: The assessment summary, as HTML by default or as Markdown when 'format=markdown' is requested
  - `version` string: Identifies this revision of the summary. Pass it back when updating the summary to have the update rejected if the summary has changed in the meantime.
  - `edited` boolean: Whether the summary has been edited since it was generated

---

[API](https://skmtc.dev/visotrust/apis/viso-trust-api-documentation.md) - [All operations](https://skmtc.dev/visotrust/apis/viso-trust-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/visotrust/apis/viso-trust-api-documentation/revisions/98c8d5d102c9?raw)
