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,
    "content": "INVOICE\n\nInvoice Number: INV-2024-001\nDate: January 15, 2024\n\nBill To:\nAcme Corporation\n123 Business Street...",
    "page_numbers": [1],
    "token_count": 256
  },
  {
    "id": "aa0e8400-e29b-41d4-a716-446655440001",
    "document_id": "880e8400-e29b-41d4-a716-446655440000",
    "chunk_index": 1,
    "content": "Line Items:\n\n1. Consulting Services - $5,000\n2. Implementation - $3,000\n\nSubtotal: $8,000\nTax (10%): $800\nTotal: $8,800",
    "page_numbers": [1, 2],
    "token_count": 128
  }
]
Chunks are only available after document processing is complete (status = ready).

Chunk Properties

PropertyDescription
chunk_indexOrder of the chunk within the document
contentText content of the chunk
page_numbersPages the chunk spans
token_countToken count for the chunk content

Authorizations

Authorization
string
header
required

Personal Access Token

Path Parameters

documentId
string<uuid>
required

Response

Successful

data
object[]