Skip to content

Item ​

Single contribution (content entry) operations.

Routes ​

MethodPathAuthDescription
GET/api/item/:idBearerGet single contribution
POST/api/item/:idJWTUpdate a contribution
PATCH/api/item/:idJWTPartially update a contribution
PUT/api/item/:chapter?JWTCreate a new contribution
DELETE/api/item/:idJWTDelete a contribution

/api/collection/:any/:id is an alias for /api/item/:id (GET, POST, PATCH, DELETE).

All write routes accept either application/json or multipart/form-data. Use multipart whenever binaries are sent to a Bild field — see File Uploads.

Get Single Item ​

GET /api/item/:id?query=<JSON>

The query parameter supports:

ParameterTypeDefaultDescription
whereobject—Must contain id
depthnumber1Levels of references resolved in relation fields (0–3)
schemabooleanfalseReturn JSON Schema
typestring—Set to "ts" to return TypeScript types instead of JSON Schema (requires schema: true)
metabooleanfalseMetadata only
referencedboolean/objectfalseInclude the referencing contributions: true or {depth, limit}, see Referenced
limitnumber1000Only limits referenced (unless referenced.limit is set)
fieldsarrayallField selection

Example ​

bash
curl http://localhost:8080/api/item/42 \
  -H "Authorization: Bearer API_KEY"
bash
# With depth and field selection
curl -G http://localhost:8080/api/item/42 \
  -H "Authorization: Bearer API_KEY" \
  --data-urlencode 'query={"where":{"id":42},"depth":2,"fields":["Title","Body"]}'
bash
# The first 20 contributions referencing item 42, with their fields
curl -G http://localhost:8080/api/item/42 \
  -H "Authorization: Bearer API_KEY" \
  --data-urlencode 'query={"referenced":{"depth":1,"limit":20}}'

The response contains id, name, sort (number or null) and fields. With meta: true, created, lastmodified, status, config, book, chapter, issue and template are added. With referenced, referenced and referencedCount are added (see Referenced).

fields are ordered like the template definition (field sort, then field id). Relation fields (TypologySelect) list their items in the order they were stored; referenced entries are ordered by the referencing contribution, then by field.

Create Item (PUT) ​

PUT /api/item/:chapter?

Creates a contribution with one data row per template field. The chapter comes from the URL or from chapter in the body. Fields not present in fields are created empty.

Response: {"status": "ok", "id": 123, "name": "..."}

Body ​

FieldTypeRequiredDescription
namestringYesDisplay name
sortnumberNoSort order
statusenum: Close, Draft, Open, Deleted, close, draft, open, deletedNoStatus value
creatednumberNoCreation timestamp (unix)
lastmodifiednumberNoLast modified timestamp (unix)
configobjectNoConfiguration object
chapterobjectnumberstring
bookobjectnumberstring
issueobjectnumberstring
templateobjectnumberstring
fieldsobjectNoField values (keyed by field name)

Example ​

bash
curl -X PUT http://localhost:8080/api/item/1 \
  -H "Authorization: Bearer JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "New Entry", "template": "Article", "fields": {"Title": "Hello"}}'
bash
# With an image upload
curl -X PUT http://localhost:8080/api/item/1 \
  -H "Authorization: Bearer JWT_TOKEN" \
  -F 'payload={"name": "New Entry", "fields": {"Title": "Hello", "Image": [{"key": "photo.jpg", "action": "upload", "captions": ["A caption"]}]}}' \
  -F "files=@./photo.jpg"

Update Item (POST) ​

POST /api/item/:id

Complete update: fields must contain every field of the template, otherwise the request is rejected. For Bild fields, assets not mentioned in the field value are kept (see File Uploads).

Response: {"status": "ok", "id": 42, "name": "...", "payload": {<updated fields>}} — payload contains the serialized value of every field that was written, including the final asset URLs of uploads.

Body ​

FieldTypeRequiredDescription
idnumberNoEntity ID
sortnumberNoSort order
namestringYesDisplay name
creatednumberNoCreation timestamp (unix)
lastmodifiednumberNoLast modified timestamp (unix)
statusenum: Close, Draft, Open, Deleted, close, draft, open, deletedYesStatus value
configobjectYesConfiguration object
chapternumberstringYes
issuenumberstringNo
templatenumberstringYes
fieldsobjectYesField values (keyed by field name)

Example ​

bash
curl -X POST http://localhost:8080/api/item/42 \
  -H "Authorization: Bearer JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Title", "fields": {"Title": "New Title"}, "status": "Open"}'

Partial Update (PATCH) ​

PATCH /api/item/:id

Only the fields present in fields are touched. Same response shape as POST.

Body ​

FieldTypeRequiredDescription
idnumberNoEntity ID
namestringNoDisplay name
sortnumberNoSort order
statusenum: Close, Draft, Open, Deleted, close, draft, open, deletedNoStatus value
configobjectNoConfiguration object
chapternumberstringNo
issuenumberstringNo
templatenumberstringNo
fieldsobjectNoField values (keyed by field name)

Example ​

bash
# Upload a new image, rename the caption of an existing one, delete another
curl -X PATCH http://localhost:8080/api/item/42 \
  -H "Authorization: Bearer JWT_TOKEN" \
  -F 'payload={"fields": {"Image": [
        {"key": "new.jpg", "action": "upload", "captions": ["New"]},
        {"key": "existing.jpg", "action": "rename", "captions": ["Updated caption"]},
        {"key": "obsolete.jpg", "action": "delete"}
      ]}}' \
  -F "files=@./new.jpg"

Delete Item ​

DELETE /api/item/:id

Deletes the contribution and all its field data. Runs field-type delete hooks (e.g., S3 file cleanup).

Response: {"status": "ok", "affected_items": 1}