Annotation Content

Update annotation content

Changed on

Update annotation content. The format is the same as for GET. Datapoints missing from the payload keep their previous values.

For multivalue (table) datapoints, rows in the payload are matched to existing rows by position: extra rows in the payload are appended, and existing rows beyond the end of the payload are removed. Within a row:

  • For an existing row, columns missing from the payload keep their previous values.
  • For a newly appended row, columns missing from the payload are filled from the schema's default_value (and remain empty if the schema declares no default).
patch/api/v1/annotations/{annotationID}/content

Request

Path parameters

annotationIDinteger required

Annotation ID

Request body

Example request

{
  "content": [
    {
      "id": 197466,
      "url": "https://example.rossum.app/api/v1/annotations/319668/content/197466",
      "schema_id": "invoice_info_section",
      "children": [
        {
          "id": 27801933,
          "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
          "schema_id": "some_id",
          "children": [
            {
              "id": 27801933,
              "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
              "schema_id": "some_id",
              "children": [
                {
                  "id": 27801933,
                  "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
                  "schema_id": "some_id",
                  "content": {
                    "value": "8/12/24",
                    "normalized_value": "12-08-2024",
                    "page": 1,
                    "position": [
                      202.3,
                      100.1,
                      110.442,
                      110
                    ],
                    "rir_text": "8/12/24",
                    "rir_raw_text": "8/I2/24",
                    "rir_page": 1,
                    "rir_position": [
                      202.3,
                      100.1,
                      110.442,
                      110
                    ],
                    "rir_confidence": 0.954233451,
                    "connector_text": "8/I2/24",
                    "connector_position": [
                      200,
                      100,
                      110,
                      110
                    ],
                    "ocr_text": null,
                    "ocr_raw_text": null,
                    "ocr_position": null
                  },
                  "validation_sources": [
                    "score"
                  ]
                }
              ]
            }
          ],
          "grid": {
            "parts": [
              {
                "page": 1,
                "columns": [
                  {
                    "left_position": 12.1,
                    "schema_id": "item_description",
                    "header_texts": [
                      "Item description"
                    ]
                  }
                ],
                "rows": [
                  {
                    "top_position": 112.29,
                    "tuple_id": 1,
                    "type": "data"
                  }
                ],
                "width": 123.2,
                "height": 513.2
              }
            ]
          }
        }
      ]
    }
  ]
}

Response

OK

Example response

{
  "content": [
    {
      "id": 197466,
      "url": "https://example.rossum.app/api/v1/annotations/319668/content/197466",
      "schema_id": "invoice_info_section",
      "children": [
        {
          "id": 27801933,
          "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
          "schema_id": "some_id",
          "children": [
            {
              "id": 27801933,
              "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
              "schema_id": "some_id",
              "children": [
                {
                  "id": 27801933,
                  "url": "https://example.rossum.app/api/v1/annotations/319668/content/27801933",
                  "schema_id": "some_id",
                  "content": {
                    "value": "8/12/24",
                    "normalized_value": "12-08-2024",
                    "page": 1,
                    "position": [
                      202.3,
                      100.1,
                      110.442,
                      110
                    ],
                    "rir_text": "8/12/24",
                    "rir_raw_text": "8/I2/24",
                    "rir_page": 1,
                    "rir_position": [
                      202.3,
                      100.1,
                      110.442,
                      110
                    ],
                    "rir_confidence": 0.954233451,
                    "connector_text": "8/I2/24",
                    "connector_position": [
                      200,
                      100,
                      110,
                      110
                    ],
                    "ocr_text": null,
                    "ocr_raw_text": null,
                    "ocr_position": null
                  },
                  "validation_sources": [
                    "score"
                  ]
                }
              ]
            }
          ],
          "grid": {
            "parts": [
              {
                "page": 1,
                "columns": [
                  {
                    "left_position": 12.1,
                    "schema_id": "item_description",
                    "header_texts": [
                      "Item description"
                    ]
                  }
                ],
                "rows": [
                  {
                    "top_position": 112.29,
                    "tuple_id": 1,
                    "type": "data"
                  }
                ],
                "width": 123.2,
                "height": 513.2
              }
            ]
          }
        }
      ]
    }
  ]
}

Changes

    • breaking

      added subschema #2 to the / request property allOf list

    • breaking

      the / request property type changed from object to no type

    • breaking

      the / response's property type changed from object to no type for status

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      added subschema #2 to the / response property allOf list for the response status