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).
Cancels the Stripe subscription if one exists, soft-deletes the site record, and triggers infrastructure cleanup. Returns { success, site_id, subscription_cancelled, refund }.
/api/sites/{siteId}/publishPublish the latest build.
Pushes the most recent AI-builder build live to the site hostname.
/api/sites/{siteId}/exportCreate a data export of the site.
/api/sites/{siteId}/usageGet usage metrics for the site.
/api/sites/{siteId}/upgradeChange the site plan.
Request body: { "newPlanId": "starter" | "professional" | "enterprise" | "free" }.
/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
Free
free$0/month
- Sites1 site
- Custom domains0 domains
- Published storage2 GB
- Bandwidth10 GB/mo
- AI credits5 AI credits/mo
- Content CMSNot included
Starter
starter$15/month
- Sites1 site
- Custom domains1 domain
- Published storage5 GB
- Bandwidth100 GB/mo
- AI credits30 AI credits/mo
- Content CMSIncluded
Professional
professional$49/month · recommended
- Sites1 site
- Custom domains1 domain
- Published storage50 GB
- Bandwidth500 GB/mo
- AI credits200 AI credits/mo
- Content CMSIncluded
Enterprise
enterprise$149/month
- Sites1 site
- Custom domains1 domain
- Published storage250 GB
- Bandwidth2 TB/mo
- AI credits1000 AI credits/mo
- Content CMSIncluded
The free plan is created from the dashboard; the deploy endpoint is intended for the billable plans (starter, professional, enterprise). 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 is being set up; typically ready in 2–5 minutes.
Site is live and serving traffic.
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.