API Reference

API Endpoints

Complete reference for all EpicContext REST API endpoints, including blocks, export, and sync.

All authenticated endpoints use the base URL https://epiccontext.com/api/v1 and require an X-API-Key header.

Blocks

List Blocks

Retrieve all blocks for a project, optionally filtered by section.

GET /projects/{projectId}/blocks
GET /projects/{projectId}/blocks?section=brand

Query Parameters:

ParameterTypeDescription
sectionstringFilter by section type (e.g., brand, product, users)
statusstringFilter by status: empty, draft, complete

Get Block by Key

Retrieve a single block by its key.

GET /projects/{projectId}/blocks/{blockKey}

Response:

{
  "data": {
    "id": "uuid",
    "key": "primary-user-persona",
    "type": "persona",
    "name": "Primary User",
    "status": "complete",
    "value": {
      "name": "Sarah",
      "description": "Product manager at a mid-size SaaS company",
      "goals": "Ship features faster with better documentation",
      "pain_points": "AI agents lack product context"
    }
  }
}

Search Blocks

Search across all blocks by text content.

GET /projects/{projectId}/blocks/search?q=persona

Export

Full Export

Export all project data as structured JSON.

GET /projects/{projectId}/export

Returns all sections and blocks in a single response, optimized for AI agent consumption.

Sync

Push content updates to your project.

POST /projects/{projectId}/sync

Request Body:

{
  "blocks": [
    {
      "key": "primary-user-persona",
      "type": "persona",
      "section": "users",
      "name": "Primary User",
      "status": "draft",
      "value": { ... }
    }
  ]
}

Public Endpoints

These endpoints do not require authentication and use a different base URL:

llms.txt

GET /api/projects/{projectId}/llms.txt

Returns the full project context in llms.txt format.

Markdown

GET /api/projects/{projectId}/markdown
GET /api/projects/{projectId}/markdown/{section}

Returns project documentation as markdown.

Context JSON

GET /api/projects/{projectId}/context

Returns structured JSON for AI consumption.

Error Codes

CodeDescription
200Success
400Bad request (invalid parameters)
401Unauthorized (missing/invalid API key)
403Forbidden (no access to project)
404Not found
429Rate limited
500Server error

Next Steps

Last updated: 2026-02-21