Coderunners API
Create, upload, deploy, run and promote Coderunners.
Base path: /v1/workspaces/{workspace_id}/coderunners
Coderunner is the deploy path for functions, jobs, schedules, and services. No App is required. See Developers for gf deploy and MCP.
See also: Coderunner
Auth
All routes: Authorization: Bearer <JWT>. Forwarded to Coderunner with x-client-key (workspace id) and x-userid.
Mint a short-lived CR JWT for testing from curl or Postman:
POST /v1/workspaces/{workspace_id}/coderunner/dev-tokenPermission: write. A read-only member, or a token that only carries read, gets 403. Every mint is recorded in the audit log.
Response: token, expires_in (seconds; 300 by default), base_url (the public Coderunner API URL to call with the token), workspace_id (send as the x-client-key header) and user_id (send as x-userid). Tokens can't be revoked, so treat one like any other bearer and let it expire.
List / create
| Method | Path | Permission | Notes |
|---|---|---|---|
GET | /v1/workspaces/{workspace_id}/coderunners | read | Query: environment_id, app_id |
POST | same | write | Body below. Returns 201 |
Create body:
| Field | Required | Default | Notes |
|---|---|---|---|
title | Yes | 1-120 characters (name is accepted as an alias) | |
runtime | No | node | A language slug from GET …/coderunners/languages |
workload_type | No | function | function | job | schedule | service |
slug | No | Derived from title | Lowercase letters, digits and hyphens, up to 63 characters. A slug already used in the workspace is 409 |
environment_id | No | The active dev environment (or the only active one) | |
app_id | No | none | Links the coderunner to an App; doesn't change how it deploys |
schedule | No | none | Cron expression, for workload_type: schedule |
description | No | none | Up to 2,000 characters |
Workspace site auth is not required.
GET /v1/workspaces/{workspace_id}/coderunners/languagesLists the languages Coderunner supports; use the runtime slugs it returns. Permission: read
Get / update / delete / status
| Method | Path | Permission |
|---|---|---|
GET | …/coderunners/{id} | read |
PATCH | …/coderunners/{id} | write |
DELETE | …/coderunners/{id} | delete |
GET | …/coderunners/{id}/status | read |
GET / list / status flatten workload_type, schedule, last_job_name, and last_job_status from the manifest.
status also returns deployment_status, the state of the current deployment: 1 pending, 2 processing, 3 deployed, 4 failed, 5 deleting, 6 deleted, 7 stopped, or null when unknown. deployment_status_message gives the reason, usually when it failed. While the current deployment has failed, an app address or custom domain that routes to it answers 503 instead of an empty response.
Versions and upload
| Method | Path | Purpose | Permission |
|---|---|---|---|
POST | …/{id}/upload | Multipart ZIP → new version (max 64 MiB) | write |
GET | …/{id}/versions | List versions | read |
GET | …/{id}/versions/{version_id} | Get version | read |
GET | …/{id}/versions/{version_id}/download | Download package | read |
DELETE | …/{id}/versions/{version_id} | Delete version | write |
POST | …/{id}/definition | Ensure upstream definition | write |
Deploy and run
POST /v1/workspaces/{workspace_id}/coderunners/{id}/deployBody (optional): version_id, cpu, memory, envVariable, inject_secret_keys, minReplicas, maxReplicas (or replicas to set both at once — this is the autoscaling band for function/service; each is 0-100), schedule, suspended.
envVariable can't carry secrets: a key that looks like a credential is rejected with 422 and the offending keys are named in the response. That covers names ending in _PASSWORD, _SECRET, _PRIVATE_KEY, _API_KEY, _ACCESS_KEY or _SECRET_KEY, common database connection names (DATABASE_URL, POSTGRES_PASSWORD, MONGODB_URI and similar) and anything starting with MANAGED_DB_.
Don't pass secrets at deploy time: with the platform's default configuration, inject_secret_keys returns 422. Have the workload read secrets at runtime with an M2M client that has the secrets:read scope. See Secrets in a workload.
POST /v1/workspaces/{workspace_id}/coderunners/{id}/runBody (optional): the event JSON object itself, forwarded as-is to the handler — do not wrap it in payload. A non-object body is 422. Targeting is query-only: ?version_id=, ?deployment_id=, ?deployment_url= (preferred).
curl -sS -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"hello":"world"}' \
"https://platform.groundfloor.cloud/v1/workspaces/$WORKSPACE_ID/coderunners/$CODERUNNER_ID/run"Groundfloor calls your Coderunner with its own short-lived token; your token is never passed on.
| Method | Path | Permission |
|---|---|---|
GET | …/{id}/deployment (optional ?version_id= adds version_deployment_id, the deployment recorded for that version) | read |
GET | …/{id}/deployments/{deployment_id} | read |
DELETE | …/{id}/deployments/{deployment_id} | write |
GET | …/{id}/logs/{job_id} | read |
Permission for deploy/run: write
Public Deployment URL on list/detail comes from the upstream ExternalEndpoint for non-schedule workloads.
Public front door
Service workloads are served from a stable public host. You can take one off the public front door, and put it back, without redeploying:
| Method | Path | Permission |
|---|---|---|
GET | …/coderunners/{id}/public | read |
PUT | …/coderunners/{id}/public | write |
PUT body: { "enabled": false }. Both return { "enabled": true, "host": "…" }. With enabled: false the service's branded host and any custom domains stop resolving; the host is kept, so enabled: true restores the same URL. Turning a service off still works on a frozen workspace; turning it back on does not (423). Only service workloads can be switched; other workloads return 400.
Git source
| Method | Path | Permission |
|---|---|---|
GET / PUT / PATCH / DELETE | …/{id}/git-source | read / write |
POST | …/{id}/git-source/deploy | write (202) |
PUT creates the git source, or replaces it if one exists. Body:
| Field | Required | Notes |
|---|---|---|
repo_url | Yes | https URLs only |
ref | No | Defaults to main |
subdir | No | Subdirectory to build from |
secret_key | No | Name of a workspace secret holding a token for private repos |
The create response includes webhook_secret once; PATCH accepts the same fields (all optional) plus rotate_webhook_secret: true, which mints a new secret and returns it in that response. Webhook: POST /v1/webhooks/git/{source_id}, verified with a GitHub X-Hub-Signature-256 signature. POST …/git-source/deploy returns 409 while a git deploy is already running, and 404 if no git source is configured.
Domains
Custom domains belong to Apps, not Coderunners. The …/{id}/domains routes here always return 400 ("Custom domains are available on Apps, not standalone coderunners."). To give a service a domain, make it the primary_coderunner_id of a standalone App and use the App's domain routes. A Coderunner on its own is reached at its Deployment URL.
Compare and promote
GET /v1/workspaces/{workspace_id}/coderunners/compare?source_environment_id=&target_environment_id=
POST /v1/workspaces/{workspace_id}/coderunners/promotePromote body:
| Field | Required | Notes |
|---|---|---|
source_environment_id | Yes | Must differ from the target; both environments must be active |
target_environment_id | Yes | |
pairs[] | Yes | At least one. Each pair: source_coderunner_id (required), optional target_coderunner_id (created in the target environment if omitted) and version_id |
dry_run | No | Default false. A dry run is synchronous and starts no work |
Response: {source_environment_id, target_environment_id, dry_run, promoted[], failed[], background}. Each result has source_coderunner_id, target_coderunner_id, version_id, deployment_id, created_target, error and a status of accepted (the promote continues in the background; background is true), completed or failed. Poll compare or the target's deployment status to see the outcome.
Limits
| Limit | Value |
|---|---|
ZIP upload (…/upload) | 64 MiB; larger is 413, an empty ZIP is 400 |
replicas, minReplicas, maxReplicas | 0-100 |
Duplicate slug on create | 409 |
Credential-shaped envVariable keys | 422 (see Deploy and run) |
Runners and executions
| Method | Path | Purpose | Permission |
|---|---|---|---|
GET | /v1/workspaces/{workspace_id}/runners | List deployments | read |
GET | …/runners/{runner_id} | Get runner | read |
POST | …/runners/{runner_id}/restart | Restart | write |
GET | /v1/workspaces/{workspace_id}/executions | List executions | read |
Related
- M2M API — attach a client (
PUT …/coderunners/{id}/m2m) thenPOST …/m2m/token - Apps API
- Process log API