API Overview
The Syntext API provides programmatic access to manage documentation projects, trigger builds, configure search, and more.
Base URL
https://api.syntext.dev/v1
Authentication
All API requests require authentication via API key:
curl https://api.syntext.dev/v1/projects \
-H "Authorization: Bearer stx_abc12345_your_api_key"
API keys look like stx_{prefix}_{secret} and support scopes (full, build, read) — see API Keys. Create keys from the dashboard or the API.
Keep your API key secret. Never commit it to version control or expose it in client-side code.
Request Format
- Content-Type:
application/json - Accept:
application/json
curl -X POST https://api.syntext.dev/v1/projects \
-H "Authorization: Bearer stx_abc12345_..." \
-H "Content-Type: application/json" \
-d '{"name": "My Docs"}'
Response Format
All responses return JSON with consistent structure:
Success Response
{
"data": {
"id": "prj_abc123",
"name": "My Docs"
}
}
List Response
{
"data": [
{ "id": "prj_abc123", "name": "My Docs" },
{ "id": "prj_def456", "name": "API Docs" }
],
"pagination": {
"page": 1,
"pageSize": 20
}
}
See Pagination for details.
Error Response
{
"error": {
"code": "invalid_request",
"message": "The 'name' field is required",
"details": {
"field": "name",
"reason": "required"
}
}
}
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
unauthorized |
401 | Invalid or missing API key |
forbidden |
403 | API key lacks required permissions |
usage_limit_exceeded |
403 | Monthly plan limit reached |
not_found |
404 | Resource does not exist |
invalid_request |
400 | Request validation failed |
rate_limited |
429 | Too many requests |
internal_error |
500 | Server error |
See Errors for the full reference and retry guidance, and Rate Limits for limit behavior.
API Surface
| Section | What it covers |
|---|---|
| Projects | Create and manage documentation projects |
| Builds | Trigger, monitor, and cancel builds |
| Search | Query and reindex full-text search |
| Domains | Custom domain management |
| Audiences | Gated content access tiers |
| API Keys | Create, rotate, and revoke keys |
| AI Chat | The AI assistant — streaming Q&A with citations |
| Analytics | Tracking beacons + dashboard metrics |
| Webhooks | Git-triggered builds and signature verification |
| Feedback | Page and section-level visitor feedback |
| Pages & Content | Read/write MDX content programmatically |
| Collaboration | Reviews, approvals, schedules, linting, access control |
Rate Limiting
| Plan | Rate Limit |
|---|---|
| Free | 100 requests/minute |
| Pro | 1,000 requests/minute |
| Enterprise | Custom |
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1705312800
Pagination
List endpoints support pagination:
curl "https://api.syntext.dev/v1/projects?page=2&per_page=50"
| Parameter | Default | Max | Description |
|---|---|---|---|
page |
1 | — | Page number |
per_page |
20 | 100 | Items per page |
Idempotency
For POST requests, use the Idempotency-Key header to safely retry:
curl -X POST https://api.syntext.dev/v1/builds \
-H "Authorization: Bearer stx_abc12345_..." \
-H "Idempotency-Key: unique-request-id-123" \
-d '{"project_id": "prj_abc123"}'
Retrying with the same key returns the original response.
SDKs
Official SDKs for common languages:
npm install @syntext/sdk
pip install syntext
go get github.com/syntext-dev/syntext-sdk-go
API Resources
Create and manage documentation projects
Trigger and monitor builds
Query documentation content
API key management