API Reference
Programmatic access to your prompts, documents, and collections through Context Repo's REST API.
Context Repo exposes a RESTful API for managing prompts, documents, collections, and search programmatically. Every endpoint requires authentication — see Authentication for setup details.
Base URL
Your API base URL is derived from your Convex deployment URL. Replace .convex.cloud with .convex.site:
https://your-deployment.convex.cloud → https://your-deployment.convex.siteAll API paths are prefixed with /v1/. For example, to list your prompts:
https://your-deployment.convex.site/v1/promptsYou can find your Convex deployment URL in the Convex dashboard under Settings > URL & Deploy Key.
Response Format
All successful responses return a JSON envelope with a data field:
{
"data": {
"id": "abc123",
"title": "My Prompt",
"description": "A helpful code review prompt"
}
}List endpoints include a pagination object alongside data:
{
"data": [
{ "id": "abc123", "title": "My Prompt" }
],
"pagination": {
"cursor": "eyIxIjoiMjAifQ==",
"hasMore": true
}
}Pass the cursor value as a query parameter on the next request to fetch the next page.
Error Format
All errors return a JSON envelope with an error object containing a numeric code and a message:
{
"error": {
"code": 401,
"message": "Invalid authentication"
}
}See the Endpoints page for the full error codes table.
CORS Policy
The API allows requests from all origins. Every response includes these headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Max-Age: 86400Preflight OPTIONS requests are handled automatically for all /v1/ paths and return a 204 No Content response with CORS headers.
Rate Limiting
All endpoints are rate-limited per user. When you exceed the limit, the API returns a 429 status with a Rate limit exceeded message. Rate limit headers are included in the response to help you manage request pacing.
What's Next
Other MCP Clients
Connect Context Repo to any MCP-compatible client using stdio, SSE, or Streamable HTTP transport. This guide covers the generic setup for clients not listed in our specific guides.
Authentication
Authenticate API requests using a Bearer JWT token from Clerk or an API key from your Context Repo dashboard.