CTRLctrl docs

API reference

The CTRL API lives at https://api.getctrl.dev. Every endpoint below is under /v1, takes and returns JSON, and answers errors as { "error": "..." } with a matching status code.

Authentication#

Send your API key as a bearer token on every /v1 request.

Authorization: Bearer <your API key>
curl https://api.getctrl.dev/v1/apps \
  -H "Authorization: Bearer <your API key>"

A missing, malformed or unknown key answers 401 with { "error": "invalid api key" }. You sign in with GitHub at https://api.getctrl.dev/auth/github; after that you can create named keys with POST /v1/account/api-keys.

Rate limits per account, per 60 seconds (reads are never limited):

Requests Limit
Any POST, PUT, PATCH or DELETE 120
POST /v1/apps, POST /v1/apps/:app_id/redeploy, POST /v1/apps/:app_id/rollback, POST /v1/projects/:id/environments 10

Past a limit you get 429 with a Retry-After: 60 header.

Blocks#

You buy capacity in blocks. One block is 1 vCPU, 2 GB RAM and 30 GB disk for $5 a month. Your apps share your blocks, and you size each app freely: a fraction of a block, one, or several.

  • A single app (every copy of it, with HA) can never be bigger than your blocks.
  • The sizes of all your apps added together may go past your blocks. What your apps really use is capped at your blocks.
  • A stopped app holds none of your blocks. Volumes and snapshots hold their disk whether the app runs or not.

App sizes:

Field Rule
cpu_millis CPU share in thousandths of a vCPU. At least 100 (0.1 vCPU), in steps of 50.
vcpu_count Whole vCPUs, as a shorthand. cpu_millis wins when you send both.
mem_size_mb At least 256.
disk_size_mb At least 5120.

A deploy, start, resize or volume answers 402 when one app would be bigger than your blocks, or when your apps already really use all of them. The error says how much.

Apps#

GET /v1/apps#

List your apps.

[
  {
    "app_id": "octocat-my-repo-main",
    "name": "My API",
    "status": "running",
    "cpu_millis": 500,
    "mem_size_mb": 1024,
    "disk_size_mb": 10240,
    "region": "us-east",
    "subdomain": "octocat-my-repo-main.getctrl.dev",
    "created_at": "2026-05-01 12:00:00",
    "project_id": "prj_...",
    "environment_id": "env_..."
  }
]

GET /v1/apps/deploy-id#

The app_id that POST /v1/apps would give a repo and branch, so you can watch a deploy from its first second.

Query Description
repo Required. The repo name.
branch Required. The branch.
environment_id Optional. Defaults to your default project's production environment.
{ "app_id": "octocat-my-repo-main", "exists": false }

exists: true means POST /v1/apps would answer 409.

POST /v1/apps#

Deploy a new app from a container image or a GitHub repository.

curl -X POST https://api.getctrl.dev/v1/apps \
  -H "Authorization: Bearer <your API key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My API",
    "repo": "my-repo",
    "branch": "main",
    "image_ref": "ghcr.io/acme/my-api:latest",
    "region": "us-east",
    "exposed_port": 8080,
    "cpu_millis": 500,
    "mem_size_mb": 1024,
    "disk_size_mb": 10240,
    "env_vars": [["PORT", "8080"]],
    "add_database": false
  }'
Field Description
name Display name.
repo, branch Used to build the app_id from your GitHub login, the repo and the branch.
image_ref A container image. Send exactly one of image_ref and repo_url.
repo_url https://github.com/<owner>/<repo>. Needs your GitHub connection.
region A region from GET /v1/regions.
exposed_port The port your app listens on.
cpu_millis or vcpu_count, mem_size_mb, disk_size_mb The app's size. See Blocks.
env_vars Optional. A list of [key, value] pairs.
registry_auth Optional. { "username": "...", "password": "..." } for a private image.
add_database Optional. true adds a managed MySQL database.
environment_id Optional. The environment to deploy into.

Response 201:

{
  "app_id": "octocat-my-repo-main",
  "vm_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "running",
  "region": "us-east",
  "node_id": "us-1",
  "subdomain": "octocat-my-repo-main.getctrl.dev",
  "name": "My API"
}

