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.
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:
| Plan | Requests / minute |
|---|---|
| Free | 100 |
| Pro | 300 |
Every response includes headers so you can track your usage:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your per-minute limit |
X-RateLimit-Remaining | Requests remaining in the window |
X-RateLimit-Reset | Unix 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 users get 3x more API requests per minute.
Endpoints
All URLs start with https://cdox.app/api/v1. Every endpoint is read-only (GET).
| Endpoint | Description |
|---|---|
GET /me | Your user info (good for testing your key) |
GET /documents | List your documents (paginated) |
GET /documents/:id | A single document with its content |
GET /sheets | List your sheets (paginated) |
GET /sheets/:id | A single sheet with its content |
GET /folders | Your folder tree |
GET /folders/:id | A single folder with its children |
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
| Parameter | Default | Description |
|---|---|---|
page | 1 | Page number |
per_page | 50 | Results per page (max 100) |
sort | updated_at | updated_at or created_at |
order | desc | desc or asc |
folder_id | Filter 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"
}
} | Status | Code | Meaning |
|---|---|---|
401 | UNAUTHORIZED | Missing or invalid API key |
403 | EMAIL_NOT_VERIFIED | Verify your email first |
404 | NOT_FOUND | Resource doesn't exist or isn't yours |
429 | RATE_LIMITED | Too 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 HTMLBack 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}`);
}Add | python3 -m json.tool to the end of any curl command to pretty-print the JSON response.
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.