Skip to main content
API Documentation
Docs

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

POST
/api/sites/deploy

Create 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)

GET
/api/sites

List your sites.

Returns { customer, sites } for the signed-in account.

GET
/api/sites/{siteId}

Get a single site.

Returns { site } including its status, domain, plan, and live_url.

DELETE
/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.

POST
/api/sites/{siteId}/publish

Publish 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.

POST
/api/sites/{siteId}/export

Create 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.

GET
/api/sites/{siteId}/usage

Get usage metrics for the site.

POST
/api/billing/plan

Change 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.

GET
/api/exports

List your data exports.

GET
/api/billing/invoices

List invoices.

Supports limit and offset query parameters. Returns { invoices, total, limit, offset, has_more }.

POST
/api/subscriptions/portal

Create 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

provisioning

Site setup is in progress; wait for the portal result.

active

The site record is active; verify publication and the public hostname separately.

suspended

Site is paused (for example, after a billing lapse).

failed

Provisioning did not complete; contact support.

deleted

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.