Getting Started

Make your first ContentHub API request in under 5 minutes. You will need a ContentHub workspace account with the CLIENT_ADMIN role.

Prerequisites

  • A ContentHub workspace account
  • CLIENT_ADMIN role in your workspace (or superadmin)
  • curl or an API client like Postman or Insomnia
📬

Prefer a GUI client? Use our Postman collection.

Import the ready-to-use collection and environment — all 12 endpoints pre-wired with variables for your API key, base URL, and resource IDs.

  1. In Postman, click Import and import both files
  2. Select the ContentHub API environment from the top-right dropdown
  3. Set api_key to your key and base_url to your domain — then send any request
1

Generate an API key

  1. Open your workspace dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Give it a name (e.g., "ERP Sync") and select the scopes you need
  5. Click Create — your key is shown once. Copy it now.
Important: The full API key is shown only once immediately after creation. ContentHub stores only a secure hash of the key — we cannot retrieve it for you later. Store it in a secrets manager (e.g., AWS Secrets Manager, Vault, or a .env file).
2

Make your first request

Use the API key as a Bearer token in the Authorization header. Replace YOUR_KEY with your actual key.

bash
curl https://your-domain.com/api/v1/projects \
  -H "Authorization: Bearer uch_live_YOUR_KEY"

You should receive a response like this:

json
{
  "data": [
    {
      "id": "clxyz1234",
      "name": "Main WordPress Blog",
      "platform": "WORDPRESS",
      "language": "en",
      "active": true,
      "createdAt": "2025-01-15T10:30:00.000Z"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 20,
    "pages": 1
  }
}
3

List your products (ERP sync example)

If your API key has the products:read scope, you can list your product catalog:

bash
curl "https://your-domain.com/api/v1/products?limit=50&active=true" \
  -H "Authorization: Bearer uch_live_YOUR_KEY"

To sync a product from your ERP into ContentHub (requires products:write):

bash
curl -X POST https://your-domain.com/api/v1/products \
  -H "Authorization: Bearer uch_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Widget Pro 5000",
    "description": "Industrial-grade widget with 5-year warranty.",
    "productLink": "https://yourstore.com/products/widget-pro-5000",
    "price": 299.99,
    "discountPrice": 249.99
  }'
4

Handle errors

All errors return a consistent JSON shape. Always check the HTTP status code first, then read error.code for machine-readable details.

json
{
  "error": {
    "code": "INSUFFICIENT_SCOPE",
    "message": "Scope 'products:write' is required for this operation"
  }
}

Common error codes: UNAUTHORIZED, INVALID_KEY, KEY_REVOKED, KEY_EXPIRED, INSUFFICIENT_SCOPE, NOT_FOUND, QUOTA_EXCEEDED, VALIDATION_ERROR.

Next steps