prelo
Docs

Content API

The typed REST API humans, scripts and agents all write through.

Authentication

Every write carries a key: authorization: Bearer prelo_…. Keys have roles (viewer, author, editor, admin) and appear in the audit log by name. Published content reads anonymously; drafts and private types need a key.

Endpoints

Endpoint
What it does
GET /api/schema
The full content model — agents read this first.
GET /api/:type
List entries. Filters: ?status=draft&search=ramen&page=2&per_page=20
POST /api/:type
Create an entry. Drafts by default; “status”: “published” needs an editor credential.
GET /api/:type/:idOrSlug
Read one entry — by id or slug.
PUT /api/:type/:idOrSlug
Update. Authors edit their own drafts; editors edit anything.
DELETE /api/:type/:idOrSlug
Delete (editor and up).
GET · PUT /api/globals/:name
Read or replace a singleton global.
POST /api/media
Upload: raw bytes with an x-filename header (no multipart needed).

Drafts & preview

Drafts are visible to author-and-above credentials only — a studio session cookie or an author/editor/admin key. Enforced server-side: anonymous list responses are filtered to published (?status=draft can't leak them), and a draft's detail URL 404s for anonymous callers. In one-process mode the visitor's cookie reaches the site module, so anyone signed into the studio sees drafts on the real site — the studio editor's Preview link opens the item that way. See Embed & one process. Shareable tokenized preview links don't exist yet.

Example

await fetch("https://noodleverse.com/api/post", {
method: "POST",
headers: { authorization: "Bearer prelo_…" },
body: JSON.stringify({ title: "Our hand-pulled ramen", status: "draft" }),
});

Built for agents

$ curl https://noodleverse.com/llms.txt
# Noodleverse — powered by Prelo (prelo.dev)
- post: GET /api/post · fields: excerpt, featuredImage
- schema: GET /api/schema — the full content model

Every site serves /llms.txt — a plain-text map of the content model any agent can read before writing. Errors return {error, hint, problems} with the exact fix, and publishing still respects the key’s role.