Apps API
Register Shell and standalone apps, publish releases, and promote across environments.
Base path: /v1/workspaces/{workspace_id}/apps
Apps are optional product packaging. Do not create an app solely to deploy a workload — use the Coderunners API. app_kind=coderunner is rejected on create.
See also: Apps
List apps
GET /v1/workspaces/{workspace_id}/apps?kind=product| Query | Values |
|---|---|
kind | product (default: shell_federated and standalone), shell_federated, standalone, all. The legacy value coderunner is also accepted; anything else returns 422 |
include_archived | true to include archived apps. Default false |
environment_id | Only apps of this environment. Default: every environment, except for site users (see Shell sites per environment) |
Returns at most 200 apps.
Each app has environment_id, site_slug and lineage_id. site_slug is the app's path on its environment's Shell site, /apps/{site_slug}: unique among the Shell apps of one environment, and kept by promoted copies. slug stays unique in the workspace and is what the CLI and the manifest's appId use. lineage_id links an app and its promoted copies (it's the original's id).
Permission: read
Create app
POST /v1/workspaces/{workspace_id}/appsPermission: write (workspace site auth is not required)
| Body field | Required | Notes |
|---|---|---|
name | Yes | Display name |
slug | Yes | Unique in workspace. Lowercase letters, digits and hyphens, 1 to 63 characters; a duplicate returns 409 |
app_kind | No | shell_federated (default) or standalone |
environment_id | No | Target environment. Defaults to the dev environment (or the only active one) |
primary_coderunner_id | Standalone | Primary service coderunner. Must be in this workspace (404 otherwise), not archived (409), and a service workload (400) |
manifest | No | JSON manifest |
git_repo_url | No | Source repo metadata |
Get / update / delete
| Method | Path | Permission |
|---|---|---|
GET | /v1/workspaces/{workspace_id}/apps/{app_id} | read |
PATCH | same — name, manifest, git_repo_url, primary_coderunner_id | write |
DELETE | same — archives the app. Returns 204 | delete |
POST | …/apps/{app_id}/restore — un-archives the app. 409 if the app is not archived, or, for a legacy coderunner app, if the workspace is at its plan's Coderunner limit (with X-Groundfloor-Reason: plan_limit) | delete |
GET | …/apps/by-slug?slug= — Shell config for a shell_federated app by slug (404 if not found). With &environment_id=, slug is matched against site_slug in that environment | read |
Legacy coderunner apps are held to your plan's Coderunner limits and count towards its Coderunners per workspace, so restoring an archived one needs room under that limit. A PATCH whose manifest raises the deploy cpu, memory or instances above your plan, or a deploy (POST …/apps/{app_id}/coderunner/deploy) that asks for more, is 409 with the header X-Groundfloor-Reason: plan_limit, unless the app is already stored at that size or larger.
App access
GET /v1/workspaces/{workspace_id}/apps/{app_id}/access
PUT /v1/workspaces/{workspace_id}/apps/{app_id}/accessControls who can launch the app in the Shell. The PUT replaces the whole setting:
{
"visibility": "restricted",
"grants": [{ "role": "editor", "action": "read" }]
}visibilityisworkspace(default; anyone who can read the workspace can launch the app) orrestricted(only the site roles listed ingrants).- Each grant names a workspace site role.
actionis alwaysread. - The built-in
adminrole is a role like any other. On arestrictedapp, listadminingrantsif admins should launch it; if you leave it out, admins lose access.
Permission: ddl on the workspace. Site users get 403, whatever their role, admin included; manage app access from the Client Portal or with a builder token.
Releases (Shell federated)
| Method | Path | Purpose | Permission |
|---|---|---|---|
POST | …/apps/{app_id}/releases/upload-url | Init upload (bundle: remote_entry | zip) | write |
PUT | …/releases/{release_id}/content | Upload bytes (≤32 MiB). Returns 204 | write |
POST | …/releases/{release_id}/finalize | Publish | write |
GET | …/releases | List | read |
GET | …/releases/current | Current published (404 if none) | read |
Releases apply to shell_federated apps only (400 for other kinds, 410 for an archived app).
The upload-url body takes bundle (default remote_entry), an optional label (up to 120 characters) and a required size_bytes: the exact size you will upload, greater than 0 and at most 32 MiB (33,554,432 bytes). A missing size_bytes returns 422 and an oversized one returns 413. The size is checked again on finalize.
For a zip bundle, the archive is extracted on finalize. The extracted contents can't exceed 256 MiB or 2,000 entries; an archive over either limit is refused with 400. A zip can be finalized once, so a refused archive needs a new upload. Finalize returns 409 if no remoteEntry.js is found in the upload.
Custom domains
Custom domains belong to Apps, not Coderunners: a standalone App's domains point at its primary_coderunner_id. These routes work for apps of kind standalone (and legacy coderunner apps); any other app kind returns 400, an archived app 410:
| Method | Path | Permission |
|---|---|---|
GET | /v1/workspaces/{workspace_id}/apps/{app_id}/coderunner/domains | read |
POST | …/apps/{app_id}/coderunner/domains | write (201) |
DELETE | …/apps/{app_id}/coderunner/domains/{domain} | write (204) |
POST | …/apps/{app_id}/coderunner/domains/{domain}/verify | write |
GET / PUT | …/apps/{app_id}/coderunner/public | read / write |
POST body: { "domain": "example.com" } (a bare hostname, up to 253 characters). 409 when the domain is already added or collides with a branded host.
Each domain item has domain, status (pending, verifying, verified, active or error), cname_target (create a CNAME from your domain to this host; apex domains need ALIAS/ANAME), verification_record ({type, name, value}: a DNS TXT record that proves you own the domain), last_checked_at and detail (the result of the last check). verify re-checks DNS and returns {domain, status, verified, detail}. The …/public routes behave like the Coderunner ones.
A legacy coderunner app that is a function or job is called at POST https://invoke.groundfloor.cloud/v1/apps/{app_id}, and GET / PUT …/apps/{app_id}/coderunner/invoke read and set who may call it, like the Coderunner ones.
CLI: gf domains ls|add|rm|verify --app <id|slug>.
App sign-in
Rolling out. Each standalone app in a workspace with Groundfloor sign-in has a sign-in client, app-{app_id}. See Standalone app sign-in.
GET /v1/workspaces/{workspace_id}/apps/{app_id}/auth
PUT /v1/workspaces/{workspace_id}/apps/{app_id}/authThe response has app_id, workspace_auth_mode, groundfloor_login, client_id, issuer, jwks_url (all three null without Groundfloor sign-in), redirect_uris and web_origins (computed from the app's hosts; http://localhost and http://127.0.0.1 extra origins add redirect URIs too, with /auth/callback and each extra path), callback_paths, extra_origins, enabled (false for an archived app), sync_status and detail. sync_status is in_sync, pending, unmanaged, sync_disabled (not switched on for this cell yet), not_applicable or unknown.
PUT body: { "callback_paths": ["/login/done"], "extra_origins": ["http://localhost:5173"] }. Each list replaces the stored one; a field you leave out is kept. Up to 5 paths besides /auth/callback (absolute, no wildcard, query, fragment, . or .. segment or encoded ., /, \; up to 200 characters) and up to 20 origins (https://host[:port] with a domain name, or http://localhost[:port] / http://127.0.0.1[:port]; no path or wildcard). A value that isn't allowed, or too many, returns 422; an archived app returns 409. The sign-in client is updated in the background.
Permission: GET read, PUT write. Site users get 403.
GET /v1/public/app-auth/by-host?host={host}No token. Returns { "issuer", "client_id", "realm" } for the standalone app served on host (its Deployment URL host or a verified custom domain) in a workspace with Groundfloor sign-in. Any other host, a Shell app, an archived app or an External sign-in workspace returns 404. Rate-limited.
CLI: gf apps auth <app>, add-origin, remove-origin, add-callback, remove-callback.
App tokens
Rolling out. A Shell app swaps the signed-in user's Shell site token for a short-lived token for its own backend. In the browser, use getAppToken(), which calls this route and caches the result.
POST /v1/workspaces/{workspace_id}/apps/{app_id}/token
Authorization: Bearer <Shell site token>No body. Returns:
{ "access_token": "eyJ…", "token_type": "Bearer", "expires_in": 300 }access_token is an RS256 JWT with iss your workspace's issuer, aud and azp equal to app-{app_id}, typ Bearer, iat, exp, jti, and the user's sub, email, email_verified, roles, realm_access and, with Multi-tenant on, organization, copied from the Shell site token. expires_in is at most 300 seconds, and the token never outlives the Shell site token. Your backend checks it against your workspace's key address; see Check an app token. Groundfloor's API refuses app tokens.
Who can call it: a user signed in to the workspace's Shell site with Groundfloor sign-in, holding a site role, on a Shell app (shell_federated) they can open. Team tokens and M2M tokens are refused.
A refusal has a detail and, in most cases, an X-Groundfloor-Reason header. Check the header rather than the sentence:
| Status | X-Groundfloor-Reason | When |
|---|---|---|
401 | shell_token_expired | The Shell site token has expired. A missing or invalid token is 401 with no reason |
403 | app_token_requires_shell_token | Not a Shell site token of this workspace, for example a team token, an M2M token or a token from another workspace. A user with no site role gets 403 with no reason |
404 | app_not_found | No such app in this workspace, or the user can't open it. Both get the same answer |
409 | app_tokens_disabled | App tokens aren't switched on for your cell yet |
409 | app_token_requires_groundfloor_login | The workspace uses its own identity provider (External sign-in). Check that provider's tokens in your backend instead |
409 | app_token_requires_shell_federated_app | The app is a standalone app. Standalone apps sign users in with their own client |
409 | app_archived | The app is archived |
429 | rate_limited | Too many tokens for this user: by default 20 a minute per app and 60 a minute across apps. Retry-After gives the seconds to wait |
503 | app_token_key_unavailable | App tokens are temporarily unavailable. This can happen for a short time right after app tokens are switched on; try again later |
A token lasts up to 5 minutes, so one request per app every few minutes is enough: cache the token and reuse it until shortly before expires_in runs out.
Compare and promote
GET /v1/workspaces/{workspace_id}/apps/compare?source_environment_id=&target_environment_id=
POST /v1/workspaces/{workspace_id}/apps/promotePromote body: source_environment_id, target_environment_id, pairs[] (source_app_id, optional target_app_id / source_release_id), optional dry_run.
Apps are paired by lineage_id first, then by name. When the target has no copy yet, promote creates one with the source's lineage_id, site_slug (or the copy's own slug, if another live Shell app of the target environment holds it) and visibility, and, for a restricted app, the same access grants. If the grants can't be copied, the copy stays restricted with no grants and the pair reports an error. Promoting onto an existing copy never changes its access: when the copy is wider than a restricted source (visible to the whole workspace, or restricted but granting a role the source doesn't), the pair carries access_warning.
Permission: compare read, promote write
Shell config
GET /v1/workspaces/{workspace_id}/apps/{app_id}/shell-configAuthenticated bootstrap metadata for Shell hosts. Permission: read
Public by-slug bootstrap lives under /v1/public/… — see API authentication and Shell API reference.
Shell sites per environment
Rolling out. Where each environment has its own Shell site, GET /v1/public/workspaces/by-host returns the site's environment_id (see Public host discovery). The Shell passes it as environment_id to the app list (GET …/apps, GET /v1/public/workspaces/{workspace_id}/apps), by-slug and lookup (GET /v1/public/workspaces/{workspace_id}/apps/by-slug|lookup) routes, which then match slug against site_slug in that environment. A signed-in site user or public caller who leaves it out of a list gets the prod environment's apps (every environment's, when the workspace has no prod environment). Site-user and public responses carry site_slug and lineage_id only then.
The prod site also serves apps with no environment_id, by site_slug. If a prod app holds that site_slug, the prod app wins and the other app is served under its slug instead, or on no site if that's taken too; lists then show the path it's reachable at as its site_slug. Apps of an environment with no Shell site (suspended, site_label null, or a label your region doesn't serve) are on no site, and an invite's app_id link for them opens the site's home page.
An app also needs its environment's site access: see Environments API.