API reference
The management API runs at https://app.wirechunk.com. This page shows common requests. Use the live OpenAPI document for the complete list of operations, fields, responses, and authentication routes.
Request conventions
Path parameters belong in the URL. Parameters for GET operations belong in the query string; other management operations use a JSON request body. Send Content-Type: application/json for JSON writes and authenticate as described in API authentication.
A stable object ID identifies a page, form, or other record across edits. A version ID identifies one saved version. Use expectedVersionId on updates when you want the server to detect a concurrent change.
PATCH merges the supplied object fields using JSON Merge Patch; arrays replace the saved arrays. PUT replaces a complete record. Save changes to the draft. Preview and publish are separate actions that check the draft automatically.
List and create sites
curl 'https://app.wirechunk.com/api/sites' \
-H "Authorization: Bearer $WIRECHUNK_ACCESS_TOKEN"
curl 'https://app.wirechunk.com/api/sites' \
-H "Authorization: Bearer $WIRECHUNK_ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"name":"Example business"}'
Listing sites returns an array of site summaries. Creating one returns a SiteSnapshot for the new draft. Neither example activates paid service.
Update a page
Read the page first and use its current saved version in your update. Replace the uppercase placeholders below with IDs returned by the API:
PATCH /api/sites/SITE_ID/pages/PAGE_ID
Authorization: Bearer ACCESS_TOKEN
Content-Type: application/json
{
"expectedVersionId": "CURRENT_VERSION_ID",
"metaDescription": "Commercial cleaning services and estimate requests."
}
The response contains actionId and object. The object is the updated saved page or post, including its new version. The example changes only the description; it does not replace the body.
Preview and publish
Preview and publish validate the draft automatically. To inspect validation results without taking either action, use:
GET /api/sites/SITE_ID/validation
The response contains valid, errors, and warnings. Each issue includes a field and message, with additional context where available.
POST /api/sites/SITE_ID/previews
Content-Type: application/json
{"path":"/"}
A successful preview response contains url and expiresAt. The URL permits temporary read-only draft access.
POST /api/sites/SITE_ID/publications
Content-Type: application/json
{}
Authenticate each request you send. Publication requires an authorized site user, a valid draft, and active site service. It releases all saved draft changes together.
Common operations
These endpoints cover the usual path from a new draft to a published site.
| Method and path | What it does |
|---|---|
GET /api/sites |
List sites you can access. |
POST /api/sites |
Create a draft site. |
GET /api/sites/{siteId} |
Read the draft or published site. |
POST /api/sites/{siteId}/pages |
Add a page or post to the draft. |
PATCH /api/sites/{siteId}/pages/{objectId} |
Update a page or post in the draft. |
POST /api/sites/{siteId}/forms |
Add a form to the draft. |
GET /api/sites/{siteId}/unpublished-changes |
Review the changes the next publication would release. |
POST /api/sites/{siteId}/previews |
Create a temporary preview URL. |
POST /api/sites/{siteId}/publications |
Validate and publish the saved draft. Active site service is required. |
Errors
Management operations return structured problem responses for validation, permission, conflict, activation, and temporary-service failures. See errors and rate limits for the response shape and retry guidance.