API Documentation
Complete reference for Content Hub's self-serve REST API
Authentication
All API requests require an API key. Include your key in the Authorization header. Generate and manage keys from your account settings.
Headers
Authorization: Bearer your_api_key_hereImportant: Keep your API keys secure and never expose them in client-side code or public repositories.
Base URL
https://contenhub.co/apiList Pages
GETGET /api/contentRetrieve all pages belonging to your account. Supports optional filtering and pagination.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Number of results to return (default: 20) |
| offset | integer | Pagination offset |
Example Request
curl -X GET "https://contenhub.co/api/content?limit=20" \ -H "Authorization: Bearer your_api_key_here"
Create Page
POSTPOST /api/contentCreate a new landing page. You do not need to provide a domain — Content Hub automatically assigns the page to the most appropriate domains in our network.
Request Body
{
"title": "Get a Free Quote",
"content": "Page content here",
"slug": "free-quote",
"meta_description": "Request a free quote today",
"cta": {
"type": "button",
"label": "Request Quote",
"url": "https://example.com/quote"
}
}Example Request
curl -X POST "https://contenhub.co/api/content" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "Get a Free Quote",
"content": "Tell us what you need.",
"slug": "free-quote",
"cta": { "type": "button", "label": "Request Quote", "url": "https://example.com/quote" }
}'Update Page
PUTPUT /api/content/:idUpdate an existing page. Send only the fields you want to change.
Example Request
curl -X PUT "https://contenhub.co/api/content/page-id-123" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"title": "Updated Title"}'Delete Page
DELETEDELETE /api/content/:idDelete a page permanently.
Example Request
curl -X DELETE "https://contenhub.co/api/content/page-id-123" \ -H "Authorization: Bearer your_api_key_here"
Submit Analytics Event
POSTPOST /api/analytics/viewRecord a page view or interaction event.
Request Body
{
"pageId": "page-id-123",
"timestamp": "2026-07-13T12:00:00Z"
}Example Request
curl -X POST "https://contenhub.co/api/analytics/view" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"pageId": "page-id-123", "timestamp": "2026-07-13T12:00:00Z"}'Error Codes
| Status Code | Error Type | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters or malformed data |
| 401 | Unauthorized | Invalid or missing API key |
| 404 | Not Found | Requested page or resource was not found |
| 429 | Too Many Requests | Rate limit exceeded. Check your plan limits |
| 500 | Internal Server Error | Server error occurred. Please try again later |
Rate Limits
API rate limits vary by plan. Rate limit headers are included in all responses.
Response Headers
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 999 X-RateLimit-Reset: 1632093600