Everything the dashboard does is an HTTP call you can make yourself. Authenticate with an API key as a bearer token.
Base URLhttps://api.staxa.dev/api/v1
Getting Started
The Staxa API lets you programmatically create and manage isolated tenant environments. Every action available in the dashboard is also available through the API.
This creates a tenant named "acme-corp" with one service, detects the framework, builds it and deploys it, all from a single API call. The response is the tenant, and its deployment_url is where the app is served once the deploy finishes. Follow progress on GET /api/v1/tenants/{id}/events (Server-Sent Events) or by reading the tenant until its status is ready.
Advanced: Pass "deploy_on_create": false in the request body to create the tenant + services + env vars without enqueueing a deploy. Useful for templating, multi-step provisioning, or uploading secrets before the first build. Trigger the deploy later with POST /api/v1/tenants/{id}/deployments.
Authentication
The Staxa API accepts two authentication modes:
API Key (Programmatic)
For server-to-server integrations and automation. Create API keys from the dashboard at Settings → API Keys, or via POST /api/v1/api-keys.
A key is created as live (sk_live_..., the default) or test (sk_test_...). Both work the same way today; the prefix only tells your own keys apart. A key with the read scope can only read.
The key is shown once, when it is created. Revoking a key takes effect at once.
Clerk JWT (Dashboard)
Used automatically by the dashboard. Most developers won't need this. Use API keys for programmatic access.
Paged lists take limit (default 20, up to 100) and offset. Short lists, such as a tenant's services or domains, return everything in data with no pagination.
Coming soon. Contact us if you need webhook integration today.
Changelog
2026-05-12
POST /api/v1/tenants now auto-deploys by default. Creating a tenant also creates the first deployment row (version 1, trigger tenant.create) and enqueues the build/deploy pipeline. The response is still 202 Accepted and the deployment can be observed via GET /api/v1/tenants/{id}/deployments or the SSE events stream. Pass "deploy_on_create": false to preserve the previous behavior of create-without-deploy. Backward compatible: clients that were chaining POST /tenants/{id}/deployments as a second step will simply get one extra deployment per create.
The account's tenants with their services, newest first.
Parameters
limitinteger (query)default 20
Page size, up to 100.
offsetinteger (query)default 0
Items to skip.
Errors
401The credentials are missing or not valid.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Takes `limit` (1–100, default 20), `offset`, and `status` as query parameters. The live URL is `deployment_url`, and it stays empty until the first deploy routes successfully. Deleted tenants are excluded.
Creates a tenant with its services and, unless `deploy_on_create` is false, starts its first deploy. Follow progress on the event stream or by reading the tenant.
Parameters
namestringrequired
3 to 31 lowercase letters, digits or hyphens, starting with a letter. Unique across Staxa: it is the tenant's hostname.
display_namestring
display_name
db_enginestring
The tenant's database, shared by its services. Valkey is a cache-grade store and is not backed up. One of: postgres, mysql, valkey, none.
db_versionstring
`postgres`: 17 (default) or 16. `mysql`: 8.4. `valkey`: 8.0 (default) or 7.2.
servicesarray
The tenant's services. Omit to create one service from the top-level source fields.
envobject
Tenant-level environment variables, shared by every service.
secret_keysarray
Keys of `env` to store as secrets.
build_secret_keysarray
build_secret_keys
deploy_on_createboolean
Default `true`: the first deploy starts with the create.
source_typestring
With no `services`: the source of the tenant's one service. One of: github, image.
repo_urlstring
repo_url
branchstring
branch
root_directorystring
root_directory
dockerfile_pathstring
dockerfile_path
build_contextstring
build_context
build_context_scopestring
One of: root, repo.
image_urlstring
image_url
frameworkstring
framework
runtimestring
runtime
runtime_versionstring
runtime_version
app_portinteger
app_port
resource_sizestring
One of: small, medium, large.
health_check_typestring
One of: http, tcp, none.
health_check_pathstring
health_check_path
health_check_portinteger
health_check_port
autoscale_disabledboolean
autoscale_disabled
Errors
400An invalid or reserved name, an unknown `db_engine`, or an invalid build path.
401The credentials are missing or not valid.
403The account's email is not verified, or its deploys are held.
409The tenant name, or a hostname it needs, is taken.
422A plan limit was reached, or the request was refused.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Not available right now. A write refused during maintenance carries `Retry-After`.
Returns 202 Accepted: the work runs in the background.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Domains are not included here. Fetch them from `GET /tenants/{id}/domains`. When a deploy fails, `last_error` and `error_stage` carry the reason; `diagnostic_message` may appear mid-deploy with a non-fatal hint, such as a readiness probe that is not passing yet.
Changes a tenant's settings. Build and size changes take effect on the next deploy.
Parameters
idstring (path)required
The tenant id (`ten_...`).
display_namestring
display_name
repo_urlstring
repo_url
branchstring
branch
root_directorystring
root_directory
dockerfile_pathstring
dockerfile_path
build_contextstring
build_context
build_context_scopestring
One of: root, repo.
resource_sizestring
One of: small, medium, large.
app_portinteger
app_port
egress_modestring
One of: allow_all, restricted.
health_check_typestring
One of: http, tcp, none.
health_check_pathstring
health_check_path
health_check_portinteger
health_check_port
Errors
400The request is not valid.
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
422A size the plan does not include, or the request was refused.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Not available right now. A write refused during maintenance carries `Retry-After`.
`resource_size` must be `small`, `medium`, or `large`; `egress_mode` must be `allow_all` or `restricted`; `app_port` must be between 1 and 65535. Changes to build or runtime settings take effect on the next deploy. Trigger one with `POST /tenants/{id}/deployments`.
Builds the service from the tip of its branch (or pulls its image) and rolls it out. To apply a configuration change without new code, restart instead.
Parameters
idstring (path)required
The tenant id (`ten_...`).
serviceNamestring (path)required
The service's name within the tenant.
Errors
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
409Another deployment that overlaps this one is running. Retry when it finishes.
422The tenant is deploying, being deleted, or paused over its plan limit.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Deploys are not available right now.
Returns 202 Accepted: the work runs in the background.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Paginated with `limit` and `offset`. `is_current` is scoped to this service: it marks the deployment currently serving traffic for THIS service, and every service in a tenant has its own current deployment.
`has_config_snapshot` reports whether the deployment's configuration was captured, and `has_retained_secrets` whether its secret values are still held. A deployment that captured no secrets reports `has_retained_secrets: true`, because a rollback restores it in full. Together they tell you what a rollback to that deployment would restore before you request it.
Roll one of these back with `POST /api/v1/tenants/{id}/services/{serviceName}/deployments/{depId}/rollback`.
Every deployment of the tenant across its services, newest first.
Parameters
idstring (path)required
The tenant id (`ten_...`).
limitinteger (query)default 20
Page size, up to 100.
offsetinteger (query)default 0
Items to skip.
Errors
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Paginated with `limit` and `offset`. Status moves through `pending` → `building` → `deploying` → `succeeded` or `failed`. Deployments scoped to a single service also carry a `service_id`.
`has_config_snapshot` reports whether the deployment's configuration was captured, and `has_retained_secrets` whether its secret values are still held. A deployment that captured no secrets reports `has_retained_secrets: true`, because a rollback restores it in full. Together they tell you what a rollback to that deployment would restore before you request it.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
On a failure, `error_stage` names the pipeline stage that broke and `build_logs` holds the captured build output. Both are omitted on a clean deploy.
`has_config_snapshot` reports whether the deployment's configuration was captured, and `has_retained_secrets` whether its secret values are still held. A deployment that captured no secrets reports `has_retained_secrets: true`, because a rollback restores it in full. Together they tell you what a rollback to that deployment would restore before you request it.
Adds a domain you own. The response carries the DNS record to create; verify the domain once it is in place.
Parameters
idstring (path)required
The tenant id (`ten_...`).
domainstringrequired
A domain you own, for example `app.example.com`.
typestring
type
is_primaryboolean
is_primary
service_idstring
The service the domain serves. Default: the primary service.
Errors
400Not a valid domain, or a subdomain of the platform's own.
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
409The domain is already in use.
422The plan does not include custom domains.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Not available right now. A write refused during maintenance carries `Retry-After`.
Returns 201. `type` defaults to `custom`, which is what generates the `verification_record` you need for the TXT check. `service_id` is optional and must be a service ID (`svc_...`) belonging to this tenant. Leave it out to route the domain at the primary service. Domains must be valid hostnames of 253 characters or fewer.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
A plain array, not paginated. Filter with `direction` (`inbound` or `outbound`) and `status`, which defaults to `active`. `connection_string` is computed on create and read, not stored, so it is absent from this list.
Opens a service or the database to named addresses (inbound), or lets a tenant in restricted egress mode reach named public addresses (outbound). Rules cannot be edited: delete and create.
Parameters
idstring (path)required
The tenant id (`ten_...`).
directionstringrequired
One of: inbound, outbound.
protocolstringrequired
One of: tcp, udp.
descriptionstring
description
target_servicestring
Inbound: the service, or the database, to open.
target_portinteger
target_port
source_cidrsarray
Inbound: the addresses allowed in.
destination_cidrsarray
Outbound: the public addresses the tenant may reach.
destination_portinteger
destination_port
ttl_hoursinteger
Remove the rule after this many hours.
Errors
400An address range that does not parse, is too wide, or is private.
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
422A plan limit was reached, the range names a platform address, or an outbound rule on a tenant not in restricted mode.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Not available right now. A write refused during maintenance carries `Retry-After`.
Returns 201. `direction` and `protocol` are required: `inbound` or `outbound`, `tcp` or `udp`. Inbound TCP rules get a port from the platform pool in `allocated_port`; when the pool is empty you get 409 `PORT_POOL_EXHAUSTED`.
Outbound rules only work on a tenant with `egress_mode: "restricted"`, otherwise 422 `EGRESS_MODE_REQUIRED`. Each one is folded into a single network policy covering every active outbound rule.
`ttl_hours` sets an expiry, after which the rule is cleaned up automatically; leave it out to use the platform default. CIDRs are validated on the way in: 400 with `INVALID_CIDR`, `CIDR_TOO_WIDE` (`/0` and `/1` are blocked), or `TOO_MANY_CIDRS`. Past your rule limit you get 422 `RULE_LIMIT_REACHED`.
Recent log lines of a single-service tenant as plain text, or a live stream with `follow`. For a tenant with several services, read each service's logs.
Parameters
idstring (path)required
The tenant id (`ten_...`).
linesinteger (query)default 100
How many recent lines to return.
followboolean (query)default false
Keep the response open and stream new lines, for up to 10 minutes.
Errors
401The credentials are missing or not valid.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Templates
Ready-made starting points, and the runtime versions you can build with.
404No such resource. A resource that belongs to another account also answers 404.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Public, same as the list endpoint. The path segment is matched against the template ID first and then its slug, so `/templates/nextjs-postgres` works as well as `/templates/tmpl_nextjs_postgres`. Image-based templates carry an `image` instead of a `starter_repo`.
The account's credentials for private container registries.
Errors
401The credentials are missing or not valid.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
Credentials themselves are never returned by any endpoint. They are encrypted at rest and only decrypted when Staxa talks to the registry. `status` is `active` or `error`; when it is `error`, `last_error` carries the reason from the last attempt.
Stores a credential after checking it against the registry. Images on that registry are then pulled with it.
Parameters
namestringrequired
name
registry_typestringrequired
One of: dockerhub, ghcr, ecr, gcr.
registry_urlstring
Required for `ecr`.
namespacestring
namespace
credentialsobjectrequired
`dockerhub` and `ghcr`: `username` and `password`. `ecr`: the three AWS fields. `gcr`: `service_account_json`.
Errors
400The request is not valid.
401The credentials are missing or not valid.
422The registry refused the credential, or the plan's registry limit was reached.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
503Not available right now. A write refused during maintenance carries `Retry-After`.
Returns 201. `registry_type` must be `dockerhub`, `ghcr`, `ecr`, or `gcr`, and the shape of `credentials` follows from it. `registry_url` defaults per type (`https://index.docker.io/v1/`, `https://ghcr.io`, `https://gcr.io`) but is required for ECR, since the URL carries your account and region.
Credentials are checked against the registry before they are stored, so a bad secret returns 422 `REGISTRY_VERIFICATION_FAILED` and nothing is saved. That is also why the credential comes back already `active`. Past your credential limit you get 422 `REGISTRY_LIMIT_REACHED`.
`namespace` scopes repository listings to one organisation or project.
The account's API keys, without the keys themselves. Revoked keys are left out.
Errors
401The credentials are missing or not valid.
429Too many requests. See the `X-RateLimit-*` headers and retry later.
`prefix` is the first 16 characters of the key: enough to identify it in a list, not enough to use it. Revoked keys stay in the list with `status: "revoked"`.