Documentation Sync
REST API endpoint for synchronizing documentation content from source .md files to the documentation platform.
Endpoint
Sync Documentation
Endpoint: POST /wp-json/extrachill/v1/sync/doc
Purpose: Sync documentation from source .md files to documentation platform with hash-based change detection.
Parameters:
source_file(string, required) – Source file pathtitle(string, required) – Documentation titlecontent(string, required) – Documentation contentplatform_slug(string, required) – Platform identifierslug(string, required) – Documentation page slugfilesize(integer, required) – Source file sizetimestamp(string, required) – File timestampforce(boolean, optional) – Force update if already exists (default: false)
Response – Created/Updated (HTTP 200):
{
"success": true,
"action": "created",
"id": 123
}
Response – Skipped (HTTP 200):
{
"success": true,
"action": "skipped",
"id": 123
}
Permission: Requires edit_posts capability
File: inc/routes/docs-sync-routes.php
Error Responses
Permission Denied (HTTP 403):
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": { "status": 403 }
}
Validation Error (HTTP 400):
{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): source_file",
"data": {
"status": 400,
"params": {
"source_file": "Missing parameter"
}
}
}
Dependencies
ExtraChill_Docs_Sync_Controllerclass for handling sync operations- Documentation platform integration for content storage
- Hash-based change detection to avoid unnecessary updates
Integration
Used by documentation generation agents to automatically sync .md files to the platform’s documentation system.