API Reference
OpenAPI spec and guide
The full machine-readable spec (OpenAPI 3.1) is at https://app.moonbase.cloud/api/v1/openapi.json. Import it into Postman, Insomnia or your own docs, or generate a client from it. Every endpoint, form field, stream event, response field and error code on this page comes from that file.
Building moonbase into your own product? Start with the step-by-step guide, Integrate moonbase into your platform. It has copy-paste examples in curl, Node and Python.
Authentication
Create an API key on the API Keys page (in the sidebar). Pass it as a header:
Authorization: Bearer mb_live_...API keys have 'deploy' scope, allowing programmatic deployments. A key works for every mission on your account — it can't be limited to a single mission. Each key can be revoked on its own from the API Keys page; your other keys keep working. moonbase shows a key only once, when you create it.
A key that's invalid or revoked gets a 401 with error invalid_key; an expired key gets key_expired. Both come with a message saying what to do. With no Authorization header at all, the deploy endpoint answers 401 auth_required and the mission status endpoint answers 401 no_key.
Deploy endpoint
POST https://upload.moonbase.cloud/api/projects/upload/stream
Content-Type: multipart/form-data
Authorization: Bearer mb_live_...Form fields:
file: your project ZIP (required). A ZIP with just an index.html at its root deploys as a static mission.
redeployProjectId: existing mission ID, to deploy a new version to it (optional — omit to create a new mission)
name: mission address, for new missions only (optional — 3 to 32 lowercase letters, numbers and single hyphens, starting with a letter; a random one is picked if you leave it out)
displayName: the name shown in moonbase, for new missions only (optional)
Send uploads to upload.moonbase.cloud, the upload host, with the same key. app.moonbase.cloud sits behind a proxy with its own request size cap, below the larger plans' deploy sizes, so a large ZIP sent there is rejected before it reaches moonbase. Every other endpoint stays on app.moonbase.cloud.
Response: text/event-stream (Server-Sent Events). Progress events stream as the deploy runs, and the stream ends with a done event (your mission is live) or an error event (it isn't). See "Stream events" below.
Some problems are caught before the stream opens. Those come back as a plain JSON error instead of a stream — see "Errors before the stream opens". Check the response's Content-Type: only text/event-stream is a stream.
To ship a new version to a mission when you only know its address, look up its ID with the mission status endpoint below and pass that as redeployProjectId.
Stream events
Each event is an event: line and a data: line of JSON, followed by a blank line.
stage — progress. data: {"name": "subdomain.reservation" | "payload.upload" | "database.provisioning" | "ssl.provisioning" | "verification", "status": "started" | "completed" | "failed", "duration_ms": ...}
build_stage, build_log — build progress for Node apps.
notice — an occasional build note (data: {"code": "retrying_clean_build"}) while a fast build retries a clean build; no progress. API clients can ignore it.
warning — something likely to break the live app, found before the build; it never stops the deploy (data: {"code": "hardcoded_localhost", "references": ["src/api.ts:2 http://localhost:3000"], ...}). Repeated in done as warnings ([] when none).
step — wording for moonbase's own launch console. API clients can ignore it.
done — the mission is live. Example:
event: done
data: {"project_id": "<mission ID>", "slug": "my-mission", "url": "https://my-mission.moonbase.host", "total_ms": 2950, "mode": "static", "framework": null, "self_repair_notice": null, "skipped_entries": []}url: the live URL.
project_id: the mission ID — pass it as redeployProjectId to ship the next version.
mode: static or dynamic. framework: the detected framework, or null.
self_repair_notice: set when moonbase fixed something for you automatically, otherwise null.
skipped_entries: files moonbase left out (OS junk, blocked names); always present, [] when nothing was skipped.
error — the deploy didn't go live. Example:
event: error
data: {"stage": "verification", "message": "...", "trace_id": "TRK-...", "friendly": {"title": "...", "explanation": "...", "nextSteps": ["..."]}, "code": "..."}friendly: plain-language title, explanation and next steps to show your users.
code: a stable code you can branch on, when moonbase recognised the problem.
trace_id: the error ID to quote to support (the app shows it as Error ID).
build_log_tail: Only when the build or the app's start failed and printed something: the last part of that output, with the secrets moonbase recognises removed. It is the project's own text, not moonbase's guidance.
moonbase_note: Only when moonbase's build host stopped the deploy for its own reason (disk space, the built image's size, the malware scan, the build machine's limits): moonbase's own sentence with the detail, such as the size or the folder. It is moonbase's text, not the project's build output.
If the connection closes with neither done nor error, check the mission status endpoint before you upload again.
Errors before the stream opens
These come back as JSON with an HTTP error status instead of a stream: {"error": "<code>", "message": "...", "title": "...", "nextStep": "...", "trkId": "TRK-..."}, plus extra fields for some codes (retry_after_sec, consent_url, reason/limit/current). Check the response's Content-Type: only text/event-stream is a stream.
Every code, what it means and what to do is in Error codes below.
Error codes
Every error code the API returns, its HTTP status, what it means and what to do. Retry automatically only the ones marked safe to retry.
• auth_required (401) — No API key was sent. What to do: Send Authorization: Bearer mb_live_….
• invalid_key (401) — The key is invalid, revoked, or doesn't have the deploy scope. What to do: Create a new deploy key on the API Keys page and use it instead.
• key_expired (401) — The key has expired. What to do: Create a new deploy key and use it instead.
• no_key (401, status endpoint) — No API key was sent. What to do: Send Authorization: Bearer mb_live_….
• not_found (404, status endpoint) — No mission with this address on the key's account. What to do: Check the address, and that the key belongs to the account that owns the mission.
• email_not_verified (403) — The account's email address isn't verified yet. What to do: The account owner verifies their email, then try again.
• identity_required (403) — The account hasn't finished onboarding. What to do: The account owner finishes onboarding in moonbase, then try again.
• terms_reconsent_required (403) — moonbase's Terms of Service changed since the account owner last accepted them. What to do: The account owner signs in and accepts the current terms, then try again.
• upload_token_slug_mismatch (403) — An upload token was used for a different mission than it was issued for. Not used by API-key callers. What to do: Use the API key, not an upload token.
• malware_detected (403) — The malware scanner found something harmful in the upload. What to do: Remove it. If you think it's a false positive, contact support with the trkId.
• invalid_body (400) — The request couldn't be read as multipart form data — usually a network hiccup. What to do: Retry. Check that you send multipart/form-data with a file field.
• no_file (400) — No file field, or it was empty. What to do: Attach the ZIP as the file field.
• not_zip (400) — The file isn't a ZIP (or a single .html file). What to do: Upload a .zip with an index.html or package.json at its root.
• too_large (400) — The upload is over the largest size moonbase accepts. What to do: Leave out node_modules, build output and unused assets. limit gives the cap in bytes.
• too_large_for_now (400) — The upload is over the size we can take for now (an interim ceiling while large-upload support is finished), even if your plan allows more. What to do: Make the ZIP smaller (leave out node_modules, build output and unused media) and try again. limit gives the current ceiling in bytes.
• invalid_name (400) — name breaks the address rules. What to do: Use 3–32 lowercase letters, numbers and single hyphens, starting with a letter. message says which rule.
• invalid_password (400) — The password sent with a new mission's first deploy is too short (below the admin-set minimum) or longer than 128 characters. What to do: Send a longer password (up to 128 characters), or deploy without password.
• password_protection_coming_soon (400) — A password was sent with a new version of an existing mission. Only a new mission's first deploy can carry one. What to do: Deploy without password, then set or change the password in Mission Control.
• password_protection_disabled (403) — moonbase has paused new password protection, so a first deploy with a password was refused. What to do: Try later, or deploy without password.
• consent_invalid_json (400) — The consent field isn't valid JSON. What to do: Fix or leave out consent.
• upload_check_busy (503) — moonbase is busy and couldn't check this upload just now. Nothing was published. What to do: Try again in a minute.
• zip_unsafe (400) — The ZIP failed a safety check (unusual file count, size or paths). What to do: If it's a normal project, contact support with the trkId.
• no_html_or_package_json_found (400) — There's no index.html or package.json anywhere in the upload. What to do: Include an index.html (static) or a package.json (Node). Doesn't count against your rate limit.
• no_html_found (400) — A static upload with no .html files. What to do: Include an .html file. Doesn't count against your rate limit.
• go_not_supported (400) — A Go project. moonbase doesn't run Go yet. What to do: Upload a built frontend if the project has one. Doesn't count against your rate limit.
• python_entrypoint_not_detected (400) — A Python project with no startable web app. moonbase runs Flask/Django/FastAPI apps that expose a standard WSGI/ASGI app object. What to do: Expose a top-level app object (app = Flask(__name__), app = FastAPI(), or a Django wsgi.py). Doesn't count against your rate limit.
• astro_ssr_not_supported (400) — An Astro project in SSR mode. moonbase deploys static Astro output (astro build → dist/) in v1. What to do: Build Astro as a static site (remove the SSR adapter / set output: 'static'). Doesn't count against your rate limit.
• sveltekit_adapter_node_required (400) — A SvelteKit project using an adapter moonbase can't start. v1 runs @sveltejs/adapter-node only. What to do: Switch svelte.config.js to @sveltejs/adapter-node and re-upload. Doesn't count against your rate limit.
• framework_unsupported:<framework> (400) — The framework was recognised but moonbase can't build it yet. What to do: Deploy a static build instead. Doesn't count against your rate limit.
• classification_error (400) — moonbase couldn't work out how to deploy this upload. What to do: Contact support with the trkId.
• hardcoded_secret_detected (400) — The upload contains what looks like an API key or credential. It was stopped so it doesn't go public. What to do: Remove it (use environment variables) and upload again. Doesn't count against your rate limit.
• plan_limit_exceeded (402) — Over a plan limit: per-deploy size, number of missions, or storage. What to do: reason, limit, current and message say which. Free up room or move to a larger plan.
• weight_overage (402) — The upload would take the account past its free storage. What to do: The account owner upgrades, or frees up storage.
• project_not_found (404) — redeployProjectId isn't a mission on this account. What to do: Look the ID up with the status endpoint, or omit it to create a new mission.
• user_not_found (404) — The key's account no longer exists. What to do: Use a key from a current account.
• name_taken (409) — Another mission already uses this address. What to do: Pick another name. To update your own mission at that address, send its redeployProjectId instead.
• name_recently_used (409) — This address belonged to a recently deleted mission and is still on hold. What to do: Pick another name.
• mission_slug_unusable (409) — This mission's current address is too short to deploy to anymore. What to do: Contact support to get it renamed.
• forbidden (403) — Signed in in the browser as someone the mission is shared with, without permission to deploy (Viewer). An API key never gets this: a key only reaches its own account's missions. What to do: Ask the mission's owner or an admin for Editor access.
• deploy_in_progress (409) — This mission is still building its previous version; one build per mission runs at a time. What to do: Wait retry_after_sec seconds (also the Retry-After header), then try again. Nothing was uploaded and it doesn't count against your rate limit. Safe to retry.
• mission_downgrade_locked (409) — Your plan ended, and this project is over the Free plan's limit, so it's locked. It keeps working, but it can't be deployed, rolled back, resumed or renamed, and its password, environment variables and domains can't be changed. You can still pause, export, archive or delete it. Upgrade to unlock it. If you don't, it will be paused and later deleted; we'll email you before it's deleted. downgrade_state is locked or paused. What to do: Upgrading the plan, or deleting missions until the account fits, unlocks it. The same request returns the same refusal until then.
• consent_required (409) — moonbase wants to change something in this project's build and needs the owner's OK first. What to do: The owner opens consent_url and deploys once from the browser to review proposals. After that, API deploys work again. Doesn't count against your rate limit.
• rate_limited (429) — Too many deploys in a short time (per account or per IP). What to do: Wait retry_after_sec seconds (also the Retry-After header), then try again. Safe to retry.
• internal (500) — Something went wrong on moonbase's side. What to do: Retry once. If it keeps happening, contact support with the trkId. Safe to retry.
• deployment_maintenance (503) — New deployments are temporarily paused for maintenance. What to do: Wait and retry later. Do not change database settings or start duplicate deployments. Safe to retry.
• service_draining (503) — moonbase is restarting. What to do: Retry in a few seconds. Safe to retry.
• scanner_unavailable (503) — The malware scanner is briefly unreachable, so the upload was held rather than deployed unscanned. What to do: Retry in a few minutes. Safe to retry.
• scan_incomplete (503) — The malware scan didn't finish. What to do: Retry in a few minutes. Safe to retry.
• scan_too_large (503) — The file is too large for the malware scanner. What to do: Make the upload smaller, or contact support.
Mission status endpoint
GET https://app.moonbase.cloud/api/v1/sites/{address}/status
Authorization: Bearer mb_live_...Gets a mission's live URL and state without keeping a deploy stream open. It works with an API key only, and only for missions on your own account. Any other address returns 404 not_found.
Example response:
{"id": "<mission ID>", "slug": "my-mission", "displayName": null, "status": "live", "isPaused": false, "isArchived": false, "publicUrl": "https://my-mission.moonbase.host", "currentVersion": 6, "lastDeployedAt": "2026-10-22T22:45:10.530Z", "deployInProgress": false, "deployStartedAt": null}id: the mission ID, to pass as redeployProjectId.
publicUrl: the live URL. currentVersion: the live version's number.
deployInProgress, deployStartedAt: whether a build is running right now, and when it started.
To follow a deploy without the stream, poll until deployInProgress is false. If currentVersion went up, the new version is live. If the build failed, the reason is only in the stream's error event.
Environment variables endpoint
GET https://app.moonbase.cloud/api/v1/sites/{address}/env
PUT https://app.moonbase.cloud/api/v1/sites/{address}/env
DELETE https://app.moonbase.cloud/api/v1/sites/{address}/env
Authorization: Bearer mb_live_...Lists, saves, and deletes a mission's environment variables, so your platform can finish configuring a mission (a database URL, an API secret) without a browser. API key only, and only for missions on your own account: any other address returns 404 not_found.
GET lists the names that are set, and the names the latest build referenced but that have no value yet. It never returns values: they are write-only.
{"slug": "my-mission", "envVars": [{"key": "DATABASE_URL", "source": "user"}], "referenced": ["STRIPE_SECRET_KEY"]}PUT sets one or more variables. Send a batch as {"env": {"KEY": "value"}}, or one as {"key": "KEY", "value": "value"}. It's all or nothing: every entry is checked before any is written, so one bad entry fails the whole request with a 400 that names its key, and nothing is stored. The response names only the keys that were set, never the values:
{"slug": "my-mission", "set": ["DATABASE_URL", "STRIPE_SECRET_KEY"], "count": 2}Example (the shell sends the API key to curl on standard input, outside the command arguments):
set +x
printf 'Authorization: Bearer %s\n' "$MOONBASE_API_KEY" | \
curl -s -X PUT "https://app.moonbase.cloud/api/v1/sites/my-mission/env" \
--header @- \
-H "Content-Type: application/json" \
-d '{"env": {"DATABASE_URL": "postgres://..."}}'Rules:
• Names start with a letter or underscore, then letters, digits or underscores (key_invalid_format). Names moonbase manages are refused (platform_var_managed): its own MOONBASE_*, MOONSERVER_* and *_LIVE_URL names, and a saved name whose source is engine, such as the DATABASE_URL of a moonbase database.
• A value can't be empty (value_required) or longer than 32,000 characters (value_too_long).
• A body that isn't a JSON object is invalid_body; one with no variables is no_vars.
• Each mission has a cap on how many variables it can hold. Going over it is a 409 env_vars_limit with the cap as max, and nothing is written.
• 503 mission_cap_unavailable: the cap could not be checked and the write was refused before anything was stored.
• 503 env_write_failed: the write outcome could not be confirmed. GET lists names only and cannot verify whether an existing value changed. Coordinate with other writers before retrying.
DELETE accepts a JSON body with the exact saved name, such as {"key": "DATABASE_URL"}. It removes only a user-saved variable. The response is {"deleted": true} when a variable was removed or {"deleted": false} when it was already absent.
Saved changes apply on the mission's next deploy. The running version keeps its current environment.
Limits
Per-deploy ZIP size: 250 MB on moonbase free, 250 MB on moonbase plus, 250 MB on moonbase pro, and 250 MB on moonbase max, never more than 1 GB. Your plan also limits how many missions you can have and your total storage — see Pricing & Billing.
Deploys: a few per 5 minutes and up to 100 per hour per account, with a separate per-IP limit. A 429 rate_limited says exactly how long to wait.
Builds: one at a time per mission (409 deploy_in_progress). Deploys to different missions don't wait for each other.
Build time: a build that runs too long is stopped and ends in an error event. Allow at least 10 minutes before your client gives up on the stream, and if the connection drops, check the mission status endpoint before you upload again.
Reference: deploy form fields
• file (required) — The project as a ZIP. A ZIP with just an index.html at its root deploys as a static mission. A single bare .html file is also accepted and wrapped as index.html.
• redeployProjectId (optional) — ID of an existing mission on this account. Ships a new version of it. Get it from a previous done event (project_id) or the status endpoint (id). When set, name and displayName are ignored.
• name (optional) — Address for a new mission (lowercase letters, numbers and single hyphens; starts with a letter, doesn't end with a hyphen). A random one is picked if omitted. Mixed case is lowered.
• displayName (optional) — Name shown in moonbase for a new mission. Longer values are cut to 50 characters.
• note (optional) — Optional short description of THIS version, shown in the Versions table (the NOTE column). Applies to new missions and redeploys. Line breaks and control characters are collapsed to spaces. Longer values are cut to 200 characters; a note never causes a deploy to be refused.
• consent (optional) — Rarely needed. JSON {"repairs":[{"repairRuleId":"...","accepted":true}]}. API-key deploys accept moonbase's proposed build repairs automatically; see the consent_required error for the case where that isn't enough.
Reference: stream events
event: stage — Progress of one deploy stage. Each stage sends started, then completed or failed.
• name (subdomain.reservation | payload.upload | database.provisioning | ssl.provisioning | verification, always sent)
• status (started | completed | failed, always sent)
• duration_ms (integer)
• message (string) — On failed: the raw cause.
• fqdn (string) — subdomain.reservation completed: the mission's hostname.
• files_count (integer) — payload.upload completed.
• size_bytes (integer) — payload.upload completed.
• mode (static | dynamic) — payload.upload completed.
• framework (string | null) — payload.upload completed, dynamic missions.
• build_duration_ms (integer) — payload.upload completed, dynamic missions.
• status_code (integer) — verification completed: the HTTP status the live mission answered with.
event: step — Wording for moonbase's own launch console. Integrations can ignore it.
• stepIndex (integer)
• stepKey (string)
• status (active | done | failed)
• sentence (string)
• rowLabel (string)
• findingText (string)
• tookMs (integer)
event: build_stage — Build progress, Node (dynamic) missions only.
• name (string, always sent)
• progressPercent (number, always sent)
event: build_log — One line of build or container output, Node (dynamic) missions only.
• line (string, always sent)
• source (build | container | system, always sent)
event: notice — A one-off build notice, Node (dynamic) missions only. code names the notice (e.g. retrying_clean_build when a fast build failed and a clean build is retried). Carries no progress and never moves the progress bar.
• code (string, always sent)
event: warning — Something in the upload that is likely to break the live app, found before the build runs. It never stops the deploy. code names it: hardcoded_localhost means a localhost address (e.g. http://localhost:3000, a database at 127.0.0.1) is written into the app's runtime code; references lists each as path:line address. The same object is repeated in the done event's warnings.
• code (hardcoded_localhost, always sent)
• title (string, always sent)
• what_to_do (string, always sent)
• references (array, always sent)
• blocking (boolean, always sent)
event: done — The container is deployed. Always the last event of a successful deploy. Check app_ready: true means the app's readiness check confirmed it is serving; false means it deployed but is not ready yet (e.g. needs configuration); null means readiness was not determined (no readiness endpoint, a static site, or an inconclusive probe) and the mission is treated as live.
• project_id (string, always sent) — The mission ID. Send it as redeployProjectId to ship the next version.
• slug (string, always sent) — The mission's address.
• url (string, always sent) — The live URL.
• total_ms (integer, always sent)
• mode (static | dynamic, always sent)
• framework (string | null) — The detected framework.
• self_repair_notice (string | null) — Set when moonbase fixed something automatically, otherwise null.
• asset_problem (object) — Only present when the page answered but its own scripts or styles did not load, so visitors may see a blank screen. app_ready is false. Waiting won't help: change the project and upload it again.
• page_check (object) — What moonbase saw when it loaded the mission's page itself right after this deploy: the HTTP status, the page's title and how many bytes of HTML it read. Present whenever that request got an answer. Use it as proof the page is being served when you cannot reach the site yourself. A 302 means the mission is behind its password page.
• database_not_available (object) — Only present when the upload's moonbase.json asks for a managed PostgreSQL database and moonbase does not offer managed databases to this account. No database was created and moonbase did not set DATABASE_URL. Do not retry for this: connect an existing database with set_env, or ask moonbase support to enable managed databases for the account.
• database_not_in_plan (object) — Only present when the upload's moonbase.json asks for a managed PostgreSQL database and none was created; moonbase did not set DATABASE_URL. By reason: plan_has_none: the account's plan includes none (do not retry the deploy for this); when upgrade_available is true, message names an upgrade that includes one today and its price, plus any applicable tax (ask the person, and only after a clear yes hand them the upgrade link), otherwise no purchase is advised. no_plan_offers: message is "Managed databases aren't available on any plan yet." check_failed: moonbase could not check; message is "We couldn't check right now, try again later." and nothing more is claimed.
• database_storage (object) — Only present for a mission with a managed PostgreSQL database: how much of its storage limit the database uses, measured by moonbase at the end of this deploy. When writes_blocked is true the database is over the limit and the running app has lost its write access: plain SELECT works, every write is refused ('cannot execute ... in a read-only transaction' or 'permission denied'), and so are SELECT ... FOR UPDATE and nextval(). When connections_blocked is true the database kept growing while blocked and the running app cannot connect to it at all. In both cases the migration command can still connect and write: free space there (TRUNCATE or DROP; a plain DELETE does not shrink the database) and deploy again. Do not try to switch read-only off.
• page_files_missing (object) — Only present when the site is live but some stylesheets, fonts or images the page asks for did not load, so parts of it may look wrong. The deploy succeeded and app_ready is unaffected. Each file was requested the way a browser requests it and was reported only after a second look. Fix the listed paths in the project and upload it again.
• version (integer) — Mission Log version number when the deployment history was recorded.
• history_recorded (boolean) — true normally; false if the deployment-history row failed to write (the mission is live but not durably tracked, and operations has been alerted to reconcile it).
• skipped_entries (array, always sent) — Files moonbase left out (OS junk, blocked names). [] when nothing was skipped.
• warnings (array) — Non-blocking findings from before the build (each also sent as a warning event), e.g. a localhost address in the code. [] when there are none.
• app_ready (boolean | null) — Whether the app's own readiness endpoint confirmed it is actually serving. true = ready; false = deployed but not ready yet; null = not determined (no readiness endpoint, a static site, or an inconclusive probe), in which case the mission is treated as live.
• readiness (object) — How readiness was determined.
event: error — The deploy did not go live. Always the last event of a failed deploy.
• stage (string, always sent) — The stage that failed, or unknown.
• message (string, always sent) — The raw cause. Prefer friendly for your users.
• trace_id (string) — The error ID to quote to support (TRK-…); the app shows it as Error ID.
• attempt_id (string) — The owner's held connector receipt, when an earlier deployment needs reconciliation.
• connector_outcome_uncertain (boolean) — The connector worker must verify the Sites outcome before releasing this attempt.
• migration_output (string) — Only with friendly.code = migration_failed, and only when the command printed something: the last lines (at most 15) of the error output of the migration command declared in moonbase.json. Connection strings, passwords, addresses, host names, the database name and its user are replaced before it is sent. It is the command's own text, not moonbase's guidance.
• build_log_tail (string) — Only when the build or the app's start failed and printed something: the last part of that output, with the secrets moonbase recognises removed. It is the project's own text, not moonbase's guidance.
• moonbase_note (string) — Only when moonbase's build host stopped the deploy for its own reason (disk space, the built image's size, the malware scan, the build machine's limits): moonbase's own sentence with the detail, such as the size or the folder. It is moonbase's text, not the project's build output.
• database_not_available (object) — Only present when the upload's moonbase.json asks for a managed PostgreSQL database and moonbase does not offer managed databases to this account, so none was created. If the app failed because it has no database, that is why. Do not retry for this: connect an existing database with set_env, or ask moonbase support to enable managed databases for the account.
• database_not_in_plan (object) — Only present when the upload's moonbase.json asks for a managed PostgreSQL database and none was created; moonbase did not set DATABASE_URL. By reason: plan_has_none: the account's plan includes none (do not retry the deploy for this); when upgrade_available is true, message names an upgrade that includes one today and its price, plus any applicable tax (ask the person, and only after a clear yes hand them the upgrade link), otherwise no purchase is advised. no_plan_offers: message is "Managed databases aren't available on any plan yet." check_failed: moonbase could not check; message is "We couldn't check right now, try again later." and nothing more is claimed.
• friendly (object) — Plain-language copy to show your users.
• code (string) — Stable code when moonbase recognised the problem, e.g. deploy_in_progress.
• retry_after_sec (integer) — With code: deploy_in_progress: seconds to wait.
• retryContext (object) — Internal retry bookkeeping. Don't depend on its shape.
• retryNote (string | null) — A note about earlier attempts with the same upload.
Reference: status response
• id (string, always sent) — The mission ID — send it as redeployProjectId.
• slug (string, always sent)
• displayName (string | null, always sent)
• status (string, always sent) — The mission's state. live = deployed and serving; deployed_not_ready = deployed and reachable but the app's readiness check reported not-ready (needs configuration / still warming up) — distinct from a failed deploy; also paused, failed. A deployed_not_ready mission is re-probed on this read and flips back to live once its app answers ready.
• appReady (boolean | null, always sent) — true when the mission is live and serving (moonbase has no not-ready signal — a live mission with no readiness endpoint reads true); false when deployed and reachable but the app reported not-ready; null when paused, archived, or not currently deployed. A client can read this instead of comparing status to live.
• isPaused (boolean, always sent)
• resumePending (boolean, always sent) — A resume was accepted (the resume endpoint answered 202 resume_in_progress) but its outcome isn't confirmed yet. The mission keeps its place on the plan until a daily check settles it from the sites host; then this reads false again and isPaused shows the outcome.
• isArchived (boolean, always sent)
• publicUrl (string | null, always sent) — The live URL.
• currentVersion (integer | null, always sent) — The live version's number.
• lastDeployedAt (string | null, always sent)
• deployInProgress (boolean, always sent) — Whether a build is running right now.
• deployStartedAt (string | null, always sent) — When the running build started.
Reference: environment variables
PUT body (either shape):
• env (object) — A map of KEY: value pairs to set.
• key (string) — A single variable name (sent with value).
• value (string) — The value for key.
GET response:
• slug (string, always sent)
• envVars (array, always sent) — The keys currently set, with where each came from.
• referenced (array, always sent) — Keys the latest build referenced but that aren't set yet (platform-managed names excluded).
PUT response:
• slug (string, always sent)
• set (array, always sent) — The names that were set, sorted.
• count (integer, always sent)
Errors: {"error": "<code>", "message": ..., "key": ..., "max": ...}. Codes: invalid_body, no_vars, key_invalid_format, platform_var_managed, value_required, value_too_long, env_vars_limit, mission_cap_unavailable, env_write_failed. Stable code. Validation (400): invalid_body, no_vars, or a per-entry code (key_invalid_format, platform_var_managed, value_required, value_too_long). Cap: env_vars_limit (409), mission_cap_unavailable (503). env_write_failed (503): the write outcome could not be confirmed.
A missing, invalid, revoked or expired key is a 401 (no_key, invalid_key, key_expired); a mission that isn't on the key's account is a 404 not_found.