Response 202 has the same body with status: "starting" and no vm_id: the deploy outlasted the request and carries on. Poll GET /v1/apps/:app_id until status is running. A 404 there means the deploy failed, and the error says why.

If you asked for a database and it could not be created, the app still deploys and the body carries database_error with the reason.

Status Meaning
400 Invalid input: a bad size, both or neither of image_ref and repo_url, a repo_url that isn't GitHub, or GitHub not connected.
402 No blocks, payment past due, subscription canceled, or not enough blocks.
404 environment_id not found.
409 The app_id is already in use, or the environment isn't ready.
502 The node failed to deploy the app.
503 No capacity in the region, or the app can't be served right now.

GET /v1/apps/:app_id#

Get one app in detail.

{
  "app_id": "octocat-my-repo-main",
  "name": "My API",
  "vm_id": "550e8400-...",
  "status": "running",
  "region": "us-east",
  "node_id": "us-1",
  "image_ref": "ghcr.io/acme/my-api:latest",
  "exposed_port": 8080,
  "repo": "my-repo",
  "branch": "main",
  "subdomain": "octocat-my-repo-main.getctrl.dev",
  "repo_full_name": "",
  "env_vars": "[[\"PORT\",\"8080\"]]",
  "created_at": "2026-05-01 12:00:00",
  "proxied": true,
  "vcpu_count": 1,
  "cpu_millis": 500,
  "mem_size_mb": 1024,
  "disk_size_mb": 10240,
  "project_id": "prj_...",
  "environment_id": "env_...",
  "instance_count": 1,
  "copies": [{ "node_id": "us-1", "primary": true, "reachable": true }],
  "ha_blocked": null
}

env_vars is a JSON string of [key, value] pairs. repo_full_name is owner/repo for a GitHub app and empty for an image app. In copies, reachable is null when there is no recent report. ha_blocked says why HA can't be turned on, or is null when it can or already is.

PATCH /v1/apps/:app_id/resources#

Resize an app. Send any of cpu_millis (or vcpu_count), mem_size_mb and disk_size_mb. A running app restarts at the new size; a stopped one keeps it for its next start.

{ "cpu_millis": 1000, "mem_size_mb": 2048 }
{ "ok": true, "redeployed": true, "cpu_millis": 1000, "vcpu_count": 1, "mem_size_mb": 2048, "disk_size_mb": 10240 }
Status Meaning
400 Invalid size.
402 Bigger than your blocks, or no blocks or subscription.
409 The app is still deploying, or its node has no room for the new size.
502 The restart failed. The app keeps its old size.
503 The node can't be read right now.

PATCH /v1/apps/:app_id/ha#

Turn high availability on or off. On runs two copies of the app on two nodes, and both count against your blocks.

{ "enabled": true }
{ "ok": true, "enabled": true, "copies": ["us-1", "us-2"] }

HA needs a running app with no volume and no database, and is not available for previews. A refusal answers 400, 402 or 409 with the reason.

PUT /v1/apps/:app_id/env#

Replace the app's environment variables and redeploy with them. The variables are saved even if the redeploy fails.

{ "env_vars": [["PORT", "8080"], ["NODE_ENV", "production"]] }
{ "ok": true, "redeployed": true }

If the redeploy fails:

{ "ok": true, "redeployed": false, "error": "..." }

POST /v1/apps/:app_id/env/promote#

Copy environment variables from another of your apps into this one. Database variables are never copied.

{ "from": "octocat-my-repo-main-staging" }

Without confirm, you get a preview of the key names only:

{ "add": ["NEW_KEY"], "overwrite": ["CHANGED_KEY"], "skipped": ["DATABASE_URL"] }

Send "confirm": true to apply it. The answer is the same as PUT /v1/apps/:app_id/env.

GET /v1/apps/:app_id/logs#

Fetch recent log lines.

Query Default Description
tail 100 Number of lines, at most 1000.
type runtime build for the build log, runtime for the app's output.
node the app's node With HA, the node of the copy to read.
{ "lines": ["Server listening on :8080"] }

