Skip to main content

API Reference

The Raven Docs REST API gives you full programmatic access to your workspace.

Base URL

http://localhost:3000/api

For production deployments with a custom domain:

https://your-domain.com/api

Authentication

All API requests require an API key passed in the header:

curl http://localhost:3000/api/workspaces \
-H "Authorization: Bearer YOUR_API_KEY"

See Authentication for details on getting an API key.

Request Format

Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY
Content-TypeFor POST/PUTapplication/json

Query Parameters

List endpoints support pagination and filtering:

GET /v1/pages?workspaceId=ws_123&limit=20&page=1
ParameterTypeDescription
limitnumberItems per page (default: 20, max: 100)
pagenumberPage number (default: 1)

Response Format

All responses are JSON:

{
"data": { ... },
"meta": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
}

Success Responses

StatusDescription
200 OKRequest successful
201 CreatedResource created
204 No ContentDelete successful

Error Responses

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Title is required",
"details": {
"field": "title",
"reason": "required"
}
}
}

See Errors for all error codes.

Endpoints

Workspaces

MethodEndpointDescription
GET/workspacesList workspaces
GET/workspaces/:idGet workspace
POST/workspacesCreate workspace
PUT/workspaces/:idUpdate workspace

Workspaces Reference →

Spaces

MethodEndpointDescription
GET/spacesList spaces
GET/spaces/:idGet space
POST/spacesCreate space
PUT/spaces/:idUpdate space
DELETE/spaces/:idDelete space

Spaces Reference →

Pages

MethodEndpointDescription
GET/pagesList pages
GET/pages/:idGet page
POST/pagesCreate page
PUT/pages/:idUpdate page
DELETE/pages/:idDelete page

Pages Reference →

Tasks

MethodEndpointDescription
GET/tasksList tasks
GET/tasks/:idGet task
POST/tasksCreate task
PUT/tasks/:idUpdate task
DELETE/tasks/:idDelete task

Tasks Reference →

SDK

TypeScript/JavaScript

npm install @raven-docs/sdk
import { RavenDocs } from '@raven-docs/sdk';

const client = new RavenDocs({
apiKey: process.env.RAVEN_API_KEY,
});

// List pages
const pages = await client.pages.list({
workspaceId: 'ws_123',
spaceId: 'space_456',
});

// Create a page
const page = await client.pages.create({
workspaceId: 'ws_123',
spaceId: 'space_456',
title: 'New Page',
content: { type: 'doc', content: [] },
});

Python (Coming Soon)

from ravendocs import RavenDocs

client = RavenDocs(api_key="your-api-key")

pages = client.pages.list(workspace_id="ws_123")

Rate Limits

Rate limits can be configured in your environment. Default limits:

ScopeRequests/minute
Default60

See Rate Limits for configuration options.

Webhooks

Subscribe to events via webhooks:

// Configure in dashboard or via API
await client.webhooks.create({
url: 'https://your-server.com/webhooks/raven',
events: ['page.created', 'task.completed'],
});