Context

Create a context document

Creates a markdown document from title, kind, and content, with optional slug, description, and tags. The slug is derived from the title when omitted and is immutable after creation; a collision with an active document responds 409. Limit violations respond 422 with the limit name, maximum, and submitted value.

post/api/v1/context

Request

  • Base URL
    https://app.khotan.com
  • URL
    https://app.khotan.com/api/v1/context
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Request body

titlestring required
kind'instructions' | 'knowledge' | 'record' required

"instructions" = procedures to follow (SOPs, runbooks); "knowledge" = reference material (specs, policies); "record" = accounts of events (meeting notes, transcripts, interviews).

contentstring required

Canonical raw markdown (max 256 KB, enforced by the domain layer).

slugstring

Derived from the title when omitted; conflicts return 409.

descriptionstring

One-line purpose statement powering the manifest listing (max 200 characters, enforced by the domain layer).

tagsstring[]

Flat tag list; express hierarchy with naming conventions like "ops/runbook/deploy".

propertiesobject

Structured facts beside the markdown: any JSON object.

folderIdstring nullable

Folder placement; omit or null for the organization root.

Response

The created document, including its content.

slugstring required
titlestring required
descriptionstring nullable required

One-line purpose statement for selection without fetching.

kind'instructions' | 'knowledge' | 'record' required
tagsstring[] required
revisioninteger required
contentSizeinteger required

Raw markdown size in bytes.

folderIdstring nullable required

Folder placement; null at the organization root.

pathstring nullable required

Human-readable folder path; null at the organization root.

updatedAtstring required
staffOnlyboolean required

Visible only to the operator's team. The organization's own members and keys never see it.

contentstring required

The canonical raw markdown.

propertiesobject required

Structured facts beside the markdown: any JSON object.

createdAtstring required
createdByType'agent' | 'api' | 'user' required
updatedByType'agent' | 'api' | 'user' required

Changes

No recorded changes to this operation across all 1 revision of this API.