Developers

Read your cDox data programmatically with the API.

Overview

The cDox API lets you read your documents, sheets, and folders programmatically. It's great for backups, integrations, or building custom tools around your data.

The API is currently read-only. Write access is coming later. This is our first public release and things may evolve, but we're committed to not breaking things without notice.

Note

This is an early-access API. The base URL is https://cdox.app/api/v1/

Getting your API key

You can generate an API key in Settings > API Key. The key starts with cdox_ and is only shown once. Copy it and keep it somewhere safe. Treat it like a password.

If you lose your key, you can regenerate a new one. This will immediately invalidate the old one.

Authentication

Send your key in the Authorization header on every request:

const response = await fetch('https://cdox.app/api/v1/me', {
  headers: {
    'Authorization': 'Bearer cdox_your_key_here'
  }
});
const { data } = await response.json();
console.log(data);

If the key is valid, you'll get your user info back. If not, you'll get a 401 error.

Rate limits

The API is rate-limited to protect the service:

PlanRequests / minute
Free100
Pro300

Every response includes headers so you can track your usage:

HeaderDescription
X-RateLimit-LimitYour per-minute limit
X-RateLimit-RemainingRequests remaining in the window
X-RateLimit-ResetUnix timestamp when the window resets

If you go over the limit, you'll get a 429 Too Many Requests response with a Retry-After header.

Pro

Pro users get 3x more API requests per minute.

Endpoints

All URLs start with https://cdox.app/api/v1. Every endpoint is read-only (GET).

EndpointDescription
GET /meYour user info (good for testing your key)
GET /documentsList your documents (paginated)
GET /documents/:idA single document with its content
GET /sheetsList your sheets (paginated)
GET /sheets/:idA single sheet with its content
GET /foldersYour folder tree
GET /folders/:idA single folder with its children
Tip

The list endpoints (/documents, /sheets) don't include content to keep responses light. Use the single-item endpoint to get the full content.

Query parameters for lists

ParameterDefaultDescription
page1Page number
per_page50Results per page (max 100)
sortupdated_atupdated_at or created_at
orderdescdesc or asc
folder_idFilter by folder

Pagination

List endpoints return a pagination object with every response:

{
  "data": [ ... ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 127,
    "total_pages": 3
  }
}

Single-item endpoints return one object in data:

{
  "data": {
    "id": "abc-123",
    "type": "page",
    "title": "My Document",
    "content": "...",
    ...
  }
}

Errors

Errors follow a consistent format:

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Document not found"
  }
}
StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid API key
403EMAIL_NOT_VERIFIEDVerify your email first
404NOT_FOUNDResource doesn't exist or isn't yours
429RATE_LIMITEDToo many requests, slow down

Examples

List your recent documents

const response = await fetch(
  'https://cdox.app/api/v1/documents?per_page=10',
  { headers: { 'Authorization': 'Bearer cdox_your_key_here' } }
);
const { data, pagination } = await response.json();
console.log(`Page ${pagination.page} of ${pagination.total_pages}`);
data.forEach(doc => console.log(doc.title));

Get a document with its content

const response = await fetch(
  'https://cdox.app/api/v1/documents/abc-123-def',
  { headers: { 'Authorization': 'Bearer cdox_your_key_here' } }
);
const { data } = await response.json();
console.log(data.title);
console.log(data.content);       // raw editor JSON
console.log(data.html_content);  // rendered HTML

Back up all your sheets

const API_KEY = 'cdox_your_key_here';
const headers = { 'Authorization': `Bearer ${API_KEY}` };

// Fetch all sheets
const list = await fetch(
  'https://cdox.app/api/v1/sheets?per_page=100',
  { headers }
).then(r => r.json());

// Download each sheet's content
for (const sheet of list.data) {
  const full = await fetch(
    `https://cdox.app/api/v1/sheets/${sheet.id}`,
    { headers }
  ).then(r => r.json());
  console.log(`Backed up: ${full.data.title}`);
}
Tip

Add | python3 -m json.tool to the end of any curl command to pretty-print the JSON response.

Note

The API is in early access and will evolve over time. Write access will be added in a future update. If you have feedback or requests, don't hesitate to reach out.