Skip to Content
Prism Context Engine v1.0.3 - Now with FlexSearch & Azure OpenAI!
AdvancedAPI Reference

API Reference

Complete REST API documentation for Prism Context Engine.

Base URL

https://api.prismcontext.com/v1

Authentication

All API requests require authentication via Bearer token:

curl https://api.prismcontext.com/v1/rules \ -H "Authorization: Bearer YOUR_API_KEY"

Get your API key from DashboardSettingsAPI Keys.


Rate Limits

PlanRequests/minRequests/day
Starter601,000
Pro30010,000
Team60050,000
EnterpriseCustomCustom

Rate limit headers:

X-RateLimit-Limit: 60 X-RateLimit-Remaining: 45 X-RateLimit-Reset: 1710936000

Rules

List Rules

Get all rules for your account.

GET /rules

Query Parameters:

ParameterTypeDescription
project_idstringFilter by project
categorystringFilter by category
limitnumberResults per page (default: 20, max: 100)
offsetnumberPagination offset

Example:

curl "https://api.prismcontext.com/v1/rules?category=styling&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"

Response:

{ "data": [ { "id": "rule_abc123", "title": "Color Palette", "category": "styling", "content": "# Color Palette\n\n...", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-03-20T14:45:00Z" } ], "pagination": { "total": 45, "limit": 10, "offset": 0 } }

Get Rule

Get a single rule by ID.

GET /rules/{rule_id}

Example:

curl https://api.prismcontext.com/v1/rules/rule_abc123 \ -H "Authorization: Bearer YOUR_API_KEY"

Response:

{ "id": "rule_abc123", "title": "Color Palette", "category": "styling", "content": "# Color Palette\n\n## Primary Colors\n...", "project_id": "proj_xyz789", "tags": ["design", "colors"], "metadata": { "author": "user@example.com", "version": "1.2.0" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-03-20T14:45:00Z" }

Create Rule

Create a new rule.

POST /rules

Request Body:

{ "title": "Form Validation", "category": "architecture", "content": "# Form Validation\n\nAlways use Zod...", "project_id": "proj_xyz789", "tags": ["forms", "validation"] }

Example:

curl -X POST https://api.prismcontext.com/v1/rules \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Form Validation", "category": "architecture", "content": "# Form Validation\n\nAlways use Zod..." }'

Response:

{ "id": "rule_new456", "title": "Form Validation", "category": "architecture", "created_at": "2024-03-21T09:00:00Z" }

Update Rule

Update an existing rule.

PATCH /rules/{rule_id}

Request Body:

{ "title": "Updated Title", "content": "# Updated Content..." }

Example:

curl -X PATCH https://api.prismcontext.com/v1/rules/rule_abc123 \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content": "# Updated Content..."}'

Delete Rule

Delete a rule.

DELETE /rules/{rule_id}

Example:

curl -X DELETE https://api.prismcontext.com/v1/rules/rule_abc123 \ -H "Authorization: Bearer YOUR_API_KEY"

Search rules using natural language.

POST /search

Request Body:

{ "query": "How should I handle API errors?", "limit": 5, "threshold": 0.7, "categories": ["architecture", "testing"], "project_id": "proj_xyz789" }

Example:

curl -X POST https://api.prismcontext.com/v1/search \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "error handling patterns", "limit": 5}'

Response:

{ "results": [ { "rule_id": "rule_abc123", "title": "Error Handling", "category": "architecture", "score": 0.92, "snippet": "...always use try/catch blocks and log errors..." } ], "total": 3, "query_time_ms": 45 }

Projects

List Projects

GET /projects

Get Project

GET /projects/{project_id}

Create Project

POST /projects
{ "name": "My Web App", "description": "Main marketing website" }

Update Project

PATCH /projects/{project_id}

Delete Project

DELETE /projects/{project_id}

Brands

List Brands

GET /brands

Get Brand

GET /brands/{brand_id}

Response:

{ "id": "brand_abc123", "name": "Acme Corp", "version": "2.0.0", "colors": { "primary": { "value": "#06b6d4" }, "secondary": { "value": "#8b5cf6" } }, "typography": { "fontFamily": { "sans": "Inter", "mono": "JetBrains Mono" } } }

Create Brand

POST /brands

Update Brand

PATCH /brands/{brand_id}

Delete Brand

DELETE /brands/{brand_id}

Videos

Upload Video

POST /videos

Use multipart/form-data:

curl -X POST https://api.prismcontext.com/v1/videos \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@video.mp4" \ -F "title=Design System Tour" \ -F "project_id=proj_xyz789"

Response:

{ "id": "vid_abc123", "status": "processing", "progress": 0, "estimated_time": "3 minutes" }

Get Video Status

GET /videos/{video_id}

Response:

{ "id": "vid_abc123", "title": "Design System Tour", "status": "completed", "duration": 245, "transcript_url": "https://...", "rules_generated": 7 }

List Videos

GET /videos

Delete Video

DELETE /videos/{video_id}

Webhooks

List Webhooks

GET /webhooks

Create Webhook

POST /webhooks
{ "url": "https://your-app.com/webhook", "events": ["rule.created", "rule.updated", "rule.deleted"] }

Available Events:

EventDescription
rule.createdNew rule created
rule.updatedRule modified
rule.deletedRule deleted
project.createdNew project
brand.updatedBrand profile changed
video.completedVideo processing done

Webhook Payload

{ "event": "rule.updated", "timestamp": "2024-03-21T10:30:00Z", "data": { "rule_id": "rule_abc123", "title": "Updated Rule" } }

Delete Webhook

DELETE /webhooks/{webhook_id}

Error Handling

Error Response Format

{ "error": { "code": "validation_error", "message": "Invalid request body", "details": [ { "field": "title", "message": "Title is required" } ] } }

Error Codes

CodeHTTP StatusDescription
unauthorized401Invalid or missing API key
forbidden403Insufficient permissions
not_found404Resource not found
validation_error400Invalid request data
rate_limited429Too many requests
internal_error500Server error

SDKs

JavaScript/TypeScript

npm install @prism/sdk
import { PrismClient } from '@prism/sdk'; const prism = new PrismClient({ apiKey: 'YOUR_API_KEY' }); // Get rules const rules = await prism.rules.list({ category: 'styling' }); // Search const results = await prism.search('error handling'); // Create rule const rule = await prism.rules.create({ title: 'New Rule', content: '# Content...' });

Python

pip install prism-sdk
from prism import PrismClient prism = PrismClient(api_key='YOUR_API_KEY') # Get rules rules = prism.rules.list(category='styling') # Search results = prism.search('error handling')

OpenAPI Spec

Download the full OpenAPI specification:

curl https://api.prismcontext.com/v1/openapi.json -o openapi.json

Import into Postman, Insomnia, or other API clients.


Last updated on
Prism Context EnginePrism Context Engine

The Context Operating System for developers who ship fast. Eliminate AI hallucinations with governed context rules.

Documentation

Product

Start a Project

Ready to eliminate context pollution? Let's get you started.

GET_STARTED
© 2026 Syntaxure Labs.DTI: VL1927082895984