GET /v1/apps/:app_id/uptime#

Uptime for this month and the last 30 days, worked out from crash and out-of-memory alerts.

{
  "this_month": { "uptime_pct": 99.98, "downtime_minutes": 6, "measured_minutes": 34560 },
  "last_30_days": { "uptime_pct": 99.98, "downtime_minutes": 6, "measured_minutes": 43200 },
  "source": "alerts"
}

DELETE /v1/apps/:app_id#

Delete an app. Stops its VM, removes its routing, custom domains and deploy history.

{ "ok": true }

Answers 409 while the app has a volume (the body carries volume_id): delete or detach the volume first. Also 409 while the app is still deploying.

Deploys#

GET /v1/apps/:app_id/deploys#

List an app's deploys, newest first.

[
  {
    "id": "deploy-uuid",
    "commit_sha": "abc1234...",
    "commit_msg": "fix: login bug",
    "trigger": "push",
    "status": "success",
    "duration_ms": 45000,
    "error": null,
    "created_at": "2026-05-01 12:00:00",
    "finished_at": "2026-05-01 12:00:45"
  }
]

POST /v1/apps/:app_id/redeploy#

Redeploy an app with its current environment variables. Use it from CI after you push a new image.

curl -X POST https://api.getctrl.dev/v1/apps/octocat-my-repo-main/redeploy \
  -H "Authorization: Bearer <your API key>"
{ "ok": true, "redeployed": true, "deploy_id": "new-deploy-uuid" }

Errors carry "ok": false, "redeployed": false and an error.

Status Meaning
400 GitHub not connected (GitHub apps), or no image stored.
402 No blocks, subscription canceled, or not enough blocks to start it.
404 App not found.
409 A node can't take the deploy right now, for example its volume can't be attached.
502 The deploy or routing failed.
503 The app's node was not found.

POST /v1/apps/:app_id/rollback#

Roll a GitHub app back to an earlier deploy by building that deploy's commit again.

{ "deploy_id": "deploy-uuid" }
{ "ok": true, "deploy_id": "new-deploy-uuid" }
Status Meaning
400 An image app (deploy history keeps no images), no commit recorded, or GitHub not connected.
402 No blocks, subscription canceled, or not enough blocks.
404 App or deploy not found.
409 A node can't take the deploy, or its agent is too old to build a given commit.
502 The rollback failed, for example the commit no longer exists.
503 The app's node was not found.

Custom domains#

Point your own hostname at an app. You prove you own it with a TXT record, then point it at CTRL with a CNAME. An app can have up to 5 custom domains.

Each domain looks like this:

{
  "hostname": "www.example.com",
  "verified": true,
  "verified_at": "2026-05-01 12:00:00",
  "created_at": "2026-05-01 11:50:00",
  "record": { "type": "TXT", "name": "_ctrl-verify.www.example.com", "value": "ctrl-verify=<token>" },
  "dns": { "type": "CNAME", "name": "www.example.com", "value": "customers.getctrl.dev" },
  "status": "serving",
  "problem": null,
  "serving": true,
  "primary": true
}

status is one of unverified, waiting_for_dns, issuing_certificate, serving or problem, and problem says what's wrong in the last case. For an apex domain, your DNS provider needs CNAME flattening or an ALIAS record. When you add both example.com and www.example.com, the primary one serves and the other redirects to it.

GET /v1/apps/:app_id/domains#

List an app's custom domains.

{ "domains": [] }

POST /v1/apps/:app_id/domains#

Add a hostname. Returns the domain, with the TXT record to create, as 201.

{ "hostname": "www.example.com" }

Refuses IP addresses, wildcards, bare TLDs and getctrl.dev names (400), and a hostname you already added, one another account verified, or a sixth domain (409).

POST /v1/apps/:app_id/domains/:hostname/verify#

Check DNS for the TXT record.

{ "verified": true, "domain": {} }

If the record isn't found yet, you get verified: false with a reason (not_found or dns_error), a message and the domain. Checking the same domain again within 10 seconds answers 429. 409 means another account verified the hostname first.

