Automation

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

Interactive OpenAPI is at /api/docs. MCP is at mcp.stackblaze.cloud. Send the same Bearer token.

Authentication

Dashboard → Settings → API tokens → Generate token. The value starts with kbr_pat_ and is shown once. It inherits your organization and permissions.

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

terminal
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"
ActionMethod and path
Restart without rebuildGET /api/apps/{p}/{phase}/{app}/restart
App statusGET /api/apps/{p}/{phase}/{app}/status
RollbackPOST /api/deployments/rollback/{p}/{phase}/{app}/{revisionId}
Live logsGET /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.

terminal
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

.github/workflows/deploy.yml
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).