---
title: "Returns SpanAnnotationSearch."
method: POST
path: "/search/span_annotation"
tags: ["search"]
---

# Returns SpanAnnotationSearch.

`POST /search/span_annotation`

## Query parameters

- `project_id` integer, required
- `page` integer, nullable
- `page_size` integer, nullable

## Request body

- BodySearchSearchSpanAnnotations
  - `filter` FilterSpanColumnsInput, required
    - `id` string, required
    - `items` union[], required
      - union
        - FilterExpressionSpanColumns
          - `id` string, required
          - `column` union, required
            - 'SP_SPAN_TEXT' | 'SP_CODE_ID' | 'SP_USER_ID' | 'SP_MEMO_CONTENT' | 'SP_SOURCE_SOURCE_DOCUMENT_NAME' | 'SP_TAG_ID_LIST'
            - integer
          - `operator` union, required
            - 'ID_EQUALS' | 'ID_NOT_EQUALS'
            - 'NUMBER_EQUALS' | 'NUMBER_NOT_EQUALS' | 'NUMBER_GT' | 'NUMBER_LT' | 'NUMBER_GTE' | 'NUMBER_LTE'
            - 'STRING_CONTAINS' | 'STRING_EQUALS' | 'STRING_NOT_EQUALS' | 'STRING_STARTS_WITH' | 'STRING_ENDS_WITH'
            - 'ID_LIST_CONTAINS' | 'ID_LIST_NOT_CONTAINS'
            - 'LIST_CONTAINS' | 'LIST_NOT_CONTAINS'
            - 'DATE_EQUALS' | 'DATE_GT' | 'DATE_LT' | 'DATE_GTE' | 'DATE_LTE'
            - 'BOOLEAN_EQUALS' | 'BOOLEAN_NOT_EQUALS'
          - `value` union, required
            - boolean
            - string
            - integer
            - string[]
            - array[]
              - …
        - FilterSpanColumnsInput — recursive
    - `logic_operator` 'or' | 'and', required — This tells our filter how to combine multiple column expressions.
  - `sorts` SortSpanColumns[], required
    - `column` union, required
      - 'SP_SPAN_TEXT' | 'SP_CODE_ID' | 'SP_USER_ID' | 'SP_MEMO_CONTENT' | 'SP_SOURCE_SOURCE_DOCUMENT_NAME' | 'SP_TAG_ID_LIST'
      - integer
    - `direction` 'asc' | 'desc', required

## Response `200`

Successful Response

- SpanAnnotationSearchResult
  - `total_results` integer, required — The total number of span_annotation_ids. Used for pagination.
  - `data` SpanAnnotationRow[], required — The Annotations.
    - `id` integer, required — ID of the SpanAnnotation
    - `span_text` string, required — The SpanText the SpanAnnotation spans.
    - `code` CodeRead, required
      - `name` string, required — Name of the Code
      - `color` string, required — Color of the Code
      - `description` string, required — Description of the Code
      - `parent_id` integer, nullable — Parent of the Code
      - `enabled` boolean — While false, the code is neither created in pre-processing nor shown in the UI (except in settings to enable it again)
      - `id` integer, required — ID of the Code
      - `project_id` integer, required — Project the Code belongs to
      - `created` string, date-time, required — Created timestamp of the Code
      - `updated` string, date-time, required — Updated timestamp of the Code
      - `is_system` boolean, required — Is the Code a system code
      - `memo_ids` integer[], required — Memo IDs attached to the Code
    - `user_id` integer, required — User the SpanAnnotation belongs to
    - `sdoc` SourceDocumentRead, required
      - `filename` string, required — Filename of the SourceDocument
      - `name` string, required — User-defined name of the document (default is the filename)
      - `doctype` 'text' | 'image' | 'video' | 'audio', required
      - `project_id` integer, required — Project the SourceDocument belongs to
      - `id` integer, required — ID of the SourceDocument
      - `created` string, date-time, required — The created timestamp of the SourceDocument
      - `updated` string, date-time, required — Updated timestamp of the SourceDocument
      - `folder_id` integer, required — ID of the Folder this SourceDocument belongs to
    - `tag_ids` integer[], required — The TagIDs of the SourceDocument.
    - `memo` MemoRead, required
      - `title` string, required — Title of the Memo
      - `content` string, required — Textual content of the Memo
      - `content_json` string, required — JSON content of the Memo
      - `id` integer, required — ID of the Memo
      - `starred` boolean, required — Starred flag of the Memo
      - `user_id` integer, required — User the Memo belongs to
      - `project_id` integer, required — Project the Memo belongs to
      - `created` string, date-time, required — Created timestamp of the Memo
      - `updated` string, date-time, required — Updated timestamp of the Memo
      - `attached_object_id` integer, required — ID of the Object the Memo is attached to
      - `attached_object_type` 'source_document' | 'code' | 'sentence_annotation' | 'span_annotation' | 'span_group' | 'bbox_annotation' | 'project' | 'tag', required

## Other responses

- `422` — Validation Error

## Changes

- **2025-09-18** `c5b78916c4e5` — 2 breaking, 4 info
  - removed the enum value `SP_SOURCE_SOURCE_DOCUMENT_FILENAME` of the request property `filter/items/items/anyOf[subschema #1: FilterExpression[SpanColumns]]/column/anyOf[subschema #1: SpanColumns]/`
  - removed the enum value `SP_SOURCE_SOURCE_DOCUMENT_FILENAME` of the request property `sorts/items/column/anyOf[subschema #1: SpanColumns]/`
  - added the new `SP_SOURCE_SOURCE_DOCUMENT_NAME` enum value to the request property `filter/items/items/anyOf[subschema #1: FilterExpression[SpanColumns]]/column/anyOf[subschema #1: SpanColumns]/`
  - added the new `SP_SOURCE_SOURCE_DOCUMENT_NAME` enum value to the request property `sorts/items/column/anyOf[subschema #1: SpanColumns]/`
  - …2 more
- **2025-08-22** `53e769440a25` — 4 breaking, 2 warning, 4 info
  - removed the enum value `SP_SOURCE_SOURCE_DOCUMENT_NAME` of the request property `filter/items/items/anyOf[subschema #1: FilterExpression[SpanColumns]]/column/anyOf[subschema #1: SpanColumns]/`
  - removed the enum value `SP_SOURCE_SOURCE_DOCUMENT_NAME` of the request property `sorts/items/column/anyOf[subschema #1: SpanColumns]/`
  - the response property `data/items/sdoc/name` became optional for the status `200`
  - response property `data/items/sdoc/name` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - …6 more

[Change history](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api/changes/search/span_annotation/post.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/bf20656dfc4d/schema)
