Levain LabsLevain Labs
ApiWikis

Put Wiki Page

Create or update a page in the knowledge base.

Create or update a page in the knowledge base.

The supplied body replaces the page content entirely. A user_edited_at timestamp is automatically added to the page's YAML front matter so the knowledge-base maintenance agent treats user-authored sections as append-only on its next pass.

page_path must end in .md and must sit at the repo root or under entities/, concepts/, or sources/. The seeded root pages (overview.md, DESIGN.md, VOICE.md) are writable like any other page; only deleting them is restricted. The schema is managed through PUT /api/v1/wikis/{wiki_id}/schema, so CLAUDE.md is rejected here. Paths that would escape the repo (.., hidden segments) are rejected with 404.

A knowledge base that has never been accessed is provisioned by the first write, so a headless workspace can seed its context through this endpoint alone.

PUT
/api/v1/wikis/{wiki_id}/pages/{page_path}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

wiki_id*Wiki Id
Formatuuid
page_path*Page Path

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body*Body

Response Body

application/json

application/json

curl -X PUT "https://api.levainlabs.com/api/v1/wikis/497f6eca-6276-4993-bfeb-53cbbbba6f08/pages/string" \  -H "Content-Type: application/json" \  -d '{    "body": "string"  }'
{
  "path": "string",
  "byte_size": 0,
  "body": "string"
}