Skip to main content
GET
/
extractions
/
documents
/
{documentId}
/
chunks
Get Document Chunks
curl --request GET \
  --url https://api.raydocs.com/extractions/documents/{documentId}/chunks \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "content": "<string>",
      "page_number": 123,
      "chunk_index": 123,
      "metadata": {}
    }
  ]
}

Authentication & Scope

Requires the sessions-read ability.

Request

GET /extractions/documents/880e8400-e29b-41d4-a716-446655440000/chunks HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
documentIduuidYesThe document ID

Response

200 OK – Array of document chunks.
[
  {
    "id": "aa0e8400-e29b-41d4-a716-446655440000",
    "document_id": "880e8400-e29b-41d4-a716-446655440000",
    "chunk_index": 0,
    "blocks": [
      {
        "block_id": "doc:page:1:block:0",
        "type": "heading",
        "content": "Invoice",
        "page_ref": "Page 1",
        "meta": {}
      },
      {
        "block_id": "doc:page:1:block:1",
        "type": "paragraph",
        "content": "Invoice Number: INV-2024-001",
        "page_ref": "Page 1",
        "meta": {}
      },
      {
        "block_id": "doc:page:1:block:2",
        "type": "table",
        "content": "",
        "page_ref": "Page 1",
        "meta": {
          "table": {
            "table_id": "page:1:table:1",
            "row_count": 3,
            "col_count": 3
          }
        }
      },
      {
        "block_id": "doc:page:1:block:3",
        "type": "table_row",
        "content": "Item | Qty | Price",
        "page_ref": "Page 1",
        "meta": {
          "table_row": {
            "table_id": "page:1:table:1",
            "is_header_row": true,
            "cells": [
              { "col_index": 1, "text": "Item" },
              { "col_index": 2, "text": "Qty" },
              { "col_index": 3, "text": "Price" }
            ]
          }
        }
      }
    ],
    "context": "Page 1",
    "visual_context": "- Chart showing quarterly revenue",
    "page_range": "Page 1"
  }
]
Chunks are only available after document processing is complete (status = ready).

Chunk Properties

PropertyDescription
chunk_indexOrder of the chunk within the document
blocksStructured array of canonical blocks
contextOptional AI-generated context prefix
visual_contextOptional markdown describing visuals
page_rangePage/slide/sheet range for the chunk

Authorizations

Authorization
string
header
required

Personal Access Token created from the Raydocs dashboard. Include in the Authorization header: Bearer <your_token> See API Keys for token creation and management.

Path Parameters

documentId
string<uuid>
required

Response

Successful

data
object[]