Skip to main content
POST
/
cms
Create or Update CMS Collection
curl --request POST \
  --url https://api.kardow.com/cms \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "slug": "sponsors",
  "name": "Sponsors",
  "visibility": "public",
  "schema": [
    {
      "name": "name",
      "type": "text",
      "required": true
    },
    {
      "name": "logo",
      "type": "image",
      "required": true
    },
    {
      "name": "url",
      "type": "url"
    },
    {
      "name": "tier",
      "type": "select",
      "options": [
        "bronze",
        "silver",
        "gold"
      ]
    }
  ],
  "rules": {
    "allow_public_submit": false,
    "moderation": "manual"
  }
}
'
{
  "collection": {
    "slug": "<string>",
    "name": "<string>",
    "schema": [
      {
        "name": "<string>",
        "label": "<string>",
        "required": false,
        "options": [
          "<string>"
        ],
        "max_length": 123,
        "min": 123,
        "max": 123,
        "default": "<unknown>"
      }
    ],
    "description": "<string>",
    "visibility": "public",
    "rules": {
      "allow_public_submit": false,
      "moderation": "manual",
      "sort_by": "created_at",
      "sort_dir": "desc"
    },
    "required_entitlement": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

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.

A collection is identified by its slug. POSTing the same slug twice performs an upsert — the schema, name, description, and rules are replaced.
Changing the schema of a collection that already has items does not re-validate them. Existing rows keep their stored shape; new writes are validated against the new schema.

Rules object

The optional rules field controls collection behavior:
KeyTypeDefaultPurpose
allow_public_submitbooleanfalsePermit unauthenticated POST /organization/cms/{slug}/submit.
moderation'auto' | 'manual''manual'auto = published immediately; manual = pending_review.
sort_bystringcreated_atDefault sort field for list responses.
sort_dir'asc' | 'desc''desc'Default sort direction.

Example

curl -X POST https://api.kardow.com/cms \
  -H "x-api-key: $KARDOW_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "slug": "courses",
    "name": "Courses",
    "visibility": "public",
    "schema": [
      { "name": "title",    "type": "text",     "required": true },
      { "name": "summary",  "type": "longtext", "required": true },
      { "name": "cover",    "type": "image" },
      { "name": "level",    "type": "select",   "options": ["beginner","intermediate","advanced"] },
      { "name": "duration", "type": "number" }
    ],
    "rules": { "allow_public_submit": false, "moderation": "manual" }
  }'

Authorizations

x-api-key
string
header
required

API key for authentication. Get yours from Settings > API Keys in the Kardow dashboard.

Body

application/json
slug
string
required

URL-safe identifier. ^[a-z][a-z0-9_-]{0,63}$.

name
string
required
schema
object[]
required
Maximum array length: 40
description
string
visibility
enum<string>
default:public
Available options:
public,
gated,
private
rules
object

Optional behavior flags.

required_entitlement
string | null

Response

Created or updated

collection
object