---
title: "Replace annotation content by OCR"
method: POST
path: "/api/v1/annotations/{annotationID}/content/{nodeID}/select"
tags: ["Annotation Content"]
---

# Replace annotation content by OCR

`POST /api/v1/annotations/{annotationID}/content/{nodeID}/select`

Replace annotation content by OCR extracted from the rectangle of the document page.

When the rectangle size is unsuitable for OCR (any rectangle side is smaller than 4 px),
rectangle is extended to cover the text that overlaps with the rectangle.

## Path parameters

- `annotationID` integer, required
- `nodeID` integer, required

## Request body

- SelectRequest — Request to replace annotation content by OCR extracted from a rectangle
  - `rectangle` number[], required — Bounding box of an occurrence (left, top, right, bottom)
  - `page` string, uri, required — URL of the page of the occurrence

## Response `200`

OK

- AnnotationContent
  - `content` AnnotationContentSection[] — Represents the full content of an annotation, composed of sections and datapoints.
    - `id` integer, required — A unique ID of a given section.
    - `url` string, uri, required — URL of the section.
    - `schema_id` string, required — Reference mapping the object to the schema tree.
    - `category` 'section', required — The category of the object, which is 'section'.
    - `children` union[], required — Datapoints, multivalues and tuples that belong to the section.
      - union — Represents a datapoint, multivalue, or tuple object within the annotation content.
        - object — A container for a list of datapoints or tuples, used to represent recurring items or table rows.
          - `id` integer, required — A unique ID of a given object.
          - `url` string, uri, required — URL of a given object.
          - `schema_id` string, required — Reference mapping the object to the schema tree.
          - `category` 'multivalue', required — Type of the object.
          - `hidden` boolean — If set to true, the datapoint is not visible in the user interface, but remains stored in the database.
          - `children` union[], required
            - union — Represents a datapoint or tuple object within the multivalue context.
              - …
          - `grid` AnnotationContentGrid, required — Defines the grid structure for a multivalue object.
            - `parts` object[]
              - …
          - `time_spent` number, float, required — Time spent while actively working on a given node, in seconds.
          - `time_spent_overall` number, float, required — Total time spent while validating a given node, in seconds. Only for internal purposes.
          - `time_spent_grid` number, float, required — Total time spent while actively working on a grid, in seconds. Only for internal purposes.
          - `time_spent_grid_overall` number, float, required — Total time spent while validating a given grid, in seconds. Only for internal purposes.
        - object — A container for a set of related datapoints, representing a table row. Must be nested within a multivalue.
          - `id` integer, required — A unique ID of a given object.
          - `url` string, uri, required — URL of a given object.
          - `schema_id` string, required — Reference mapping the object to the schema tree.
          - `category` 'tuple', required — Type of the object.
          - `hidden` boolean — If set to true, the datapoint is not visible in the user interface, but remains stored in the database.
          - `children` AnnotationContentDatapoint[], required
            - `id` integer, required — A unique ID of a given object.
            - `url` string, uri, required — URL of a given object.
            - `schema_id` string, required — Reference mapping the object to the schema tree.
            - `category` 'datapoint', required — Type of the object.
            - `hidden` boolean — If set to true, the datapoint is not visible in the user interface, but remains stored in the database.
            - `content` AnnotationContentDatapointContent, required — A dictionary of the writable attributes of a given datapoint. Can be null for datapoints of type `button`.
              - …
            - `validation_sources` ValidationSource[], required — See [Validation Source](#validation-source) for details.
            - `time_spent` number, float, required — Time spent while actively working on a given node, in seconds.
            - `time_spent_overall` number, float, required — Total time spent while validating a given node, in seconds. Only for internal purposes.
            - `no_recalculation` boolean — If set to true, the datapoint's formula is not recalculated automatically. Only available for datapoint category editable formula datapoints.
        - object — A datapoint with a single value.
          - `id` integer, required — A unique ID of a given object.
          - `url` string, uri, required — URL of a given object.
          - `schema_id` string, required — Reference mapping the object to the schema tree.
          - `category` 'datapoint', required — Type of the object.
          - `hidden` boolean — If set to true, the datapoint is not visible in the user interface, but remains stored in the database.
          - `content` AnnotationContentDatapointContent, required — A dictionary of the writable attributes of a given datapoint. Can be null for datapoints of type `button`.
            - `value` string — The extracted data of a given node. Maximum length: 1500 UTF characters.
            - `normalized_value` string, nullable — Normalized value for date (in ISO 8601 format) and number fields (in JSON number format).
            - `page` integer, nullable — Number of page where the data is situated (see position).
            - `position` number[], nullable — List of the coordinates of the label box of the given node. (left, top, right, bottom)
            - `rir_text` string, nullable — The extracted text, used as a reference for data extraction models.
            - `rir_raw_text` string, nullable — Raw extracted text (only for internal purposes, may be removed in the future).
            - `rir_page` integer, nullable — The extracted page, used as a reference for data extraction models.
            - `rir_position` number[], nullable — The extracted position, used as a reference for data extraction models. (left, top, right, bottom)
            - `rir_confidence` number, float, nullable — Confidence (estimated probability) that this field was extracted correctly.
            - `connector_text` string, nullable — Text set by the connector.
            - `connector_position` number[], nullable — Position set by the connector. (left, top, right, bottom)
            - `ocr_text` string, nullable — Value extracted by OCR, if applicable. (only for internal purposes, may be removed in the future)
            - `ocr_raw_text` string, nullable — Raw value extracted by OCR, if applicable. (only for internal purposes, may be removed in the future)
            - `ocr_position` number[], nullable — OCR position, if applicable. (left, top, right, bottom) (only for internal purposes, may be removed in the future)
          - `validation_sources` ValidationSource[], required — See [Validation Source](#validation-source) for details.
          - `time_spent` number, float, required — Time spent while actively working on a given node, in seconds.
          - `time_spent_overall` number, float, required — Total time spent while validating a given node, in seconds. Only for internal purposes.
          - `no_recalculation` boolean — If set to true, the datapoint's formula is not recalculated automatically. Only available for datapoint category editable formula datapoints.

## Other responses

- `400` — Invalid input data.
- `401` — The username/password is invalid or token is invalid (e.g. expired).
- `403` — Insufficient permission, missing authentication, invalid CSRF token and similar issue.
- `404` — The specified resource was not found.
- `409` — Conflict
- `413` — Payload too large (especially for files uploaded).
- `429` — Request rate is too high, wait before sending more requests. See [Rate Limiting](/guides/overview#rate-limiting) for more details.
- `500` — Server failure while processing the request.
- `502` — Invalid response from the upstream server.
- `503` — We're temporarily offline for maintenance. Please try again later.
- `504` — Upstream server could not complete the request in time.

---

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