API Reference
The ChatBlocks API lets you create, read, update, and delete pages programmatically.
Base URL
https://chatblocks.app/apiAuthentication
Most endpoints require authentication via either:
- API Key —
Authorization: Bearer cb_live_YOUR_KEY - Browser Session — Automatic cookie-based auth from the browser
See Authentication for details.
Request format
All request bodies use JSON. Set Content-Type: application/json.
Error format
Errors return a JSON object with an error field and appropriate HTTP status:
{
"error": "Invalid page spec",
"details": {
"slug": "Must be at least 2 characters"
}
}Status codes
| Code | Meaning |
|---|---|
200 | Success |
202 | Accepted (async job queued) |
400 | Bad request / validation error |
401 | Not authenticated |
404 | Not found or not owned |
409 | Idempotency conflict |
429 | Rate limit exceeded (AI generation) |
410 | Deprecated/removed endpoint |
503 | Temporary backend failure |
500 | Internal server error |
Rate limits
AI generation (prompt mode) is tiered by auth method:
- API key auth: default 60/hour
- Session auth: default 10/hour
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/page-jobs | Submit page creation job |
GET | /api/page-jobs | List page jobs |
GET | /api/page-jobs/:id | Get a page job |
POST | /api/page-jobs/bulk | Submit bulk page jobs |
GET | /api/page-jobs/:id/children | List child jobs for a batch |
POST | /api/pages | Deprecated create endpoint |
GET | /api/pages | List all pages |
GET | /api/pages/:id | Get a page |
PATCH | /api/pages/:id | Update a page |
DELETE | /api/pages/:id | Delete a page |
POST | /api/pages/:id/default | Set default page |
POST | /api/pages/bulk | Deprecated bulk create endpoint |
GET | /api/qr/:username/:slug | Generate QR code |
GET | /api/schema | Get JSON Schema |
Last updated on