6 steps · 8 min
Build your own medic
Give a small watcher one narrow key and let it repair one project: restart it, roll it back to the last good release, or redeploy it. The key can do nothing else on your account.
- Create a key limited to one projectIn the dashboard, open Agents & MCP, then API keys. Name the key, set Access to the one project the medic looks after, and tick Repair and Redeploy. Copy the key when it is shown; it is shown once. This key cannot read billing, reach your other projects, change environment variables, or create keys. Any call outside its project or its actions is refused with 403 and a message that starts API_KEY_SCOPE_REFUSED.
- Watch your app's health from outsideThe medic decides when to act, so it needs its own signal: request your app's health URL every 30 seconds and count failures. Act after three in a row, not after one slow answer. If you would rather read the platform's own check, add Read deploys to the key and call
deployments.liveProbe; add Read runtime logs to read what the app printed withprojects.runtimeLogs. - First response: restart
projects.restartrestarts the release that is already live. Nothing is built. The call waits for the app to come back and answershealthy: trueorhealthy: false. A project can be restarted once every two minutes, and not while a deploy is running; both refusals say when to try again. - Still unhealthy: roll back to the last good release
deployments.rollbackToLastGoodputs production back on the newest earlier release that went live. You do not pick a deployment, and the key cannot roll back to one of its choosing. Each call goes one release further back, never forward to the release it just left. With no earlier release it refuses and changes nothing. A project can be rolled back once every five minutes. - After a fix is pushed: redeploy
deployments.createwith only the project id builds and ships the current head of the project's tracked branch. With a scoped key the call may not name a branch or a commit, so the medic can ship what you merged and nothing else. - Stop and tell a personA medic that loops makes an outage worse. Treat 429 (cooldown) and 409 (a deploy is running) as wait. Treat 412 (nothing to roll back to), a restart that answers
healthy: falsetwice, and any 403 as stop: page a person with the message the call returned. Every restart, rollback and log read is recorded by the platform with the key that made it.
Ready to build?
Signups are invite-only right now — request access and we'll follow up.