> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/cms/json-rest-api/reference.md).

# Reference

Route index and conventions for the JSON REST API.

Complete route index for the Elements CMS JSON REST API.

### Conventions

* **Base URL:** `https://example.test/api`, or whatever the Online Editor's **API** page shows.
* Most routes live under `/cms/`.
* Requests and responses are `application/json` unless noted.
* Public read routes use the envelope documented in [Errors](/elements-docs/cms/json-rest-api/errors.md).
* Authenticated write and settings routes bridge into the Online Editor handlers and may return the editor JSON shape directly.
* JSON API access is required for every route. Without it, the API returns `402 Payment Required`.
* Authenticated routes require `Authorization: Bearer api_...`. See [Authentication and API Keys](/elements-docs/cms/json-rest-api/authentication.md).
* Public read routes can be called same-server without a key. Cross-origin clients should send an `api_...` key.

### Resource pages

* `GET /` and `GET /status` - service status and CMS app version.
* [Collections](/elements-docs/cms/json-rest-api/reference/collections.md) - list the site's content collections.
* [Items](/elements-docs/cms/json-rest-api/reference/items.md) - CRUD for content items inside a collection.
* [Resources](/elements-docs/cms/json-rest-api/reference/resources.md) - media and file management.
* [Versions](/elements-docs/cms/json-rest-api/reference/versions.md) - item revision metadata, reads, and restore routes.
* [Settings](/elements-docs/cms/json-rest-api/reference/settings.md) - theme, users, and webhooks.
* [Search and Feeds](/elements-docs/cms/json-rest-api/reference/search-and-feeds.md) - search index, tags, RSS, sitemap, and related items.

### Collection addressing

Routes that target a specific collection accept either the integer folder index or the case-insensitive label slug. These are equivalent:

```
GET /cms/collections/0/items
GET /cms/collections/blog/items
```

Slugs come from the folder label, such as `Blog Posts` becoming `blog-posts`, or from the folder-path basename.

### Item addressing

Items are stored on disk as `YYYY-MM-DD-<slug>.md` or `<slug>.md`. Item routes accept either:

* The slug alone, for example `hello-from-rest`.
* The full filename, for example `2026-04-20-hello-from-rest.md`.

Use the bare slug unless you need to target a specific dated filename.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements-docs/cms/json-rest-api/reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
