Appearance
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
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/templates | Bearer | List template groups |
| GET | /api/template/:id | Bearer | Get single template group |
| PUT | /api/template | JWT (admin/root) | Create a template group |
| POST | /api/template/:id | JWT (admin/root) | Update a template group |
| PATCH | /api/template/:id | JWT (admin/root) | Partially update a template group |
| DELETE | /api/template/:id | JWT (admin/root) | Delete single template group |
| DELETE | /api/templates | JWT (admin/root) | Bulk delete template groups |
List Templates
GET /api/templates?query=<JSON>Filterable Fields
| Field | Type | Operators |
|---|---|---|
chapters | string | All string operators |
rights | string | All string operators |
books | string | All string operators |
fields | string | All string operators |
id | string | All string operators |
name | string | All string operators |
Additional Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
schema | boolean | false | Return schema information |
meta | boolean | false | Metadata only |
Create Template (PUT)
PUT /api/templateBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | No | Entity ID |
sort | number | No | Sort order |
name | string | Yes | Display name |
group | string | No | Rights group name |
public | boolean | No | Publicly accessible |
help | string | No | Help text |
preview | string | No | Preview image URL |
fields | object | No | Field values (keyed by field name) |
rights | array | No | Rights assignments |
books | array | No | |
chapters | array | No |
Update Template (POST)
POST /api/template/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Entity ID |
sort | number | Yes | Sort order |
name | string | Yes | Display name |
group | string | No | Rights group name |
public | boolean | Yes | Publicly accessible |
help | string | No | Help text |
preview | string | No | Preview image URL |
fields | object | Yes | Field values (keyed by field name) |
rights | array | No | Rights assignments |
books | array | No | |
chapters | array | No |
Partial Update (PATCH)
PATCH /api/template/:idBody
| Field | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Entity ID |
sort | number | No | Sort order |
name | string | No | Display name |
group | string | No | Rights group name |
public | boolean | No | Publicly accessible |
help | string | No | Help text |
preview | string | No | Preview image URL |
fields | object | No | Field values (keyed by field name) |
rights | array | No | Rights assignments |
books | array | No | |
chapters | array | No |
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.