Content
Create, read, update, move, and delete artifacts -- your categories and items.
Every category, section, and content item on your site is an artifact. Categories are roots; items are their children.
| Endpoint | What it does |
|---|---|
| GET /api/v1/site/{site}/artifacts/ | List roots with their children, paginated |
| POST /api/v1/site/{site}/artifacts/ | Create an artifact, root or child |
| GET /api/v1/site/{site}/artifacts/{slug}/ | Read one artifact with its children |
| POST /api/v1/site/{site}/artifacts/{slug}/ | Update fields, or move it with parent |
| DELETE /api/v1/site/{site}/artifacts/{slug}/ | Delete it |
| PATCH /api/v1/site/{site}/content/save/ | Update named fields on one artifact |
| DELETE /api/v1/site/{site}/content/delete/ | Delete one artifact by id |
| GET /api/v1/site/{site}/artifacts/{slug}/design/ | Read the layout settings of a root |
| POST /api/v1/site/{site}/artifacts/{slug}/design/ | Set section_view, catalog_view, and templates |
Addressing an artifact
The {slug} segment resolves by name first and falls back to the 16-character generated slug, so the name you set is the key you use everywhere. The integer id in responses is what content/save/ and the mapping endpoints need.
Adding an item to a category
Request
curl -X POST \
-H "Authorization: Token $ENINE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "web-design", "title": "Web Design", "parent": "services",
"content": "We build fast, accessible sites."}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/artifacts/
Send parent or parent_pk to move an artifact later; an empty parent turns it back into a root. A name that is already used returns 409.
Changing one field
Request
curl -X PATCH \
-H "Authorization: Token $ENINE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "artifact", "pk": 2890, "fields": {"title": "Web and Product Design"}}' \
https://e9sites.com/api/v1/site/mysite.e9sites.com/content/save/
The url field in a response is read-only: it is the resolved address of whatever the artifact links to. To change where an item points, create a catalogue entry and set link -- see Links.