Skip to content

A document's sections, in reading order

GET
/api/v1/documents/outline
curl --request GET \
--url 'http://localhost:11044/api/v1/documents/outline?uri=example' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Headings only, each once: id, title, ordinal, depth and whether it has words of its own. A document ingested before sections were ordered lists none, with a message saying so.

uri
required
string

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

The outline

Media type*/*

What GET /documents/outline answers: a stored document’s headings in reading order, each listed once

object
message

Why sections is empty — the document predates section ordering and must be ingested again. Null when there are sections

string
sections
required

Every heading in reading order, each once. Empty for a document ingested before sections were ordered

Array<object>

One heading of a stored document: where it sits in the document, and what it is called

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
title

The document’s title. Null when it has none

string
uri
required

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

string

The caller’s world holds no document at that uri

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