Automation
Operate projects from CI or an MCP client using the same API the dashboard calls.
There is no npm CLI on this control plane
Ignore any older mention of @stackblaze/cli or stackblaze login. Create a token in the dashboard, then call https://api.stackblaze.cloud.
Tip
Authentication
Dashboard → Settings → API tokens → Generate token. The value starts with kbr_pat_ and is shown once. It inherits your organization and permissions.
export STACKBLAZE_TOKEN=kbr_pat_…
curl -sS https://api.stackblaze.cloud/api/pipelines \
-H "Authorization: Bearer $STACKBLAZE_TOKEN"Trigger a build
After your own CI tests pass, queue a platform build. Names are the project, phase, and app — not a service id.
curl -sS -X POST \
https://api.stackblaze.cloud/api/deployments/build/acme-app/production/api \
-H "Authorization: Bearer $STACKBLAZE_TOKEN" \
-H "Content-Type: application/json"| Action | Method and path |
|---|---|
| Restart without rebuild | GET /api/apps/{p}/{phase}/{app}/restart |
| App status | GET /api/apps/{p}/{phase}/{app}/status |
| Rollback | POST /api/deployments/rollback/{p}/{phase}/{app}/{revisionId} |
| Live logs | GET /api/logs/{p}/{phase}/{app}/ |
Apply a blueprint
When Infrastructure as Code is enabled on the project, plan and apply stackblaze.yaml. Apply never deletes.
curl -sS -X POST https://api.stackblaze.cloud/api/iac/blueprint/plan \
-H "Authorization: Bearer $STACKBLAZE_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"yaml\": $(jq -Rs . < stackblaze.yaml)}"See Blueprint for the file format.
GitHub Actions sketch
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Queue StackBlaze build
env:
STACKBLAZE_TOKEN: ${{ secrets.STACKBLAZE_TOKEN }}
run: |
curl -sS -X POST \
https://api.stackblaze.cloud/api/deployments/build/acme-app/production/api \
-H "Authorization: Bearer $STACKBLAZE_TOKEN"If the project already auto-deploys on git push, you do not need this workflow — the GitHub webhook is enough.
MCP
Point an MCP client at https://mcp.stackblaze.cloud and pass your token in Authorization. Tool names in code are unprefixed (get_app, deploy_app, search_logs).