---
title: "Updates the SpanAnnotation with the given ID."
method: PATCH
path: "/span/{span_id}"
tags: ["spanAnnotation"]
---

# Updates the SpanAnnotation with the given ID.

`PATCH /span/{span_id}`

## Path parameters

- `span_id` integer, required

## Request body

- SpanAnnotationUpdate
  - `code_id` integer, nullable — Code the SpanAnnotation refers to
  - `begin` integer, nullable — Begin of the SpanAnnotation in characters
  - `end` integer, nullable — End of the SpanAnnotation in characters
  - `begin_token` integer, nullable — Begin of the SpanAnnotation in tokens
  - `end_token` integer, nullable — End of the SpanAnnotation in tokens
  - `span_text` string, nullable — The SpanText the SpanAnnotation spans.

## Response `200`

Successful Response

- SpanAnnotationRead
  - `begin` integer, required — Begin of the SpanAnnotation in characters
  - `end` integer, required — End of the SpanAnnotation in characters
  - `begin_token` integer, required — Begin of the SpanAnnotation in tokens
  - `end_token` integer, required — End of the SpanAnnotation in tokens
  - `id` integer, required — ID of the SpanAnnotation
  - `text` string, required — The SpanText the SpanAnnotation spans.
  - `code_id` integer, required — Code the SpanAnnotation refers to
  - `user_id` integer, required — User the SpanAnnotation belongs to
  - `sdoc_id` integer, required — SourceDocument the SpanAnnotation refers to
  - `created` string, date-time, required — Created timestamp of the SpanAnnotation
  - `updated` string, date-time, required — Updated timestamp of the SpanAnnotation
  - `group_ids` integer[], required — The group ids this span annotations belongs to
  - `memo_ids` integer[], required — Memo IDs attached to the SpanAnnotation

## Other responses

- `422` — Validation Error

## Changes

> 73 revisions in range; 22 could not be searched.

- **2025-08-22** `53e769440a25` — 2 warning
  - removed the optional property `detail/items/ctx` from the response with the `422` status
  - removed the optional property `detail/items/input` from the response with the `422` status

[Change history](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api/changes/span/:span_id/patch.md)

---

[API](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api.md) · [All operations](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/uhh-lt/discourse-analysis-tool-suite-api/revisions/a84d27ef7a0d/schema)
