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).

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.