Reference
API Reference
The StackBlaze REST API gives you programmatic access to all platform resources. Use it to automate deployments, integrate with your own tooling, fetch metrics, and manage services from CI/CD pipelines or internal dashboards.
Base URL
api.stackblaze.cloud/v1
Auth
Bearer token
Rate limit
300 req/min
Authentication
All API requests require a Bearer token. Generate one from Account Settings → API Keys → Create Key. Give it a descriptive name and select the scopes it needs. Tokens can be scoped to read-only or read-write per resource type.
# Include Authorization header on all requests
Authorization: Bearer sb_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Full curl example
curl https://api.stackblaze.cloud/v1/services \
-H "Authorization: Bearer $STACKBLAZE_TOKEN" \
-H "Content-Type: application/json"
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /services | List all services in the project |
| POST | /services | Create a new service |
| GET | /services/{id} | Get service details and status |
| PATCH | /services/{id} | Update service settings |
| DELETE | /services/{id} | Delete a service |
| POST | /services/{id}/deploy | Trigger a manual deploy |
| GET | /services/{id}/deployments | List deployments (paginated) |
| GET | /services/{id}/deployments/{did} | Get deployment details and logs |
| POST | /services/{id}/rollback | Rollback to previous deployment |
| GET | /services/{id}/logs | Stream live logs (SSE) |
| GET | /services/{id}/metrics | CPU, memory, request metrics |
| GET | /databases | List all databases |
| POST | /databases | Create a database |
| GET | /databases/{id} | Get database details |
| DELETE | /databases/{id} | Delete a database |
| GET | /envgroups | List environment groups |
| POST | /envgroups | Create an environment group |
| GET | /project | Get project details |
| GET | /project/members | List team members |
Example: list services
Request
curl https://api.stackblaze.cloud/v1/services \
-H "Authorization: Bearer $STACKBLAZE_TOKEN"
Response
{
"services": [
{
"id": "svc_abc123",
"name": "my-api",
"type": "web_service",
"status": "running",
"url": "https://my-api.stackblaze.app",
"replicas": 3,
"created_at": "2026-01-15T10:30:00Z"
}
],
"total": 1,
"page": 1
}
Example: trigger a deploy
Request
curl -X POST https://api.stackblaze.cloud/v1/services/svc_abc123/deploy \
-H "Authorization: Bearer $STACKBLAZE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"branch": "main", "clear_cache": false}'
Response (202 Accepted)
{
"deployment_id": "dep_9f3k2m...",
"status": "queued",
"branch": "main",
"created_at": "2026-04-13T09:42:01Z"
}
Error responses
All error responses follow a consistent JSON format:
{
"error": {
"code": "service_not_found",
"message": "No service with ID svc_xyz exists in this project",
"status": 404,
"request_id": "req_7d3f9a..."
}
}
| Status | Meaning |
|---|---|
| 400 | Bad Request, invalid parameters |
| 401 | Unauthorized, missing or invalid token |
| 403 | Forbidden, token lacks permission for this action |
| 404 | Not Found, resource does not exist |
| 409 | Conflict, e.g. deploy already in progress |
| 429 | Too Many Requests, rate limit exceeded |
| 500 | Internal Server Error, contact support with request_id |
Rate limiting
The API is rate-limited to 300 requests per minute per API token. The response headers include X-RateLimit-Remaining and X-RateLimit-Reset so you can implement adaptive back-off. Exceeding the limit returns 429 with a Retry-After header.