> ## Documentation Index
> Fetch the complete documentation index at: https://kardow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CMS API

> Store, validate, and serve any structured content — sponsors, courses, listings, recipes — without writing a backend.

The CMS API turns any list of structured data on your site into a managed
collection. Define a schema once, then create, update, and list items via a
single set of endpoints.

Every collection is a namespaced bucket scoped to your organization. Items
inside a collection are JSON objects validated against the collection's
schema before they are stored.

## Why use it

* **No new tables.** Add a sponsors page, a courses catalogue, or a directory
  in minutes — no migration required.
* **Validation built-in.** Each field has a type (`text`, `image`, `url`,
  `select`, `date`, …). Bad data is rejected at the API boundary.
* **Public read out of the box.** Public collections are cached at the edge
  for 60 seconds and revalidate automatically when you write.
* **Monetizable.** Pair a collection with a `payment_plan` whose `purpose` is
  `cms_item` and visitors can pay to add an entry (sponsorships,
  classifieds, featured listings, …).

## Authentication

All CMS endpoints accept an API key via the `x-api-key` header. Required
permission scopes:

| Scope       | Endpoints                           |
| ----------- | ----------------------------------- |
| `cms:read`  | `GET` endpoints                     |
| `cms:write` | `POST`, `PATCH`, `DELETE` endpoints |

Wildcard keys (`*` permission) work for every CMS endpoint.

<Info>
  Get your API key from **Dashboard → Settings → API Keys**. When creating a
  key for CMS automation, scope it to `cms:read` and `cms:write` only.
</Info>

## Field types

| Type       | Notes                                                  |
| ---------- | ------------------------------------------------------ |
| `text`     | Single-line, default max 5,000 chars.                  |
| `longtext` | Multi-line, default max 100,000 chars.                 |
| `number`   | JSON number. Use `min`/`max` for bounds.               |
| `boolean`  | `true` / `false`. Strings `"true"`/`"false"` accepted. |
| `image`    | URL or storage path (`/bucket/object.png`).            |
| `url`      | Must start with `http://` or `https://`.               |
| `select`   | Requires `options: string[]`.                          |
| `date`     | ISO 8601 timestamp.                                    |

## Quickstart

```bash theme={null}
# 1. Create a "sponsors" collection
curl -X POST https://api.kardow.com/cms \
  -H "x-api-key: $KARDOW_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "slug": "sponsors",
    "name": "Sponsors",
    "schema": [
      { "name": "name", "type": "text",  "required": true },
      { "name": "logo", "type": "image", "required": true },
      { "name": "url",  "type": "url" }
    ]
  }'

# 2. Add an item
curl -X POST https://api.kardow.com/cms/sponsors \
  -H "x-api-key: $KARDOW_API_KEY" \
  -H "content-type: application/json" \
  -d '{ "data": { "name": "Acme", "logo": "/sponsors/acme.png", "url": "https://acme.com" } }'

# 3. List items
curl https://api.kardow.com/cms/sponsors \
  -H "x-api-key: $KARDOW_API_KEY"
```
