API Reference

The Snipara REST API allows you to manage your projects, documents, and billing programmatically. All endpoints require authentication.

Authentication

Snipara supports two authentication methods:

API Keys (Recommended)

Generate an API key from your project settings. Include it in the X-API-Key header:

curl -H "X-API-Key: rlm_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/api

Important: Use www subdomain

Always use www.snipara.com for API requests. Requests to snipara.com will redirect, which can cause issues with POST requests.

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.

EndpointDescriptionDocumentation
/projectsCreate, list, update, and delete projectsView Below
/projects/:slug/documentsManage documents within a projectView Below
/billingManage subscriptions and view usageView Below
/mcp/:projectSlugOrSlugMCP server endpoint for context queries (supports ID or slug)View Docs

Projects API

List Projects

GET /api/projects

Returns 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/projects

Request Body

{
  "name": "My New Project",
  "description": "Optional description"
}

Documents API

Upload Document

POST /api/projects/:projectId/documents

Request 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/documents

Delete Document

DELETE /api/projects/:projectId/documents/:documentId

Billing API

Get Usage

GET /api/billing/usage

Response

{
  "plan": "pro",
  "queriesUsed": 1250,
  "queriesLimit": 5000,
  "periodStart": "2024-01-01T00:00:00Z",
  "periodEnd": "2024-01-31T23:59:59Z"
}

Manage Subscription

POST /api/billing/portal

Returns 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

StatusCodeDescription
400VALIDATION_ERRORInvalid request body or parameters
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENAccess denied to this resource
404NOT_FOUNDResource not found
402INSUFFICIENT_CREDITSQuery limit exceeded for current plan
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error

Rate Limits

API rate limits vary by plan:

PlanRequests/minuteRequests/day
Free10100
Pro605,000
Team12020,000
EnterpriseCustomUnlimited

Next Steps