API Reference
Endpoints, authentication modes, plan IDs, and status values for the platform API.
Authentication
Two authentication modes, depending on the endpoint
API token (external / programmatic)
POST /api/sites/deploy authenticates with a long-lived API token: Authorization: Bearer mcapi_.... Tokens are created in Settings → API, shown only once, expire after a configurable period (30 days by default), and can be revoked at any time. Requests that fail authentication return 401; accounts without API access or an accepted agreement return 403.
Browser session (portal UI)
All other endpoints below authenticate with the signed-in browser session cookie. State-changing requests (POST, PUT, DELETE, PATCH) must also send the CSRF token — see CSRF protection. These routes are intended for the portal's own UI rather than external scripts.
Token-authenticated endpoints
For external, programmatic use with an mcapi_ API token
/api/sites/deployCreate a site programmatically with an API token (mcapi_...), bypassing Stripe checkout.
Restricted to approved customers who have accepted the API Service Agreement. Requires skipPayment: true; deployments are tracked and invoiced manually. See the API documentation for the full request/response contract.
Full request/response details and code samples are in the API documentation.
Browser-session endpoints
Used by the portal UI; require a signed-in session (plus CSRF token for mutations)
/api/sitesList your sites.
Returns { customer, sites } for the signed-in account.
/api/sites/{siteId}Get a single site.
Returns { site } including its status, domain, plan, and live_url.
/api/sites/{siteId}Delete a site (irreversible).
Owner only. Starts asynchronous cleanup and returns its status, stage, deletion_job_id, and site_id (202 while pending, 200 when completed). Does not cancel the account subscription. Site creation is locked for 24 hours after deletion.
/api/sites/{siteId}/publishPublish the latest build.
Owner or admin only. Publication can be queued; follow the portal progress and final result, then verify the public hostname. Source saves do not automatically build or publish.
/api/sites/{siteId}/exportCreate a source or currently published build export (Paid entitlement; member or higher).
Create manual exports from the site Overview. Preparation can be queued; wait for completion and download before expiry.
/api/sites/{siteId}/usageGet usage metrics for the site.
/api/billing/planChange the account plan.
Request body: { "newPlanId": "paid" | "free" }. Plans and billing cover the account. The retired site-level upgrade route returns 409 and must not be used.
/api/exportsList your data exports.
/api/billing/invoicesList invoices.
Supports limit and offset query parameters. Returns { invoices, total, limit, offset, has_more }.
/api/subscriptions/portalCreate a Stripe Customer Portal session.
Returns { url } pointing to the Stripe portal for managing payment methods and billing details.
Plan IDs and limits
Use these IDs in the planId field of the deploy endpoint (billable plans) and the upgrade endpoint
What you get with Paid
Everything in Free, plus:
- Download your website source and hosting-ready export
- Connect up to 10 custom domains (Free uses a platform subdomain)
- 500 GB/month bandwidth for traffic, vs 10 GB on Free
- 50 GB published storage, vs 2 GB on Free
- 1000 AI credits/mo, vs 100 AI credits/mo on Free
Free
free$0/month
- Custom domains0 domains
- Published storage2 GB
- Bandwidth10 GB/mo
- AI credits100 AI credits/mo
Paid
paid$15/month
- Custom domains10 domains
- Published storage50 GB
- Bandwidth500 GB/mo
- AI credits1000 AI credits/mo
The free plan is created from the dashboard; the deploy endpoint is intended for the billable plan (paid). Limits apply platform-wide and are enforced by the platform — see the pricing page for the current catalog.
Site status values
Returned in the status field of site objects
Site setup is in progress; wait for the portal result.
The site record is active; verify publication and the public hostname separately.
Site is paused (for example, after a billing lapse).
Provisioning did not complete; contact support.
Site has been deleted; no longer appears in site lists.
CSRF protection
Browser-session endpoints protect state-changing methods (POST, PUT, DELETE, PATCH) with a synchronizer-token pattern: the portal sets a csrf-token cookie, and clients must echo it back in the x-csrf-token header. The portal's own UI attaches this header automatically.
Requests authenticated with an mcapi_ API token (that is, calls to POST /api/sites/deploy) are not browser-originated and are exempt from CSRF validation — send the Authorization header only.