REST API

Build custom integrations with the Context Pilot API. Open source, MIT licensed, self-hosted.

Context Pilot is open source under the MIT License. Full API docs and source code on GitHub. No registration required — everything runs on your own instance.

Authentication

All requests require a Bearer token. Generate tokens in Settings > API Keys.

Authorization: Bearer cp_xxxxxxxxxxxxx

Include in every request. Tokens are scoped to profiles and can be revoked anytime.

Knowledge Items

GET/api/v1/items

List all items. Supports pagination, filtering by tags, workspace, and date range.

GET/api/v1/items/:id

Get a single item by ID with content, metadata, tags, and version history.

POST/api/v1/items

Create a new item. Accepts Markdown content, tags, TTL, and metadata.

PUT/api/v1/items/:id

Update an item. Creates a new version in the history.

DELETE/api/v1/items/:id

Delete an item. Optional soft-delete with recovery period.

Assembly

POST/api/v1/assemble

Assemble context with a token budget. Returns compressed, ranked knowledge for your AI's context window.

GET/api/v1/assemble/formats

List available export formats: claude-md, copilot-md, markdown, json, zip.

Connectors

GET/api/connectors

List all 17 connectors with status, last sync time, item counts, and configuration.

GET/api/connectors/{name}/history

Sync history for a connector: timestamps, item counts, duration, and error details per run.

GET/api/connectors/health

Health dashboard: aggregated status, error counts, last successful sync, and uptime metrics.

POST/api/v1/connectors/:id/sync

Trigger an immediate sync for a specific connector.

TemplatesNEW

GET/api/templates

List all context templates with their tags, workspaces, token budget, compression, and weights.

POST/api/templates

Create a new template with name, tags, workspaces, token budget, compression, and block weights.

DELETE/api/templates/{name}

Delete a context template by name.

POST/api/templates/{name}/assemble

Assemble context using a saved template with its compression settings and block weights.

GET/api/templates/suggest

Auto-suggest templates based on query or workspace context. Returns ranked recommendations.

Profiles

GET/api/v1/profiles

List all profiles with item counts and last activity.

POST/api/v1/profiles

Create a new profile. Profiles provide isolated knowledge namespaces.

Export

POST/api/v1/export

Export your knowledge base. Formats: JSON, Markdown, ZIP. Includes metadata and history.

POST/api/v1/import

Import from a Context Pilot export file (ZIP/JSON). Merge or replace existing items.

Webhooks

GET/api/v1/webhooks

List all configured webhooks.

POST/api/v1/webhooks

Create a webhook. Events: item.created, item.updated, item.deleted, sync.completed, assembly.completed.

MCP ToolsNEW

MCP tools exposed at /sse. Use with Claude Code, VS Code, JetBrains, or any MCP client.

TOOLsearch

Search knowledge items by query, tags, or workspace.

TOOLretrieve

Retrieve a specific knowledge item by ID.

TOOLassemble

Assemble context with token budget and compression.

TOOLtag

Add or remove tags from knowledge items.

TOOLlist_templates

List all saved context templates with their configuration.

TOOLassemble_template

Assemble context using a named template with saved compression and weight settings.

TOOLsuggest_templates

Auto-suggest templates based on current query or workspace context.