---
title: "Batch update annotations"
method: POST
path: "/v3/annotations/batch_update"
tags: ["Annotations"]
---

# Batch update annotations

`POST /v3/annotations/batch_update`

Batch update annotations

## Request body

- AnnotationBatchUpdate[]
  - `id` integer, required — Annotation's ID
  - `rectangles` Rectangle[] — x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles.
    - `pageIndex` integer
    - `x0` number, required
    - `y0` number, required
    - `x1` number, required
    - `y1` number, required
  - `document` string — Unique identifier for the document
  - `pageIndex` integer, nullable — The page number within the document, starting from 0.
  - `raw` string, nullable — Raw data extracted from the before any post-processing
  - `parsed` union
    - string, nullable
    - integer, nullable
    - number, nullable
    - boolean, nullable
    - object, nullable
    - AnnotationCreate[], nullable
      - `rectangles` Rectangle[] — x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles.
        - `pageIndex` integer
        - `x0` number, required
        - `y0` number, required
        - `x1` number, required
        - `y1` number, required
      - `document` string, required — Unique identifier for the document
      - `pageIndex` integer, nullable, required — The page number within the document, starting from 0.
      - `dataPoint` string — Data point's identifier
      - `field` string, nullable — Field's identifier
      - `raw` string, nullable — Raw data extracted from the before any post-processing
      - `parsed` union
        - string, nullable
        - integer, nullable
        - number, nullable
        - boolean, nullable
        - object, nullable
        - AnnotationCreate[], nullable
      - `isClientVerified` boolean — Indicates whether the data has been validated by a human
      - `parent` integer, nullable — The parent annotation's ID
      - `validationResults` ChangedValidationResults[] — The validation results created, changed or deleted as a result of creating the annotation.
        - `created` ValidationResult[] — List of validation results created during this operation.
          - `id` integer, required — Validation Result's ID
          - `annotations` integer[], required — List of annotation ids that were validated
          - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
          - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
          - `message` string, required — Message explaining why the validation failed
          - `document` string, required — Unique identifier for the document
        - `updated` ValidationResult[] — List of validation results updated during this operation.
          - `id` integer, required — Validation Result's ID
          - `annotations` integer[], required — List of annotation ids that were validated
          - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
          - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
          - `message` string, required — Message explaining why the validation failed
          - `document` string, required — Unique identifier for the document
        - `deleted` ValidationResult[] — List of validation results deleted during this operation.
          - `id` integer, required — Validation Result's ID
          - `annotations` integer[], required — List of annotation ids that were validated
          - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
          - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
          - `message` string, required — Message explaining why the validation failed
          - `document` string, required — Unique identifier for the document
  - `isClientVerified` boolean — Indicates whether the data has been validated by a human
  - `dataPoint` string — Data point's identifier
  - `parent` integer, nullable — The parent annotation's ID
  - `validationResults` ChangedValidationResults[] — The validation results created, changed or deleted as a result of updating the annotation.
    - `created` ValidationResult[] — List of validation results created during this operation.
      - `id` integer, required — Validation Result's ID
      - `annotations` integer[], required — List of annotation ids that were validated
      - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
      - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
      - `message` string, required — Message explaining why the validation failed
      - `document` string, required — Unique identifier for the document
    - `updated` ValidationResult[] — List of validation results updated during this operation.
      - `id` integer, required — Validation Result's ID
      - `annotations` integer[], required — List of annotation ids that were validated
      - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
      - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
      - `message` string, required — Message explaining why the validation failed
      - `document` string, required — Unique identifier for the document
    - `deleted` ValidationResult[] — List of validation results deleted during this operation.
      - `id` integer, required — Validation Result's ID
      - `annotations` integer[], required — List of annotation ids that were validated
      - `passed` boolean, nullable, required — Whether the validation passed or not, null if the validation was not applicable
      - `ruleSlug` string, required — The kebab-case slug of the validation rule that was applied
      - `message` string, required — Message explaining why the validation failed
      - `document` string, required — Unique identifier for the document

## Response `200`

Successfully updated annotations.

- Annotation[]
  - `id` integer, required — Annotation's ID
  - `rectangle` Rectangle, required
    - `pageIndex` integer
    - `x0` number, required
    - `y0` number, required
    - `x1` number, required
    - `y1` number, required
  - `rectangles` Rectangle[], required — x/y coordinates for the rectangles containing the data. An annotation can be contained within multiple rectangles.
    - `pageIndex` integer
    - `x0` number, required
    - `y0` number, required
    - `x1` number, required
    - `y1` number, required
  - `document` string, required — Unique identifier for the document
  - `pageIndex` integer, nullable, required — The page number within the document, starting from 0.
  - `raw` string, nullable, required — Raw data extracted from the before any post-processing
  - `confidence` number, nullable, required — The overall confidence that the model's prediction is correct
  - `classificationConfidence` number, nullable, required — The model's confidence that the text has been classified correctly
  - `textExtractionConfidence` number, nullable, required — If the document was submitted as an image, this is the confidence that the text in the image has been correctly read by the model
  - `isVerified` boolean, required — Indicates whether the data has been validated, either by a human using our validation tool or through auto-validation rules
  - `isClientVerified` boolean, required — Indicates whether the data has been validated by a human
  - `isAutoVerified` boolean, required — Indicates whether the data has been auto-validated
  - `dataPoint` string — Data point's identifier
  - `field` string, nullable — Field's identifier
  - `contentType` 'text' | 'integer' | 'float' | 'decimal' | 'date' | 'datetime' | 'daterange' | 'boolean' | 'enum' | 'location' | 'phonenumber' | 'json' | 'table' | 'expectedremuneration' | 'jobtitle' | 'language' | 'skill' | 'yearsexperience' | 'group' | 'table_deprecated' | 'url' | 'image' | 'docclf', required — The different data types of annotations
  - `parent` integer, nullable — The parent annotation's ID

## Other responses

- `400` — Bad request. If it is a validation error will contain a list of each invalid field
- `401` — Authorisation error
- `default` — UnexpectedError

---

[API](https://skmtc.net/affinda/apis/affinda-api-2.md) · [All operations](https://skmtc.net/affinda/apis/affinda-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/affinda/affinda-api-2/versions/6772e50cb58e/schema)
