Skip to content

Templates ​

Template groups (content types). Define the structure of contributions by grouping field definitions.

Note: The database entity is Templatenames. Individual field definitions are managed via Fields.

Routes ​

MethodPathAuthDescription
GET/api/templatesBearerList template groups
GET/api/template/:idBearerGet single template group
PUT/api/templateJWT (admin/root)Create a template group
POST/api/template/:idJWT (admin/root)Update a template group
PATCH/api/template/:idJWT (admin/root)Partially update a template group
DELETE/api/template/:idJWT (admin/root)Delete single template group
DELETE/api/templatesJWT (admin/root)Bulk delete template groups

List Templates ​

GET /api/templates?query=<JSON>

Filterable Fields ​

FieldTypeOperators
chaptersstringAll string operators
rightsstringAll string operators
booksstringAll string operators
fieldsstringAll string operators
idstringAll string operators
namestringAll string operators

Additional Query Parameters ​

ParameterTypeDefaultDescription
schemabooleanfalseReturn schema information
metabooleanfalseMetadata only

Create Template (PUT) ​

PUT /api/template

Body ​

FieldTypeRequiredDescription
idnumberNoEntity ID
sortnumberNoSort order
namestringYesDisplay name
groupstringNoRights group name
publicbooleanNoPublicly accessible
helpstringNoHelp text
previewstringNoPreview image URL
fieldsobjectNoField values (keyed by field name)
rightsarrayNoRights assignments
booksarrayNo
chaptersarrayNo

Update Template (POST) ​

POST /api/template/:id

Body ​

FieldTypeRequiredDescription
idnumberYesEntity ID
sortnumberYesSort order
namestringYesDisplay name
groupstringNoRights group name
publicbooleanYesPublicly accessible
helpstringNoHelp text
previewstringNoPreview image URL
fieldsobjectYesField values (keyed by field name)
rightsarrayNoRights assignments
booksarrayNo
chaptersarrayNo

Partial Update (PATCH) ​

PATCH /api/template/:id

Body ​

FieldTypeRequiredDescription
idnumberYesEntity ID
sortnumberNoSort order
namestringNoDisplay name
groupstringNoRights group name
publicbooleanNoPublicly accessible
helpstringNoHelp text
previewstringNoPreview image URL
fieldsobjectNoField values (keyed by field name)
rightsarrayNoRights assignments
booksarrayNo
chaptersarrayNo

Delete ​

Single: DELETE /api/template/:id

Bulk: DELETE /api/templates with body {"where": {"id": {"$in": [1, 2, 3]}}}

Cascades: Deletes all field definitions and associated data.