Skip to content

One section of a document, with its text

GET
/api/v1/documents/sections
curl --request GET \
--url 'http://localhost:11044/api/v1/documents/sections?uri=example&ordinal=1&chunks=false' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

The section at ordinal in reading order, as GET /documents/outline numbers them. text is the markdown directly under that heading, or null for one that only holds other sections.

uri
required
string

The document’s uri, as GET /documents lists it

ordinal
required
integer format: int32

The section’s place in reading order, counted from 0

chunks
boolean

True to include the chunks the section was cut into, which is what search matches against

The section

Media type*/*

What GET /documents/sections answers: one heading of a stored document, with the words directly under it

object
chunks

The chunks search matches against for this section, in order. Null unless chunks=true was asked, or when the section has no words of its own

Array<object>

One chunk of a section’s words, as it was cut from the document at ingest

object
id
required

The chunk’s id in the document store

string
text
required

The chunk’s text as cut, without the provenance lines added to it for embedding

string
chunksShared

True when the section is too short to have chunks of its own, so chunks are the ones it shares with its neighbours. Null whenever chunks is

boolean
section
required

The heading at the requested ordinal

object
depth

1 for a heading directly inside the document, 2 for one inside that, and so on. Null when not recorded

integer format: int32
hasText
required

Whether it has words of its own to read. A heading can have both words and headings inside it

boolean
id
required

The section’s id: what sectionId on a POST /documents/ask source refers to

string
leaf
required

Whether it has no headings inside it

boolean
ordinal

Its place in reading order, counted from 0: the ordinal GET /documents/sections takes. Not every number is used. Null when the stored section carries none

integer format: int64
parentId

Id of what this heading sits directly inside: the enclosing heading, or the document itself for a top-level heading. Null when not recorded

string
title
required

The heading’s text

string
text

The markdown directly under this heading, as converted at ingest. Null for a heading that only holds other sections

string
uri
required

The document’s uri, as the request named it

string

No such document in the caller’s world, or no section at that ordinal

Media type*/*

A 404 from the document reader: the caller’s world holds no such document, or the document has no such section

object
error
required

What was not found, naming the uri and, for a section, the ordinal

string