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

# Schemas

> Manage JSON Schema definitions for frontmatter validation.

<Note>
  Enable enforcement with `[schema] enforce = true` in config. See [Schema Validation](/concepts/schemas) for the full concept.
</Note>

## List schema types

```http theme={null}
GET /api/kiwi/schemas
```

```bash theme={null}
curl 'http://localhost:3333/api/kiwi/schemas'
```

```json theme={null}
["runbook", "concept", "episode"]
```

## Get a schema

```http theme={null}
GET /api/kiwi/schemas/:type
```

<ParamField path="type" type="string" required>
  Schema type name (matches the frontmatter `type` field).
</ParamField>

```bash theme={null}
curl 'http://localhost:3333/api/kiwi/schemas/runbook'
```

Returns the raw JSON Schema document.

## Create or update a schema

```http theme={null}
PUT /api/kiwi/schemas/:type
```

<ParamField path="type" type="string" required>
  Schema type name.
</ParamField>

The request body is a raw JSON Schema document.

```bash theme={null}
curl -X PUT 'http://localhost:3333/api/kiwi/schemas/runbook' \
  -H "Content-Type: application/json" \
  -d '{
    "type": "object",
    "required": ["title", "status", "owner"],
    "properties": {
      "title": {"type": "string"},
      "status": {"type": "string", "enum": ["draft", "reviewed", "verified"]},
      "owner": {"type": "string"}
    }
  }'
```

When `[schema] enforce = true`, schema changes trigger a reload so subsequent writes use the updated schema immediately.
