Skip to main content

Summary

Extract all document content with stable IDs for RAG pipelines. Returns blocks with full text, comments, and tracked changes — each with an ID compatible with scrollToElement().
  • Operation ID: extract
  • API member path: editor.doc.extract(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns an ExtractResult with blocks (nodeId, type, text, headingLevel), comments (entityId, text, anchoredText, blockId, status, author), tracked changes (entityId, type, excerpt, author, date), and revision.

Input fields

No fields.

Example request

{}

Output fields

FieldTypeRequiredDescription
blocksobject[]yes
commentsobject[]yes
revisionstringyes
trackedChangesobject[]yes

Example response

{
  "blocks": [
    {
      "headingLevel": 1,
      "nodeId": "node-def456",
      "text": "Hello, world.",
      "type": "example"
    }
  ],
  "comments": [
    {
      "anchoredText": "example",
      "entityId": "entity-789",
      "status": "open",
      "text": "Hello, world."
    }
  ],
  "revision": "example",
  "trackedChanges": [
    {
      "author": "Jane Doe",
      "entityId": "entity-789",
      "excerpt": "Sample excerpt...",
      "type": "insert"
    }
  ]
}

Pre-apply throws

  • None

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {},
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "blocks": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "headingLevel": {
            "description": "Heading level (1–6). Only present for headings.",
            "type": "integer"
          },
          "nodeId": {
            "description": "Stable block ID — pass to scrollToElement() for navigation.",
            "type": "string"
          },
          "text": {
            "description": "Full plain text content of the block.",
            "type": "string"
          },
          "type": {
            "description": "Block type: paragraph, heading, listItem, table, image, etc.",
            "type": "string"
          }
        },
        "required": [
          "nodeId",
          "type",
          "text"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "comments": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "anchoredText": {
            "description": "The document text the comment is anchored to.",
            "type": "string"
          },
          "author": {
            "description": "Comment author name.",
            "type": "string"
          },
          "blockId": {
            "description": "Block ID the comment is anchored to.",
            "type": "string"
          },
          "entityId": {
            "description": "Comment entity ID — pass to scrollToElement() for navigation.",
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "resolved"
            ],
            "type": "string"
          },
          "text": {
            "description": "Comment body text.",
            "type": "string"
          }
        },
        "required": [
          "entityId",
          "status"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "revision": {
      "description": "Document revision at the time of extraction.",
      "type": "string"
    },
    "trackedChanges": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "author": {
            "description": "Change author name.",
            "type": "string"
          },
          "date": {
            "description": "Change date (ISO string).",
            "type": "string"
          },
          "entityId": {
            "description": "Tracked change entity ID — pass to scrollToElement() for navigation.",
            "type": "string"
          },
          "excerpt": {
            "description": "Short text excerpt of the changed content.",
            "type": "string"
          },
          "type": {
            "enum": [
              "insert",
              "delete",
              "format"
            ],
            "type": "string"
          }
        },
        "required": [
          "entityId",
          "type"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "blocks",
    "comments",
    "trackedChanges",
    "revision"
  ],
  "type": "object"
}