API Reference

Reference

API Reference

8 min readUpdated April 2026

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.

Authentication header

# 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

MethodEndpointDescription
GET/servicesList all services in the project
POST/servicesCreate 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}/deployTrigger a manual deploy
GET/services/{id}/deploymentsList deployments (paginated)
GET/services/{id}/deployments/{did}Get deployment details and logs
POST/services/{id}/rollbackRollback to previous deployment
GET/services/{id}/logsStream live logs (SSE)
GET/services/{id}/metricsCPU, memory, request metrics
GET/databasesList all databases
POST/databasesCreate a database
GET/databases/{id}Get database details
DELETE/databases/{id}Delete a database
GET/envgroupsList environment groups
POST/envgroupsCreate an environment group
GET/projectGet project details
GET/project/membersList team members

Example: list services

Request

GET /v1/services

curl https://api.stackblaze.cloud/v1/services \

-H "Authorization: Bearer $STACKBLAZE_TOKEN"

Response

200 OK

{

"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

POST /v1/services/{id}/deploy

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)

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:

4xx / 5xx error

{

"error": {

"code": "service_not_found",

"message": "No service with ID svc_xyz exists in this project",

"status": 404,

"request_id": "req_7d3f9a..."

}

}

StatusMeaning
400Bad Request, invalid parameters
401Unauthorized, missing or invalid token
403Forbidden, token lacks permission for this action
404Not Found, resource does not exist
409Conflict, e.g. deploy already in progress
429Too Many Requests, rate limit exceeded
500Internal 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.