PATCH /v1/apps/:app_id/domains/:hostname#

Make this domain the primary of a www and apex pair. The other one redirects to it.

{ "primary": true }

Answers the updated domain. 409 if the app doesn't have the other half of the pair.

DELETE /v1/apps/:app_id/domains/:hostname#

Remove a custom domain.

{ "ok": true }

Volumes#

A volume is a disk for one app, mounted at one path. It survives redeploys, rollbacks, environment variable changes and host reboots. Its size counts against your blocks' disk.

  • A volume lives on one node and is not backed up. If that node's disk dies, the data is gone. Take snapshots, or copy off what you can't lose.
  • An app with a volume can't move to another node, and has a short downtime on every deploy: the old VM stops before the new one boots. Your app gets SIGTERM and 5 seconds to finish.
  • Previews never get a volume. A rollback changes code, not the data on the volume.
  • The mount hides whatever the image has at that path.

A volume looks like this:

{
  "id": "vol-...",
  "name": "uploads",
  "app_id": "octocat-my-repo-main",
  "node_id": "us-1",
  "mount_path": "/data",
  "size_mb": 10240,
  "status": "ready",
  "restore_id": null,
  "restore_error": null,
  "created_at": "2026-05-01 12:00:00"
}

Calls that restart the app answer with redeployed, app_status (whether the app is running now) and, if the restart failed, error.

POST /v1/volumes#

Create a volume for an app and restart the app with it mounted. A stopped app gets it at its next deploy.

{ "app_id": "octocat-my-repo-main", "name": "uploads", "mount_path": "/data", "size_mb": 10240 }
Field Rule
name Lowercase letters, digits and dashes, up to 63 characters, starting with a letter or digit.
mount_path Absolute. Not /, not under /proc, /sys, /dev or /etc, no ...
size_mb A whole number from 1024 to 16777216.

Response 201:

{ "volume": { "id": "vol-...", "name": "uploads" }, "redeployed": true, "app_status": "running" }

402 when the volume doesn't fit your blocks. 409 when the app already has a volume or its node has no room.

GET /v1/volumes#

List your volumes. Add ?app_id= to filter by app.

GET /v1/volumes/:id#

One volume, plus allocated_mb: the disk reserved for it on the node, which is its whole size. It is null if the node didn't answer. Only df inside your app can tell you how full it is.

PATCH /v1/volumes/:id#

Grow a volume. Volumes only grow.

{ "size_mb": 20480 }

Answers { "volume": {}, "redeployed": true, "app_status": "running" }. The app restarts to apply it; a stopped app grows at its next deploy. If the node can't grow it all the way, error says so.

DELETE /v1/volumes/:id#

Stop the app, destroy the volume, its snapshots and all its data, and restart the app without it. There is no undo. Pass ?confirm= with the volume's name.

curl -X DELETE "https://api.getctrl.dev/v1/volumes/vol-...?confirm=uploads" \
  -H "Authorization: Bearer <your API key>"
{ "ok": true, "redeployed": true, "app_status": "running" }

409 while a snapshot or restore of the volume is running.

POST /v1/volumes/:id/detach#

Free a volume from its app and keep the data. app_id becomes null. The app stops and restarts without the volume. A detached volume stays on its node and still counts against your disk.

POST /v1/volumes/:id/attach#

Attach a detached volume to another app on the same node that has no volume of its own.

{ "app_id": "octocat-worker-main" }

The app restarts with the volume mounted; a stopped app gets it at its next deploy. 409 if the app is on another node: a volume's data stays on its node.

Snapshots#

A snapshot copies a volume into object storage. You take them when you ask; a volume keeps at most 7. Each counts against your disk: at the volume's size while pending, at its compressed size once ready.

A snapshot looks like this:

{
  "id": "snap-...",
  "volume_id": "vol-...",
  "status": "ready",
  "size_bytes": 52428800,
  "error": null,
  "created_at": "2026-05-01 12:00:00"
}

status is pending, ready or failed, with error saying why.

POST /v1/volumes/:id/snapshots#

