Skip to content

Chapters ​

Chapters (sections) within books. Contributions are assigned to a chapter.

Note: The database entity is called Formats. The API uses the name "chapter" for clarity.

Routes ​

MethodPathAuthDescription
GET/api/chapters/:forBook?BearerList chapters (optionally filtered by book ID)
GET/api/chapter/:idBearerGet single chapter
PUT/api/chapterJWT (admin/root)Create a chapter
POST/api/chapter/:idJWT (admin/root)Update a chapter
PATCH/api/chapter/:idJWT (admin/root)Partially update a chapter
DELETE/api/chapter/:idJWT (admin/root)Delete a chapter (cascades to contributions)

List Chapters ​

GET /api/chapters?query=<JSON>
GET /api/chapters/:forBook?query=<JSON>

The optional :forBook path parameter filters chapters by book ID.

Filterable Fields ​

FieldTypeOperators
idnumberAll numeric operators
forbooknumberAll numeric operators
namestringAll string operators

Example ​

bash
# List chapters for book 1, sorted by sort order
curl -G http://localhost:8080/api/chapters/1 \
  -H "Authorization: Bearer API_KEY" \
  --data-urlencode 'query={"sort":"sort"}'

Create Chapter (PUT) ​

PUT /api/chapter

Body ​

FieldTypeRequiredDescription
namestringYesDisplay name
idnumberNoEntity ID
sortnumberNoSort order
settingsobjectNoConfiguration object
localesobjectNoLocale settings
rightsarrayNoRights assignments
bookbookpatchBookPatchParamsYesParent book (id or name)

Update Chapter (POST) ​

POST /api/chapter/:id

Body ​

FieldTypeRequiredDescription
namestringYesDisplay name
idnumberNoEntity ID
sortnumberYesSort order
settingsobjectYesConfiguration object
localesobjectYesLocale settings
rightsarrayYesRights assignments
bookbookpatchBookPatchParamsYesParent book (id or name)

Partial Update (PATCH) ​

PATCH /api/chapter/:id

Body ​

FieldTypeRequiredDescription
namestringNoDisplay name
idnumberNoEntity ID
sortnumberNoSort order
settingsobjectNoConfiguration object
localesobjectNoLocale settings
rightsarrayNoRights assignments
bookbookpatchBookPatchParamsNoParent book (id or name)

Delete Chapter ​

DELETE /api/chapter/:id

Cascades: Deletes all contributions within this chapter.