Introduction
The Halo CMS API is a comprehensive REST API that provides programmatic access to all aspects of your Halo instance. It follows RESTful principles and returns JSON responses, making it easy to integrate with any programming language or framework.API Architecture
Halo’s API is organized into four distinct groups, each serving different purposes:Public API
The Public API provides read-only access to publicly available content. This API is designed for building front-end applications, mobile apps, and integrations that need to display your site’s content. Base Path:/apis/api.content.halo.run/v1alpha1
Use Cases:
- Fetching published posts and pages
- Retrieving categories and tags
- Loading comments
- Building custom front-end themes
Console API
The Console API provides full administrative access to your Halo instance. This is the same API used by the Halo admin dashboard for content management, user administration, and system configuration. Base Path:/apis/api.console.halo.run/v1alpha1
Use Cases:
- Content creation and management
- User and role administration
- Plugin and theme management
- System configuration
- Attachment management
User Center API (UC)
The User Center API provides user-specific functionality, allowing authenticated users to manage their profile, notifications, and personal settings. Base Path:/apis/api.notification.halo.run/v1alpha1
Use Cases:
- Managing user profiles
- Handling notification preferences
- User-specific settings
- Personal content management
Extension API
The Extension API provides access to custom resources and endpoints defined by Halo extensions and plugins. This API allows developers to extend Halo’s functionality with custom data models and business logic. Base Path:/api/v1alpha1
Use Cases:
- Accessing custom extension resources
- Managing plugin-specific data
- Custom business logic endpoints
- Extension configuration
API Versioning
Halo uses API versioning to ensure backward compatibility and smooth upgrades. The current API version is v1alpha1.Version Format
API versions follow the Kubernetes-style versioning scheme:- v1alpha1 - Alpha release, may have breaking changes
- v1beta1 - Beta release, more stable but may have minor changes
- v1 - Stable release, backward compatible
Version in URLs
The API version is included in the URL path:Base URLs
All API requests are made to your Halo instance URL. The base URL format is:The default port for Halo is 8091 when running in development mode. In production, you’ll typically use a reverse proxy (like Nginx) on standard HTTP/HTTPS ports.
Request and Response Format
Request Format
All API requests should:- Use the appropriate HTTP method (GET, POST, PUT, DELETE, PATCH)
- Include proper authentication headers
- Send JSON payloads for POST/PUT/PATCH requests
- Set
Content-Type: application/jsonheader for requests with body
Response Format
All API responses are returned in JSON format:Common Query Parameters
Most list endpoints support the following query parameters:Page number for pagination (zero-based)
Number of items per page
Sorting criteria in the format:
property,(asc|desc). Multiple sort criteria are supported.Example: ?sort=metadata.creationTimestamp,descLabel selector for filtering resources. Uses Kubernetes-style label selectors.Example:
?labelSelector=hidden!=trueField selector for filtering by field values.Example:
?fieldSelector=metadata.name==haloError Handling
The API uses standard HTTP status codes to indicate success or failure:| Status Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful deletion) |
| 400 | Bad Request (invalid parameters) |
| 401 | Unauthorized (missing or invalid authentication) |
| 403 | Forbidden (insufficient permissions) |
| 404 | Not Found |
| 409 | Conflict (resource already exists) |
| 500 | Internal Server Error |
Error Response Format
Rate Limiting
Halo does not enforce rate limiting by default. However, you may configure rate limiting at the reverse proxy level (Nginx, Cloudflare, etc.) to protect your instance from abuse.
CORS Support
Halo supports Cross-Origin Resource Sharing (CORS) for browser-based applications. Configure CORS settings in your Halo configuration file to specify allowed origins.Next Steps
Authentication
Learn how to authenticate your API requests
Public APIs
Explore public content APIs
Console APIs
Manage your Halo instance programmatically
Extension APIs
Access custom extension endpoints