Take a snapshot. The app stops while the node copies the volume and starts again before the upload, which runs on its own.

Response 202:

{ "snapshot": { "id": "snap-...", "status": "pending" }, "app_status": "running" }

409 when the volume already has 7 snapshots or is being restored.

GET /v1/volumes/:id/snapshots#

List a volume's snapshots, newest first.

POST /v1/volumes/:id/snapshots/:snapshot_id/restore#

Replace all the data on the volume with the snapshot's. Stop the app first; it gets the restored data at its next start.

Response 202:

{ "restoring": "snap-..." }

The volume's restore_id shows while it runs, and restore_error says why one failed. A failed restore leaves the data as it was.

DELETE /v1/volumes/:id/snapshots/:snapshot_id#

Delete a snapshot.

{ "ok": true }

409 while it is still being taken or being restored.

Databases#

Each app can have one managed MySQL database, on the app's node.

POST /v1/apps/:app_id/database#

Create a database for an app. Its credentials are added to the app's environment as DATABASE_URL, DB_HOST, DB_PORT, DB_NAME, DB_USER and DB_PASSWORD.

Response 201:

{
  "database_id": "octocat-my-repo-main-db",
  "db_name": "octocat_my_repo_main_db",
  "db_user": "u_abc12345",
  "host": "10.0.0.2",
  "port": 3306,
  "connection_string": "mysql://u_abc12345:<password>@10.0.0.2:3306/octocat_my_repo_main_db",
  "status": "active"
}

This is the only time the password is shown in a response.

Status Meaning
409 The app already has a database, or the name is taken.
502 Creating the database failed.
503 No database node is available, or MySQL is still starting (retry after 30 seconds).

GET /v1/apps/:app_id/database#

Get the database's details, with the password masked as ****. Same fields as above, plus created_at.

DELETE /v1/apps/:app_id/database#

Delete the database and remove its variables from the app's environment.

{ "ok": true, "database_id": "octocat-my-repo-main-db" }

GET /v1/apps/:app_id/database/backups#

List the database's backups. Backups run daily at 03:00 UTC.

[
  {
    "id": "backup-uuid",
    "r2_key": "...",
    "size_bytes": 1048576,
    "status": "completed",
    "created_at": "2026-05-01 03:00:00",
    "finished_at": "2026-05-01 03:00:05"
  }
]

POST /v1/apps/:app_id/database/restore#

Restore the database from a backup.

{ "backup_id": "backup-uuid" }
{ "ok": true, "backup_id": "backup-uuid" }

400 if the backup isn't completed, 404 if it isn't found, 502 if the restore failed.

Metrics#

GET /v1/apps/:app_id/metrics#

Time series of CPU, memory, network and requests.

Query Values Default
period 1h, 24h, 7d 1h
{
  "period": "1h",
  "points": [
    {
      "timestamp": "2026-05-01T12:00:00.000Z",
      "cpu": 12.5,
      "memory_mb": 50.0,
      "rx_bps": 1024,
      "tx_bps": 512,
      "requests": 600,
      "rps": 10,
      "s2xx": 570,
      "s4xx": 24,
      "s5xx": 6,
      "avg_ms": 50,
      "max_ms": 800
    }
  ],
  "totals": { "rx_bytes": 3686400, "tx_bytes": 1843200, "requests": 36000, "s2xx": 34200, "s4xx": 1440, "s5xx": 360 },
  "countries": [
    { "code": "US", "requests": 21000 },
    { "code": "other", "requests": 6000 }
  ]
}

Buckets are 1 minute for 1h, 15 minutes for 24h and 1 hour for 7d. avg_ms and max_ms are time to first byte, null in a bucket with no requests. countries is the top 10 visitor countries by request, then other. The request fields and countries are left out when they can't be read. 400 for an invalid period, 404 if the app isn't yours.

Projects#

Projects group your apps into environments, such as production and staging. Every account has a default project. You can have up to 10 projects, each with up to 5 environments.

GET /v1/projects#

List your projects with their environments.

[
  {
    "id": "prj_...",
    "name": "default",
    "environments": [
      { "id": "env_...", "name": "production", "slug": "production", "status": "ready", "app_count": 3 }
    ]
  }
]

