---
title: "Get a context document"
method: GET
path: "/api/v1/context/{slug}"
tags: ["Context"]
---

# Get a context document

`GET /api/v1/context/{slug}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/context/{slug}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Returns the full document, including its raw markdown content, in a JSON envelope. Unknown or deleted slugs respond 404. Fetching a document records its access time.

## Path parameters

- `slug` string, required

## Response `200`

The document record, including content.

- object
  - `slug` string, required
  - `title` string, required
  - `description` string, nullable, required: One-line purpose statement for selection without fetching.
  - `kind` 'instructions' | 'knowledge' | 'record', required
  - `tags` string[], required
  - `revision` integer, required
  - `contentSize` integer, required: Raw markdown size in bytes.
  - `folderId` string, nullable, required: Folder placement; null at the organization root.
  - `path` string, nullable, required: Human-readable folder path; null at the organization root.
  - `updatedAt` string, required
  - `staffOnly` boolean, required: Visible only to the operator's team. The organization's own members and keys never see it.
  - `content` string, required: The canonical raw markdown.
  - `properties` object, required: Structured facts beside the markdown: any JSON object.
  - `links` object[], required: Projects and resources this document links to.
    - `type` 'project' | 'deployment' | 'pipeline' | 'postgres' | 'redis' | 'turso' | 'r2', required: The kind of project or resource the document links to.
    - `id` string, required: The linked project or resource id.
    - `name` string, required: The target's current name, or "Deleted" when it no longer exists.
    - `removed` boolean, required: True when the target was deleted. Replace or remove the link.
  - `createdAt` string, required
  - `createdByType` 'agent' | 'api' | 'user', required
  - `updatedByType` 'agent' | 'api' | 'user', required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
