API Overview
WNCMS provides a comprehensive RESTful API that allows you to interact with your content management system programmatically. The API enables you to create, read, update, and delete posts, pages, menus, tags, and other resources.
Base URL
All API requests should be made to:
https://your-domain.com/api/v1API Version
Current API version: v1
The version is included in the URL path to ensure backward compatibility when new versions are released.
Features
- Posts Management: Create, update, delete, and retrieve posts with advanced filtering
- Pages Management: Manage website pages
- Menus Management: Synchronize and retrieve menu structures
- Tags Management: Create and manage categories and tags
- Updates: Trigger and monitor system updates
- Flexible Authentication: Multiple authentication methods supported
- Consistent Response Format: All endpoints return standardized JSON responses
- Pagination Support: Built-in pagination for list endpoints
- Filtering & Sorting: Advanced query options for data retrieval
Quick Start
- Obtain API Token: Generate an API token from your user profile in the admin panel
- Make Your First Request: Use the token to authenticate your API calls
curl -X GET "https://your-domain.com/api/v1/posts" \
-H "Content-Type: application/json" \
-d '{"api_token": "your-api-token-here"}'- Handle the Response: All responses follow a consistent format
{
"code": 200,
"status": "success",
"message": "Successfully fetched posts",
"data": [...],
"extra": {}
}Authentication
WNCMS API supports multiple authentication methods:
- Simple Authentication: Use
api_tokenin request body or query parameters - Basic Authentication: Standard HTTP Basic Auth (where enabled)
- No Authentication: Some endpoints may be publicly accessible based on configuration
For detailed information, see Authentication.
Rate Limiting
Currently, there are no enforced rate limits on the API. However, we recommend implementing your own rate limiting on the client side to prevent excessive requests.
Response Format
All API endpoints return JSON responses with the following structure:
{
"code": 200,
"status": "success",
"message": "Description of the result",
"data": {},
"extra": {}
}For more details, see Core Concepts.
Available Resources
| Resource | Description | Endpoint |
|---|---|---|
| Posts | Manage blog posts and articles | /posts |
| Pages | Manage website pages | /pages |
| Menus | Manage navigation menus | /menus |
| Tags | Manage categories and tags | /tags |
| Websites | Manage website domains | /websites |
| Updates | System update operations | /update |
Next Steps
- Getting Started Guide - Learn how to authenticate and make your first API call
- Core Concepts - Understand response formats, pagination, and error handling
- API Reference - Detailed documentation for each endpoint
- Examples - Code examples for common use cases
Support
If you encounter any issues or have questions about the API, please:
- Check the Troubleshooting guide
- Review the Error Reference for error codes and solutions
- Contact support through the admin panel
API Status
You can check if the API is enabled in your WNCMS installation by accessing:
GET /api/v1/postsIf the API is disabled, you will receive a 403 response with the message "API access is disabled".