Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Overview

Call the platform over HTTP. JSON request and response bodies. The spec is generated from proto platform.v1 — not a sample Petstore.

Open the REST API reference →

The reference lists every path, with examples you can send from the browser.

EnvironmentURL
M12Phttps://api.m12p.com
Cloud (compose)http://cloud-api.localhost
Desktop (local-backend)http://127.0.0.1:7733
Terminal window
curl https://api.m12p.com/healthz
curl https://api.m12p.com/openapi.json

The machine-readable spec on this site is GET /openapi.json.

Send Authorization: Bearer <access token>. A person gets one by signing in with the CLI (platform token prints it). Automation gets one as a service principal. Tokens last 15 minutes.

GET /api/auth/me tells you who the token belongs to: the subject, home tenant, and app, plus tenants, every tenant you can open with its apps.

These routes are not in the generated reference yet. {id} is a service id such as service_06gsviu9kcdrn6dn2rfuq1u924. A role on the service, its app, or its tenant is enough. Reading needs platform.paas.get. Changing needs platform.paas.create.

RouteWhat it does
GET /api/paas/{id}/workloadThe saved spec: containers, domains, environment
PUT /api/paas/{id}/workloadReplace the saved spec
POST /api/paas/{id}/deployDeploy. Answers 202
GET /api/paas/{id}/deploymentsRecent deployments
GET /api/paas/{id}/deployments/{did}One deployment: status and summary
GET /api/paas/{id}/podsPods, with the reason and message of any that is not ready
GET /api/paas/{id}/eventsKubernetes events for this service, newest first, at most 100
GET /api/paas/{id}/logs?container=&tail=&previous=1A container’s log. previous=1 shows the run before the last restart
PATCH /api/paas/{id}Rename: {"name": "travel"}
POST /api/paas/{id}/webhookCreate a new deploy hook URL. The old one stops working
DELETE /api/paas/{id}/webhookTurn the deploy hook off
POST /api/paas/{id}/pause, POST /api/paas/{id}/startStop and start the app
Terminal window
curl -X POST https://api.m12p.com/api/paas/$SERVICE/deploy \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d "$(jq -n --rawfile c docker-compose.paas.yml '{compose: $c}')"
BodyWhat is deployed
emptyThe saved spec
{"compose": "..."}Your Compose file. It replaces the saved one first
{"service": "server"}The saved spec, restarting only that container

The answer is 202 {"deploymentId", "status", "deployment"}. The deploy runs in the background for up to four minutes. Poll GET /api/paas/{id}/deployments/{deploymentId} until status is succeeded or failed. A failed summary starts with why, for example “The cluster has no room for this pod”.

POST /api/hooks/paas/{token} deploys without a token, for CI systems that cannot sign in. See Deploy hook.

RouteWhat it does
GET /api/tenants/{tid}One tenant
PATCH /api/tenants/{tid}Rename: {"name": "travel"}. Needs iam.policy.update
GET /api/tenants/{tid}/appsApps in the tenant
GET, POST /api/tenants/{tid}/iam/applicationsApp registrations and service principals
GET, PUT /api/tenants/{tid}/iam/applications/{aid}/rolesA service principal’s roles: [{"roleId", "scope"}]
GET, POST /api/tenants/{tid}/iam/applications/{aid}/federated-credentialsTrusted outside tokens, see GitHub Actions
DELETE /api/tenants/{tid}/iam/applications/{aid}/federated-credentials/{fid}Stop trusting one