API Reference
The Snipara REST API is the primary interface for apps, integrators, backends, and pipelines. Use it for product workflows that need stable auth, bulk upload, sync, health, analytics, and lifecycle operations.
Authentication
Snipara supports two authentication methods:
API Keys (Recommended)
Generate an API key from your Snipara settings with access to the target project. Include it in the X-API-Key header:
curl -H "X-API-Key: snp-xxx" https://api.snipara.com/...Recommended
The X-API-Key header is the preferred authentication method for MCP endpoints.
Session Authentication
When making requests from the browser while logged in, session cookies are automatically included. This is used by the dashboard.
Base URL
https://www.snipara.com/apiCanonical API origin
Use https://www.snipara.com/api for REST endpoints. Avoid posting to snipara.com because redirects can break non-GET requests. Hosted MCP clients normally connect to https://api.snipara.com/mcp/YOUR_PROJECT_SLUG or the app proxy shown below.
API Endpoints
Project Identifiers
All endpoints that accept :projectSlug also accept the human-readable project slug (e.g., my-project). Use whichever is more convenient for your use case.
| Endpoint | Description | Documentation |
|---|---|---|
/projects | Create, list, update, and delete projects | View Below |
/projects/:slug/documents | Manage documents within a project | View Below |
/billing | Manage subscriptions and view usage | View Below |
POST /api/mcp/:projectIdOrSlug | Web app MCP proxy for context queries (supports ID or slug) | View Docs |
/v1/partners/business-workspaces | Provision Team/Enterprise business workspaces for partner-owned frontends | View Below |
Projects API
List Projects
GET /api/projectsReturns a list of all projects you have access to.
Response
{ "projects": [ { "id": "proj_abc123", "name": "My Documentation", "documentCount": 42, "createdAt": "2024-01-15T10:30:00Z" } ]}Create Project
POST /api/projectsRequest Body
{ "name": "My New Project", "description": "Current project context.", "businessLifecycle": "ACTIVE_CLIENT"}Partner-backed project workflows can set businessLifecycle to ACTIVE_CLIENT, REFERENCE_ARCHIVE, or INTERNAL_BUSINESS. Direct Snipara dashboard projects stay focused on developer and repository context.
Partner Business Workspaces API
Approved partner backends can provision customer workspaces while keeping their own frontend and commercial UX. Snipara remains the backend source of truth for the real team, users, projects, context, and service-account MCP access.
Backend-only keys
Partner keys start with snp-int- and must stay on the partner backend. Send them with Authorization: Bearer or X-API-Key.
Provision Workspace
POST /api/v1/partners/business-workspacesRequired Scope
business_workspaces:write
Request Body
{ "external_workspace_id": "acme-prod", "external_customer_id": "cust_acme", "name": "Acme", "owner_email": "owner@acme.com", "plan": "TEAM", "seat_limit": 5}plan accepts TEAM or ENTERPRISE. workspaceIdin child routes accepts either Snipara's workspace ID or the partner's external_workspace_id.
Workspace Operations
| Endpoint | Scope | Purpose |
|---|---|---|
GET /api/v1/partners/business-workspaces | business_workspaces:read | List workspaces with status, customer ID, limit, and offset filters |
GET/PATCH /api/v1/partners/business-workspaces/:workspaceId | business_workspaces:read/write | Resolve a workspace or change status to ACTIVE, SUSPENDED, or ARCHIVED |
GET/POST /api/v1/partners/business-workspaces/:workspaceId/users | business_workspaces:read / business_users:write | List users or add/update OWNER, ADMIN, and MEMBER roles |
GET/POST /api/v1/partners/business-workspaces/:workspaceId/projects | business_workspaces:read / business_projects:write | Create and list partner-managed project context spaces |
GET/POST /api/v1/partners/business-workspaces/:workspaceId/service-accounts | business_workspaces:read / business_service_accounts:write | Create backend bot keys with explicit per-project grants |
Create Project-Scoped Service Account
POST /api/v1/partners/business-workspaces/:workspaceId/service-accounts{ "name": "CI", "project_access": [ { "project_id": "project_1", "access_level": "EDITOR" } ]}The raw snp-bot- key is returned only once. Service account keys never imply global workspace access; every project must have an explicit VIEWER, EDITOR, or ADMIN grant.
Documents API
Upload Document
POST /api/projects/:projectId/documentsRequest Body
{ "path": "docs/getting-started.md", "content": "# Getting Started\n\nWelcome to..."}The path field is used as both the document identifier and display name. Uploading to an existing path will update that document.
List Documents
GET /api/projects/:projectId/documentsDelete Document
DELETE /api/projects/:projectId/documents/:documentIdBilling API
Get Usage
GET /api/billing/usageResponse
{ "plan": "pro", "queriesUsed": 1250, "queriesLimit": 10000, "periodStart": "2024-01-01T00:00:00Z", "periodEnd": "2024-01-31T23:59:59Z"}Manage Subscription
POST /api/billing/portalReturns a URL to the Stripe Customer Portal where users can manage their subscription, update payment methods, and view invoices.
Error Responses
All API errors follow a consistent format:
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key", "status": 401 }}Common Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body or parameters |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
| 403 | FORBIDDEN | Access denied to this resource |
| 404 | NOT_FOUND | Resource not found |
| 402 | INSUFFICIENT_CREDITS | Query limit exceeded for current plan |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
Rate Limits
API rate limits vary by plan:
| Plan | Requests/minute | Monthly queries |
|---|---|---|
| Free | 30 | 1,000 |
| Pro | 120 | 10,000 |
| Team | 300 | 50,000 |
| Enterprise | Custom | 500,000 fair use |