API Reference Introduction

Welcome to the CMS API Reference documentation. This section provides comprehensive documentation for all API endpoints, request/response schemas, and authentication methods.

Overview

The CMS API is a RESTful API built with:
  • Symfony 7.4 - PHP framework
  • API Platform 3.4 - REST/GraphQL API framework
  • JSON-LD + Hydra - Semantic API responses
  • OpenAPI 3.0 - API specification standard

Base URL

https://local.api.cms

Authentication

All API requests require authentication via JWT Bearer tokens:
Authorization: Bearer YOUR_JWT_TOKEN

Required Headers

X-Tenant-Id

Specifies which tenant’s data to access:
X-Tenant-Id: tenant-uuid

X-Site-Id (Optional)

For multi-site tenants, specifies which site to access:
X-Site-Id: site-uuid

Response Format

All responses follow the JSON-LD format with Hydra context:
{
  "@context": "/contexts/Article",
  "@id": "/articles/uuid",
  "@type": "Article",
  "id": "uuid",
  "title": "Example Article",
  // ... more fields
}

Error Responses

Errors follow RFC 7807 Problem Details format:
{
  "type": "https://tools.ietf.org/html/rfc2616#section-10",
  "title": "An error occurred",
  "status": 400,
  "detail": "Validation failed",
  "violations": [
    {
      "propertyPath": "title",
      "message": "This value should not be blank."
    }
  ]
}

Rate Limiting

  • Anonymous: 100 requests per 15 minutes
  • Authenticated: 1000 requests per 15 minutes
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1234567890

Pagination

Collection endpoints support pagination:
GET /articles?page=1&itemsPerPage=30
Response includes pagination metadata:
{
  "@context": "/contexts/Article",
  "@id": "/articles",
  "@type": "hydra:Collection",
  "hydra:totalItems": 100,
  "hydra:member": [ /* items */ ],
  "hydra:view": {
    "@id": "/articles?page=1",
    "@type": "hydra:PartialCollectionView",
    "hydra:first": "/articles?page=1",
    "hydra:last": "/articles?page=4",
    "hydra:next": "/articles?page=2"
  }
}

Filtering

Use query parameters to filter collections:
GET /articles?status=published&category=/categories/uuid

Getting Started

API Endpoints

The following endpoint categories are available:
  • Articles - Create and manage blog posts
  • Pages - Create and manage static pages
  • Media - Upload and manage images/documents
  • Categories - Organize content by categories
  • Tags - Add tags to content
  • Menus - Create navigation menus
  • Blocks - Reusable content blocks
  • Settings - Site configuration
  • Users - User management (admin only)
  • Search - Full-text search across content

Next Steps

  1. Review the Authentication Guide
  2. Explore individual endpoint documentation
  3. Test endpoints using the interactive API playground
  4. Generate TypeScript types from the OpenAPI spec
This API reference is automatically generated from the OpenAPI specification. All endpoints are documented with request/response examples.