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_here

Important: Keep your API keys secure and never expose them in client-side code or public repositories.

Base URL

https://contenhub.co/api

List Pages

GET
GET /api/content

Retrieve all pages belonging to your account. Supports optional filtering and pagination.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results to return (default: 20)
offsetintegerPagination offset

Example Request

curl -X GET "https://contenhub.co/api/content?limit=20" \
  -H "Authorization: Bearer your_api_key_here"

Create Page

POST
POST /api/content

Create 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

PUT
PUT /api/content/:id

Update 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

DELETE
DELETE /api/content/:id

Delete 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

POST
POST /api/analytics/view

Record 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 CodeError TypeDescription
400Bad RequestInvalid request parameters or malformed data
401UnauthorizedInvalid or missing API key
404Not FoundRequested page or resource was not found
429Too Many RequestsRate limit exceeded. Check your plan limits
500Internal Server ErrorServer 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