POST /v1/projects#

Create a project. It starts with a production environment.

{ "name": "My project" }

Response 201:

{ "id": "prj_...", "name": "My project" }

Names are 1 to 40 characters. 409 when you reach 10 projects.

PATCH /v1/projects/:id#

Rename a project.

{ "name": "New name" }

DELETE /v1/projects/:id#

Delete an empty project.

{ "deleted": true }

409 for the default project, or while the project still has apps.

POST /v1/projects/:id/environments#

Create an environment, empty or as a copy of another environment in the project.

{ "name": "staging", "copy_from_env_id": "env_...", "deploy_now": true, "keep_flagged": {} }
Field Description
name 1 to 40 characters. It also gives the environment's slug.
copy_from_env_id Optional. Copy this environment's apps. Database variables are not copied.
keep_flagged Optional. Copied variables whose values name the source's apps or databases are blanked. Map a source app_id to the keys to keep as they are.
deploy_now Optional. true deploys the copies; otherwise they are saved stopped.

Response 201:

{
  "environment": { "id": "env_...", "project_id": "prj_...", "name": "staging", "slug": "staging", "status": "copying", "detail": null, "created_at": "..." },
  "flagged_by_app": { "octocat-my-repo-main": ["API_URL"] }
}

A copy runs in the background with status: "copying" until it is ready. 409 when the slug is taken or you reach 5 environments.

GET /v1/projects/:id/environments/:env_id#

Get an environment with its apps.

{
  "environment": { "id": "env_...", "name": "production", "slug": "production", "status": "ready" },
  "apps": [
    {
      "app_id": "octocat-my-repo-main",
      "name": "My API",
      "status": "running",
      "size": { "cpu_millis": 500, "mem_size_mb": 1024, "disk_size_mb": 10240 },
      "region": "us-east",
      "subdomain": "octocat-my-repo-main.getctrl.dev",
      "created_at": "2026-05-01 12:00:00",
      "database": null,
      "proxied": true,
      "instances": 1,
      "source": "octocat/my-repo@main"
    }
  ],
  "layout": null
}

PATCH /v1/projects/:id/environments/:env_id#

Rename an environment.

{ "name": "qa" }

DELETE /v1/projects/:id/environments/:env_id#

Delete an environment and all its apps. confirm must be the environment's name.

{ "confirm": "staging" }

Answers 202 with the environment at status: "deleting". The default project's production environment can't be deleted, and neither can a project's only environment.

POST /v1/projects/:id/environments/:env_id/retry-delete#

Try again to delete an environment whose delete failed. Answers 202.

Regions#

GET /v1/regions#

List the regions you can deploy to.

[{ "region": "us-east", "node_count": 2 }]

Account#

GET /v1/account#

Get your account, your blocks, and what your apps use of them.

{
  "id": "acc-uuid",
  "github_login": "octocat",
  "github_avatar_url": "https://avatars.githubusercontent.com/...",
  "is_admin": false,
  "alert_emails": true,
  "simple_mode": false,
  "blocks": {
    "count": 2,
    "limits": { "cpu_millis": 2000, "mem_mb": 4096, "disk_mb": 61440 }
  },
  "usage": { "cpu_millis": 1500, "vcpu": 1.5, "mem_mb": 2048, "disk_mb": 30720 },
  "real": { "cpu_millis": 300, "mem_mb": 512, "disk_mb": 4096 },
  "over_allocated": false,
  "subscription_status": "active",
  "cancel_at_period_end": false,
  "current_period_end": "2026-06-01T00:00:00Z",
  "created_at": "2026-04-01 00:00:00"
}

usage is what your running apps, volumes and snapshots are sized to. real is what they really use, which your blocks cap. over_allocated is true when usage is past your blocks.

GET /v1/account/usage/live#

What your apps use right now, from the nodes' last reports. Cached for 10 seconds.

{ "cpu_cores": 0.3, "mem_mb": 512, "nodes": 1, "at": "2026-05-01T12:00:00Z", "disk_mb": 4096 }

