Hanzo

API Reference

Platform REST and tRPC API for managing organizations, clusters, containers, and VMs

Hanzo Platform exposes two API surfaces: tRPC for the dashboard and REST for external integrations. Both share the same authentication and authorization layer.

Base URL

https://app.platform.hanzo.ai/api

All endpoints are relative to this base URL.

API Surfaces

SurfaceProtocolUse Case
tRPCHTTP POST with JSONDashboard, SDK, programmatic access
RESTStandard HTTP methodsExternal integrations, webhooks, CI/CD

The tRPC API uses procedure calls (e.g., organization.all, cluster.create). The REST API uses standard resource paths (e.g., GET /clusters, POST /containers).

Authentication

All requests require a Bearer token in the Authorization header:

curl https://app.platform.hanzo.ai/api/organization.all \
  -H "Authorization: Bearer YOUR_TOKEN"

See Authentication for details on obtaining tokens.

tRPC Procedures

The platform exposes 16 tRPC routers:

RouterDescription
organizationOrganization CRUD
orgTeamTeam member management
clusterCluster lifecycle
containerContainer deployments
projectProject management
environmentEnvironment configuration
buildBuild pipelines
logLog streaming
registryContainer registry
domainDomain and DNS management
gitGit integration
userUser profile
provisionerInfrastructure provisioning
auditAudit log
invitationTeam invitations
systemSystem health and status

Request Format

tRPC requests use HTTP POST with a JSON body:

curl -X POST https://app.platform.hanzo.ai/api/cluster.create \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production",
    "provider": "digitalocean",
    "region": "sfo3"
  }'

Response Format

All responses return JSON:

{
  "result": {
    "data": {
      "id": "cluster_abc123",
      "name": "production",
      "status": "provisioning"
    }
  }
}

Error Responses

Errors return an appropriate HTTP status code with a JSON body:

{
  "error": {
    "message": "Cluster not found",
    "code": "NOT_FOUND",
    "httpStatus": 404
  }
}
CodeMeaning
BAD_REQUESTInvalid input
UNAUTHORIZEDMissing or invalid token
FORBIDDENInsufficient permissions
NOT_FOUNDResource does not exist
CONFLICTResource already exists
INTERNAL_SERVER_ERRORServer error

Rate Limits

Endpoint TypeRate Limit
Read operations100 requests/minute
Write operations30 requests/minute
Log streaming10 concurrent connections

Rate limit headers are included in every response:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1709000000

How is this guide?

Last updated on

On this page