REST API
Programmatic access to read and update your documentation through the Documentation.AI REST API.
Overview
The Documentation.AI REST API provides programmatic access to your documentation project through a standard REST interface. You can read pages, search content, manage branches, and push file changes — the same operations available in the dashboard, accessible from your own scripts, CI/CD pipelines, or backend services.
The Documentation.AI REST API and the Authoring MCP Server cover largely the same documentation-management actions through different interfaces. Use the REST API when you need direct HTTP access from scripts, backends, or CI/CD, and use the Authoring MCP Server when you are working from an MCP-compatible AI client or agent.
Prerequisites
Before using the Documentation.AI REST API, make sure you have the following:
- A Documentation.AI account on the Standard plan or above
- A published documentation project with a connected repository
- Admin access to the organization that owns the documentation project (required to create API keys)
Getting Your API Key
- Open the Documentation.AI Dashboard
- Select the documentation project you want to access
- Go to Settings → API Keys
- Click Create Key
- Choose a name, role (Viewer, Editor, or Admin), and expiration
- Copy the generated key immediately — it will only be shown once
Store your API key securely. Do not commit it to version control or expose it in client-side code. Use environment variables or a secrets manager.
If you want AI-assisted authoring instead of direct HTTP requests, use the Authoring MCP Server. This page covers the REST API.
Base URL
https://api.documentationai.app/api/v1
Authentication
All requests require an API key passed as a Bearer token in the Authorization header.
curl https://api.documentationai.app/api/v1/pages \
-H "Authorization: Bearer dai_your_api_key"
API keys are generated from the dashboard under Settings → API Keys. Each key is scoped to a single documentation project.
Roles and Permissions
Every API key carries a role that determines which endpoints are accessible.
| Role | Read endpoints | Write endpoints |
|---|---|---|
| Viewer | All read endpoints | None |
| Editor | All read endpoints | Push, branches, merge |
| Admin | All read endpoints | All write endpoints |
Write endpoints return 403 Forbidden if the API key role does not have sufficient permissions.
Rate Limiting
Each API key has a per-minute request limit configured at creation time. Rate limit information is included in every response via headers:
| Header | Description |
|---|---|
x-ratelimit-limit | Maximum requests per minute |
x-ratelimit-remaining | Requests remaining in the current window |
x-ratelimit-reset | Unix timestamp when the window resets |
retry-after | Seconds to wait before retrying (only on 429 responses) |
When the limit is exceeded, the API returns 429 Too Many Requests.
Quick Example
List all pages in your documentation:
curl https://api.documentationai.app/api/v1/pages \
-H "Authorization: Bearer dai_your_api_key"
const response = await fetch('https://api.documentationai.app/api/v1/pages', {
headers: { 'Authorization': 'Bearer dai_your_api_key' }
});
const data = await response.json();
console.log(data.pages);
import requests
response = requests.get(
'https://api.documentationai.app/api/v1/pages',
headers={'Authorization': 'Bearer dai_your_api_key'}
)
print(response.json()['pages'])
Push Changes
Create, update, or delete files in a single commit:
curl -X POST https://api.documentationai.app/api/v1/push \
-H "Authorization: Bearer dai_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"commitMessage": "Update getting started guide",
"operations": [
{
"type": "update",
"path": "getting-started/quickstart.mdx",
"content": "---
title: Quickstart
---
Updated content here."
}
]
}'
Pushing to the deployment branch (usually main) triggers a live deployment. Use a feature branch for draft changes, then merge when ready.
Endpoints
See the endpoint reference below for complete details on every available operation, including request parameters, response schemas, and examples.