GET /v1/account/alerts#

Your active alerts and any from the last 7 days, newest first, at most 50.

[
  {
    "id": "...",
    "app_id": "octocat-my-repo-main",
    "account_id": "acc-uuid",
    "type": "crash",
    "message": "...",
    "status": "active",
    "created_at": "2026-05-01 12:00:00",
    "resolved_at": null
  }
]

PATCH /v1/account/settings#

Change your settings. Send at least one of alert_emails and simple_mode, as booleans.

{ "alert_emails": false }
{ "alert_emails": false }

GET /v1/account/audit#

Your account's audit log, newest first.

Query Default Description
limit 50 1 to 100.
before An event id: return events older than it.
{
  "events": [
    { "id": 1042, "action": "app.redeploy", "app_id": "octocat-my-repo-main", "detail": { "deploy_id": "..." }, "created_at": "2026-05-01 12:00:00" }
  ],
  "next_before": null
}

Pass next_before as before to get the next page. It is null on the last page.

API keys#

GET /v1/account/api-keys#

List your named API keys. The full key is never shown here.

[{ "id": "uuid", "name": "github-actions", "prefix": "ctrl_ab12", "created_at": "2026-05-01 12:00:00", "last_used_at": null }]

POST /v1/account/api-keys#

Create a named key, up to 10 per account. The full key is shown once, in this response.

{ "name": "github-actions" }

Response 201:

{ "id": "uuid", "name": "github-actions", "prefix": "ctrl_ab12", "created_at": "2026-05-01 12:00:00", "last_used_at": null, "api_key": "<your new API key>" }

400 if the name isn't 1 to 64 characters, 409 when you have 10 keys.

DELETE /v1/account/api-keys/:id#

Revoke a key. It stops working on the next request.

{ "ok": true }

POST /v1/account/api-key#

Rotate your original account key. Named keys are not affected.

{ "api_key": "<your new API key>" }

Billing#

POST /v1/billing/checkout#

Start a checkout for your first blocks. Answers a Stripe Checkout URL to send the browser to.

{ "blocks": 2, "success_url": "https://example.com/done", "cancel_url": "https://example.com/cancel" }
{ "url": "https://checkout.stripe.com/..." }

blocks is a whole number from 1 to 1000. 409 if you are already subscribed: change your block count instead.

GET /v1/billing/preview#

What changing to the block count in ?blocks= would charge now. A negative amount is a credit.

{ "blocks": 3, "amount_cents": 500, "currency": "usd", "proration_date": 1780000000 }

POST /v1/billing/blocks#

Change your block count. You can't go below what your apps really use right now.

{ "blocks": 3 }
{ "ok": true, "blocks": 3 }

400 if the count is invalid, below your real use, or you have no subscription yet. 402 if the payment didn't go through: your blocks stay as they were.

GET /v1/billing/invoices#

Your next charge and your recent invoices.

{
  "next": { "amount_cents": 1000, "currency": "usd", "date": 1780000000 },
  "invoices": [
    { "id": "in_...", "number": "ABC-0001", "status": "paid", "amount_cents": 1000, "currency": "usd", "created": 1777000000, "url": "https://invoice.stripe.com/..." }
  ]
}

With no subscription, next is null and invoices is empty.

POST /v1/billing/portal#

Open the Stripe billing portal to manage your subscription.

{ "return_url": "https://example.com/account" }
{ "url": "https://billing.stripe.com/..." }

GitHub#

These need your GitHub connection, made when you sign in with GitHub.

GET /v1/github/repos#

List your 50 most recently pushed repositories.

[
  {
    "full_name": "octocat/my-repo",
    "name": "my-repo",
    "private": false,
    "default_branch": "main",
    "language": "TypeScript",
    "pushed_at": "2026-05-01T12:00:00Z"
  }
]

GET /v1/github/repos/:owner/:repo/branches#

List a repository's branches, up to 50.

[{ "name": "main" }]

GET /v1/github/repos/:owner/:repo/dockerfile#

Check whether the repository has a Dockerfile at its root. Add ?ref= for a branch; the default is main.

{ "exists": true }