API Reference

Private API Reference

Saint CMS automatically generates highly optimized REST endpoints for every collection you define in your saint.config.json file.

You do not need to write any backend routing logic. The Go engine handles it all natively.

Base URL

When running locally, your Private API is available at:

http://localhost:3333/api/v1


Authentication

Unlike the Public API, the Private API has full read/write access to your database and includes draft records. Every request must include your Master API Key in the headers.

Authorization: Bearer sk_live_your_master_key_here

Fetching Data

GET /content/{collection_name}

Retrieves a list of all records (both Drafts and Published) in a specific collection.

Example Request:

// Fetching all products securely from a Next.js Server Component
const res = await fetch('http://localhost:3333/api/v1/content/product', {
  headers: {
    'Authorization': `Bearer ${process.env.SAINT_API_KEY}`
  }
});
const data = await res.json();

Response:

[
  {
    "id": "rec_8a7b6c5d",
    "title": "Mechanical Keyboard",
    "price": 120,
    "status": "Published",
    "created_at": "2026-06-25T14:35:17Z"
  }
]

Modifying Data

The Go engine automatically provisions the standard REST methods for every collection. All modification endpoints require the Authorization header and a Content-Type: application/json header.

POST /content/{collection_name}

Creates a new record. The payload should match your collection’s schema fields. The engine will auto-generate an ID if one is not provided.

PUT /content/{collection_name}?id={record_id}

Updates an existing record. The payload only needs to contain the fields you wish to update; the engine will safely merge the changes and automatically save a snapshot to the Revisions time-machine.

DELETE /content/{collection_name}?id={record_id}

Permanently deletes a record from the SQLite database. If FTS5 search indexing is enabled for the collection, the shadow search index will be instantly updated in the background.