Skip to Content
dFlow

dFlow API

GET
/oauth/authorize

Response Body

Redirects to the web consent page

Example Request
curl -X GET 'https://k8s.dflow.sh/oauth/authorize'
Example Response
Empty
POST
/oauth/token

Response Body

Bearer access token

Example Request
curl -X POST 'https://k8s.dflow.sh/oauth/token'
Example Response
Empty
POST
/oauth/register

Response Body

Registered client

Example Request
curl -X POST 'https://k8s.dflow.sh/oauth/register'
Example Response
Empty

Empty JWKS document

GET
/oauth/jwks

Response Body

JWKS

Example Request
curl -X GET 'https://k8s.dflow.sh/oauth/jwks'
Example Response200
Empty
POST
/v1/oauth/consent

Authorization

bearerAuth

Response Body

Client redirect URL

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/oauth/consent'
Example Response
Empty
GET
/v1/oauth/grants

Authorization

bearerAuth

Response Body

Grant list

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/oauth/grants'
Example Response
Empty
DELETE
/v1/oauth/grants/{grant_id}

Authorization

bearerAuth

Path Parameters

grant_id*string

Header Parameters

Confirm-Name?string

Request Body

application/json
  1. body
confirm_name?string

Response Body

Revoked

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/oauth/grants/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
Empty

Process is up

GET
/healthz

Response Body

Process is up. This check does not touch a database.

application/json
  1. response
status*string
Example Request
curl -X GET 'https://k8s.dflow.sh/healthz'
Example Response200
{  "status": "ok"}
GET
/.well-known/oauth-protected-resource

RFC 9728 protected-resource metadata. Requires DFLOW_API_PUBLIC_URL. The resource is the public MCP URL (DFLOW_API_PUBLIC_URL + DFLOW_MCP_PATH, default /mcp).

Response Body

Protected resource metadata for MCP.

application/json
  1. response
Example Request
curl -X GET 'https://k8s.dflow.sh/.well-known/oauth-protected-resource'
Example Response
{}
GET
/.well-known/oauth-protected-resource/mcp

Same document as /.well-known/oauth-protected-resource when DFLOW_MCP_PATH is /mcp.

Response Body

Protected resource metadata for MCP.

application/json
  1. response
Example Request
curl -X GET 'https://k8s.dflow.sh/.well-known/oauth-protected-resource/mcp'
Example Response
{}
GET
/.well-known/oauth-authorization-server

RFC 8414 discovery document. Requires DFLOW_API_PUBLIC_URL on the API process. Authorization server metadata for remote MCP connectors (RFC 8414).

Response Body

Authorization server metadata including PKCE S256.

application/json
  1. response
Example Request
curl -X GET 'https://k8s.dflow.sh/.well-known/oauth-authorization-server'
Example Response
{}
GET
/.well-known/mcp.json

Registry-style server.json manifest with the Streamable HTTP MCP endpoint, transport type, and OAuth discovery URLs. Requires DFLOW_API_PUBLIC_URL.

Response Body

MCP discovery document.

application/json
  1. response
Example Request
curl -X GET 'https://k8s.dflow.sh/.well-known/mcp.json'
Example Response
{}
GET
/registry/token

Distribution token endpoint. It answers 404 unless DFLOW_REGISTRY_AUTH=on. Basic auth is the workspace repository prefix and a derived password. The token grants push and pull only for that prefix. The password is not returned.

Query Parameters

service?string
scope?string

Response Body

A short-lived registry token.

Example Request
curl -X GET 'https://k8s.dflow.sh/registry/token'
Example Response
Empty

Process can serve work

GET
/readyz

HTTP 200 means the registered checks passed. Those checks are the database ping and a token row. When a worker is running, the claim loops must have ticked within three idle intervals. When a maintenance election is running, a leader must have been observed within two minutes. The 503 body does not name which check failed.

Response Body

Registered checks passed.

application/json
  1. response
status*string
live_informers*boolean

True when DFLOW_LIVE_INFORMERS is on. Off does not change the HTTP status.

ws_events*boolean

True when DFLOW_WS_EVENTS is on. Off does not change the HTTP status.

degraded*boolean

True when live_informers or ws_events is false. The status stays ready.

Example Request
curl -X GET 'https://k8s.dflow.sh/readyz'
Example Response
{  "status": "ready",  "live_informers": true,  "ws_events": true,  "degraded": false}

Build version

GET
/v1/version

Response Body

Build version and API version.

application/json
  1. response
version*string
api_version*string
channel*string

Value of DFLOW_CHANNEL. Empty when unset. beta is the beta channel.

terms_version*string

Value of DFLOW_TERMS_VERSION. Empty when signup does not require acceptance.

workspace_events*boolean

True when this API serves the workspace event stream. The dashboard uses that stream when this is true.

maintenance*boolean

True when DFLOW_MAINTENANCE_MODE is on. Mutating product routes return 503; GETs, probes, /v1/version, /v1/admin/*, and auth refresh/logout still work. Not workspace suspend.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/version'
Example Response200
{  "version": "dev",  "api_version": "v1",  "channel": "",  "terms_version": "",  "workspace_events": false,  "maintenance": false}
GET
/v1/whoami

Response Body

Token id, display prefix, role, scope, workspace id, and stage_only. A user session also includes user_id, email, and credential_kind user. An API token includes credential_kind api_token and omits user_id and email. The bearer secret is absent. stage_only is true when the credential may stage drafts and may not write the cluster. An MCP OAuth session may also include oauth_client_id and oauth_scopes.

application/json
  1. response
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/whoami'
Example Response200
{}
POST
/v1/sessions

The JSON token is checked and then discarded. The response sets an HttpOnly cookie. session_id is shown once and is not a bearer token. The browser pages use a form instead of this route.

Response Body

Cookie set. Body contains session_id and expires_at. The bearer token is absent.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/sessions'
Example Response
Empty

Close a browser session

DELETE
/v1/sessions/{session_id}

The cookie must match session_id, or the bearer must own the session. The API token used to open the session stays.

Response Body

The session is gone.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/sessions/{session_id}'
Example Response
Empty

List reported issues

GET
/v1/issues

Newest first. Each item includes status (open, triaged, in_progress, waiting, resolved, or closed). A workspace token sees that workspace. A user token with no workspace sees that user's reports. The platform token sees every report. The rows come from the database.

Response Body

Items include id, title, kind, message, clickup, and created_at. next is null when the page is complete.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/issues'
Example Response200
Empty

Report an issue

POST
/v1/issues

Any signed-in caller can report an issue. JSON or multipart. The response id starts with iss_. status starts as open. Optional tags are deploy, route, database, billing, docs, and agent. Optional screenshots are png, jpeg, or webp, at most 3, 2 MB each, and are not stored in the database. screenshots is skipped, stored, or failed. clickup is skipped when the API has no ClickUp token, stored when a task was created, and failed when the task was not created. A failed ticket still keeps the issue. A stored task is tagged dFlow Cloud, customer report, and the kind.

Response Body

The report is stored. clickup_task_id and clickup_url are present only when clickup is stored. status is open.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/issues'
Example Response
Empty

Read one reported issue

GET
/v1/issues/{issue_id}

Returns the status stored in the database. It does not call ClickUp.

Response Body

The report, including the message.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/issues/{issue_id}'
Example Response
Empty
POST
/v1/issues/{issue_id}/status/refresh

Reads the ClickUp task for this report and stores the mapped status. List and inspect stay on the database. At most one refresh per minute per issue for this caller. A process-wide cap also applies. Retry-After is 60 when rate limited. A report without a ClickUp task, or a missing ClickUp task, is precondition. This is not a webhook.

Response Body

The report with the updated status when ClickUp mapped to a known value.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/issues/{issue_id}/status/refresh'
Example Response
Empty
POST
/v1/auth/register

Response Body

User created. A token pair is included when email verification is off, and workspace_id is that user's personal workspace. When verification is on, delivery is log or smtp, the verify token is not in this response, and the personal workspace is created at the first successful login. Optional invite_code is ignored when signup mode is open. Invite mode requires a valid code. The code is not returned. Optional accept_terms is ignored when DFLOW_TERMS_VERSION is empty. When that setting is set, accept_terms true stores it.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/register'
Example Response
Empty
POST
/v1/auth/verify

Response Body

The address is verified.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/verify'
Example Response
Empty
POST
/v1/auth/login

Response Body

Access token and refresh token.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/login'
Example Response
Empty
POST
/v1/auth/oauth/{provider}/start

Optional JSON body {"accept_terms":true} records the server terms version, the same rule as password login. An empty object is valid.

Path Parameters

provider*string
Value in"google""github"

Response Body

Authorization URL and one-time poll token.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/oauth/google/start'
Example Response
Empty
GET
/v1/auth/oauth/{provider}/callback

Path Parameters

provider*string
Value in"google""github"

Query Parameters

code?string
state?string

Response Body

HTML page telling the person to return to the terminal.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/auth/oauth/google/callback'
Example Response
Empty
POST
/v1/auth/oauth/poll

Response Body

Same JSON as password login.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/oauth/poll'
Example Response
Empty

Rotate a refresh token

POST
/v1/auth/refresh

Response Body

A new access token and refresh token.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/refresh'
Example Response200
Empty
POST
/v1/auth/logout

Response Body

The session is revoked.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/logout'
Example Response200
Empty

Request a password reset

POST
/v1/auth/forgot

Response Body

Accepted. delivery is log or smtp. The response does not say whether the email exists and does not include the reset token.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/forgot'
Example Response
Empty
POST
/v1/auth/reset

Response Body

The password was replaced.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/reset'
Example Response
Empty
POST
/v1/auth/workspace

Response Body

A token pair for that membership.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/workspace'
Example Response200
Empty
POST
/v1/auth/invites/accept

Response Body

The user is a member.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/auth/invites/accept'
Example Response200
Empty
POST
/v1/workspaces/{workspace_id}/invites

Response Body

The invite token is shown once. delivery is log or smtp when a copy was also sent. A personal workspace returns precondition.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/invites'
Example Response
Empty

List workspace members

GET
/v1/workspaces/{workspace_id}/members

Owner, admin, or platform owner. Developer and viewer receive forbidden. Returns user_id, email, and role. A personal workspace lists its owner only.

Response Body

members array of user_id, email, and role.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/members'
Example Response
Empty

Change a member role

PATCH
/v1/workspaces/{workspace_id}/members/{user_id}

Same grant matrix as invites, checked against the new role. An admin cannot change an owner. The last owner cannot be demoted. A personal workspace returns precondition and does not change the role.

Request Body

application/json
  1. body
role*string

Response Body

The updated member.

Example Request
curl -X PATCH 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/members/{user_id}' \  -H 'Content-Type: application/json' \  -d '{  "role": "string"}'
Example Response
Empty

Remove a member

POST
/v1/workspaces/{workspace_id}/members/{user_id}/remove

Body confirm_email must equal the member email. Same caller rule as role change. An admin cannot remove an owner. The last owner cannot be removed. A personal workspace returns precondition.

Request Body

application/json
  1. body
confirm_email?string

Response Body

The removed member row.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/members/{user_id}/remove' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
Empty
GET
/v1/workspaces

A verified user receives every workspace they belong to, including the personal one, even when the session is inside one workspace. An API token receives only its workspace. A platform owner receives a page of every workspace. Any verified user can create another workspace. An API token cannot. An invite into the personal workspace is rejected.

Response Body

Items of id and name. next is null when the page is complete.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces'
Example Response200
Empty

Create a workspace

POST
/v1/workspaces

Response Body

Workspace created. personal is false. Any verified user becomes the owner. An API token cannot create a workspace. The platform owner is forbidden. The personal workspace from signup stays private and cannot accept invites.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces'
Example Response
Empty

Read a workspace

GET
/v1/workspaces/{workspace_id}

The body includes limits and usage when the API is enforcing workspace caps. limits is the cap. usage is the desired work already stored. A missing cap row uses the platform defaults. It is not unlimited.

Response Body

The workspace, its limits, and its usage.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}'
Example Response
Empty
GET
/v1/workspaces/{workspace_id}/overview

Projects, their environments, the applications and services in each environment, and totals. Counts include every row. They do not stop at the list page of 50. usage matches the usage object on workspace inspect when caps are enforced. A token for another workspace gets the same not_found response as a missing workspace. There is no dflow CLI command for this read. The MCP tool is workspace_overview.

Response Body

Projects, environment rows, counts, totals, and usage.

application/json
  1. response
projects*array<>
totals*
usage?
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/overview'
Example Response
{  "projects": [    {      "id": "string",      "name": "string",      "created_at": "2019-08-24T14:15:22Z",      "application_count": 0,      "service_count": 0,      "environments": [        {          "id": "string",          "name": "string",          "status": "string",          "application_count": 0,          "service_count": 0,          "applications": [            {              "id": "string",              "name": "string",              "status": "string",              "image": "string"            }          ],          "services": [            {              "id": "string",              "name": "string",              "provider": "string",              "status": "string"            }          ]        }      ]    }  ],  "totals": {    "projects": 0,    "environments": 0,    "applications": 0,    "services": 0  },  "usage": {    "environments": 0,    "applications": 0,    "databases": 0,    "cpu": "string",    "memory": "string",    "storage": "string",    "replicas": 0  }}
GET
/v1/workspaces/{workspace_id}/operations

Newest platform operations in the workspace, including history for deleted applications and databases. Supports optional environment_id and type filters, plus cursor pagination with page_size (default 50, max 100) and page_token or cursor. The response includes next_page_token and next_cursor when another page exists.

Path Parameters

workspace_id*string

Query Parameters

environment_id?string
type?string
chip?string

Activity filter (all, deploys, builds, routes, backups, restores, deletes, running, pending, failed).

hide_succeeded_repairs?boolean

When true, hides succeeded application.repair rows (default true).

page_token?string
cursor?string

Alias for page_token.

page_size?integer
limit?integer

Alias for page_size.

Response Body

One page of operations and filter counts.

application/json
  1. response
items*array<>
next_page_token?string
next_cursor?string

Same value as next_page_token.

counts?
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/string/operations'
Example Response
{  "items": [    {      "id": "string",      "type": "string",      "status": "pending",      "resource_ref": "string",      "request_id": "string",      "error_code": "string",      "error_message": "string",      "created_at": "2019-08-24T14:15:22Z",      "started_at": "2019-08-24T14:15:22Z",      "finished_at": "2019-08-24T14:15:22Z",      "cancel_requested_at": "2019-08-24T14:15:22Z",      "resource_id": "string",      "operation_id": "string",      "resource_name": "string",      "resource_deleted": true,      "project_name": "string",      "env_name": "string"    }  ],  "next_page_token": "string",  "next_cursor": "string",  "counts": {    "all": 0,    "deploys": 0,    "builds": 0,    "routes": 0,    "running": 0,    "pending": 0,    "failed": 0,    "repairs": 0,    "backups": 0,    "restores": 0,    "deletes": 0  }}

Workspace change stream

GET
/v1/workspaces/{workspace_id}/watch

Server-sent events for one workspace the caller can see. The first line is data: ready. A create or delete wakes the stream with data: changed. The public website proxies this as /api/watch with the session cookie. This route is not an MCP tool.

Response Body

text/event-stream.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/watch'
Example Response
Empty
GET
/v1/workspaces/{workspace_id}/events

Server-sent events with durable intent rows (event: intent) and coalesced live patches (event: live). A connect with no Last-Event-ID and no after query starts at the current cursor. Last-Event-ID wins when both are set; otherwise after is the last seq the client applied. A cursor older than the retained rows, or a non-numeric cursor, sends event: resync. More than the per-user cap (DFLOW_WS_STREAMS_PER_USER, default 8) returns 429 with Retry-After. This route is not an MCP tool. GET /readyz does not accept after.

Path Parameters

workspace_id*string

Query Parameters

after?integer

Last applied seq when Last-Event-ID is absent. Zero or omitted starts at the current cursor. A negative or non-numeric value is treated as a bad cursor and the stream sends event: resync.

Formatint64

Response Body

text/event-stream.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/string/events'
Example Response
Empty

Set a workspace cap

PUT
/v1/workspaces/{workspace_id}/limits

Platform owner only. Omitted fields keep the stored value, or the platform default when the workspace has no row yet. Zero is stored and then refuses that kind of work. A workspace token is forbidden. This route is not an MCP tool.

Response Body

The stored cap. cpu, memory, and storage are quantities such as 4000m and 8Gi.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/limits'
Example Response
Empty

Suspend a workspace

POST
/v1/workspaces/{workspace_id}/suspend

Platform owner only. Sets suspended_at and suspended_reason, writes an audit row, and returns an operation that scales Deployments to zero and adds ResourceQuota dflow-suspend with pods 0. While the row is set, workspace writes return forbidden with message workspace suspended. Reads stay allowed. A workspace token is forbidden. This route is not an MCP tool. Idempotency-Key is required.

Request Body

application/json
  1. body
reason*string
Length1 <= length <= 200

Response Body

Full Operation record accepted for polling. id, operation_id, and resource_id are the same aliases the operator CLI reads.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/suspend' \  -H 'Content-Type: application/json' \  -d '{  "reason": "string"}'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}

Unsuspend a workspace

POST
/v1/workspaces/{workspace_id}/unsuspend

Platform owner only. Clears suspended_at and returns an operation that deletes ResourceQuota dflow-suspend and restores the replica counts recorded at suspend. A workspace that is not suspended returns conflict. This route is not an MCP tool. Idempotency-Key is required.

Response Body

Full Operation record accepted for polling. id, operation_id, and resource_id alias the same operation.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/unsuspend'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
POST
/v1/workspaces/{workspace_id}/github/install/start

Returns an authorization_url for github.com. Requires a signed-in user. Workspace ownership needs owner or admin.

Response Body

authorization_url for the install redirect.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/github/install/start'
Example Response
Empty
GET
/v1/workspaces/{workspace_id}/github/installations

Response Body

items with installation metadata. No token material.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/github/installations'
Example Response200
Empty
DELETE
/v1/workspaces/{workspace_id}/github/installations/{installation_id}

Response Body

The installation row was removed.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/github/installations/{installation_id}'
Example Response204
Empty
GET
/v1/workspaces/{workspace_id}/github/repos

Response Body

items with full_name, private, default_branch, html_url.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/github/repos'
Example Response200
Empty
GET
/v1/workspaces/{workspace_id}/github/branches

Query Parameters

repo*string

Response Body

items with branch names.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/github/branches?repo=string'
Example Response200
Empty
GET
/v1/github/app/callback

Public browser redirect from GitHub. No bearer token. The state query value is the one-time credential: raw URL-safe base64 of 32 bytes. Anything else is HTTP 400 and does not touch the database. The user id is not in the query. One address is limited to 30 calls a minute; the 31st is HTTP 429. When DFLOW_WEB_PUBLIC_URL is set, success is HTTP 303 to {origin}/dashboard/settings/connections/ with the query and fragment cleared. When that origin is empty, success is HTTP 200 text/html that says the install finished and to return to the dashboard. Failures stay JSON.

Response Body

HTML page when DFLOW_WEB_PUBLIC_URL is empty. The page says the install finished and to return to the dashboard.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/github/app/callback'
Example Response
Empty

GitHub App webhook

POST
/v1/github/app/webhook

Public endpoint. When the GitHub App is configured, DFLOW_GITHUB_APP_WEBHOOK_SECRET must be set or delivery is refused with HTTP 412. When the secret is set, X-Hub-Signature-256 is required.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/github/app/webhook'
GET
/v1/workspaces/{workspace_id}/projects

Response Body

Project items. next is null when the page is complete.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/projects'
Example Response200
Empty

Create a project

POST
/v1/workspaces/{workspace_id}/projects

The workspace id is in the path. A repeated Idempotency-Key with the same name returns HTTP 200. A different name with that key returns 409. A missing key still creates the project.

Response Body

The project row. No namespace is created.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/projects'
Example Response
Empty

Delete a project

DELETE
/v1/projects/{project_id}

Removes the project after every application, database, volume, and job is gone. Empty environments are torn down on the same path as environment.delete, so Kubernetes namespaces are removed before the project row. Sends Confirm-Name with the project name. By default HTTP 201 stages project.delete into the first environment's draft. No project.delete operation is queued until changes deploy. Query trust_skip=true returns HTTP 202 with project.delete when teardown is needed, or HTTP 204 when there are no environments left. Returns HTTP 412 when resources remain or an environment delete is still in progress.

Query Parameters

trust_skip?boolean

When true, queue project.delete immediately instead of staging.

Header Parameters

Confirm-Name*string

Must equal the project name.

Response Body

The delete was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/projects/{project_id}' \  -H 'Confirm-Name: string'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
GET
/v1/projects/{project_id}/environments

Deleted environments are omitted. This route does not read Kubernetes.

Response Body

Environment items.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/projects/{project_id}/environments'
Example Response200
Empty

Create an environment

POST
/v1/projects/{project_id}/environments

Stores a namespace name and does not create that namespace in Kubernetes. namespace_created is false. Optional region, such as in or us, selects one cluster in that region. The application and its database stay on that cluster. An omitted region uses the single workspace cluster, or the hosted cluster when the workspace has none. When no cluster is registered, the environment is stored and a later deploy asks for one. The stored cluster_id is not changed later.

Response Body

The environment row.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/projects/{project_id}/environments'
Example Response201
Empty
DELETE
/v1/environments/{env_id}

By default HTTP 201 stages environment.delete into the environment draft. No environment.delete operation is queued until changes deploy. Query trust_skip=true returns HTTP 202 and a pending environment.delete operation when no application row and no volume exists. Returns HTTP 412 when an application or a volume, mounted or not, still exists; delete each volume with POST /v1/volumes/{volume_id}/delete first. A second delete while the environment is deleting returns the same operation. This route does not delete a Kubernetes namespace.

Query Parameters

trust_skip?boolean

When true, queue environment.delete immediately instead of staging.

Response Body

The delete was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/environments/{env_id}'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
GET
/v1/environments/{env_id}/applications

Deleted applications are omitted. desired is the latest deployment. observed is the last worker snapshot, or null.

Response Body

Application items. next is null when the page is complete.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/applications'
Example Response200
Empty

Create an application

POST
/v1/environments/{env_id}/applications

The environment must be active. A viewer cannot create one. The platform owner cannot create one. No Kubernetes object is created.

Response Body

The application. desired and observed are null.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/applications'
Example Response
Empty
GET
/v1/environments/{env_id}/canvas

Every application in the environment, each with its latest release, route, volumes, and jobs, plus the unmounted volumes, the services and a backup count per service, and totals. One authorization check is the environment. Totals count every row and do not stop at the list page of 50. A token for another workspace gets not_found. There is no dflow CLI command for this read. The MCP tool is env_canvas.

Response Body

Applications, services, and totals for the environment.

application/json
  1. response
environment_id*string
name*string
applications*array<>
services*array<>
unmounted_volumes*array<>

Disks in the environment that no application mounts. A mounted disk is on its application's volumes list. totals.volumes counts both.

totals*
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/canvas'
Example Response
{  "environment_id": "string",  "name": "string",  "applications": [    {      "id": "string",      "environment_id": "string",      "name": "string",      "status": "string",      "desired": {},      "observed": null,      "document": null,      "created_at": "2019-08-24T14:15:22Z",      "latest_release": {        "id": "string",        "revision": "string",        "image_digest": "string",        "image": "string",        "status": "string",        "current": true,        "created_at": "2019-08-24T14:15:22Z"      },      "route": {        "id": "string",        "host": "string",        "tls": "string",        "address": "string",        "custom_domains": [          {            "host": "string",            "tls": "string"          }        ]      },      "volumes": [        {}      ],      "jobs": [        {}      ]    }  ],  "services": [    {      "id": "string",      "name": "string",      "provider": "string",      "status": "string",      "desired": null,      "observed": null,      "backup_count": 0,      "password_revealed_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z"    }  ],  "unmounted_volumes": [    {      "id": "string",      "workspace_id": "string",      "environment_id": "string",      "application_id": "string",      "name": "string",      "size_gi": 1,      "storage_class": "string",      "mount_path": "string",      "claim_name": "string",      "status": "pending",      "observed_phase": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "totals": {    "applications": 0,    "services": 0,    "volumes": 0,    "jobs": 0,    "backups": 0  }}
GET
/v1/environments/{env_id}/changes

Returns revision, count, and masked diff entries for the environment draft.

Response Body

Diff view; empty draft returns revision 0 and count 0.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/changes'
Example Response200
Empty
DELETE
/v1/environments/{env_id}/changes

Response Body

Draft cleared.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/environments/{env_id}/changes'
Example Response204
Empty
POST
/v1/environments/{env_id}/changes/entries

Body is one entry object or an array of entries with target env or secret, op set or unset, key, and value.

Query Parameters

trust_skip?boolean

When true, each entry deploys immediately in a private one-entry change set.

Response Body

Entries staged into the open change set, or trust-skip finished without a deploy operation.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/changes/entries'
Example Response
Empty
PATCH
/v1/environments/{env_id}/changes/entries/{entry_id}

Response Body

Updated entry.

Example Request
curl -X PATCH 'https://k8s.dflow.sh/v1/environments/{env_id}/changes/entries/{entry_id}'
Example Response200
Empty

Discard one staged entry

DELETE
/v1/environments/{env_id}/changes/entries/{entry_id}

Response Body

Entry removed.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/environments/{env_id}/changes/entries/{entry_id}'
Example Response204
Empty

Deploy staged changes

POST
/v1/environments/{env_id}/changes/deploy

Requires revision matching the open draft. Returns 409 when revision mismatches or an entry is stale. Stage-only tokens are forbidden.

Request Body

application/json
  1. body
revision*integer
entry_ids?array<string>

Response Body

Deploy accepted; one application.deploy operation per affected app.

application/json
  1. response
Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/changes/deploy' \  -H 'Content-Type: application/json' \  -d '{  "revision": 0}'
Example Response
{}
GET
/v1/environments/{env_id}/change-sets

Query Parameters

state?string

Response Body

Historical change sets.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/change-sets'
Example Response200
Empty

Inspect one change set

GET
/v1/change-sets/{id}

Response Body

Set metadata, masked entries, and related operation ids.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/change-sets/{id}'
Example Response
Empty
GET
/v1/providers

Requires a bearer token. Returns product capability, not tenant data. Registered providers are postgresql, mysql, mongodb, and redis, each with capabilities provision, status, and deprovision.

Response Body

Provider name and capability list for each registered provider.

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/providers'
Example Response
{  "items": [    {      "name": "postgresql",      "capabilities": [        "provision",        "status",        "deprovision"      ]    },    {      "name": "mysql",      "capabilities": [        "provision",        "status",        "deprovision"      ]    },    {      "name": "mongodb",      "capabilities": [        "provision",        "status",        "deprovision"      ]    },    {      "name": "redis",      "capabilities": [        "provision",        "status",        "deprovision"      ]    }  ]}
GET
/v1/environments/{env_id}/services

Deleted instances are omitted. Requires workspace membership.

Response Body

Service instance items.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/services'
Example Response200
Empty
POST
/v1/environments/{env_id}/services

By default stages service.create; deploy applies the row and queues service.provision. trust_skip=true validates immediately, inserts a pending service_instances row, and returns a pending service.provision operation. Providers are postgresql, mysql, mongodb, and redis. Accepted parameters are database, storage, version, and an optional backup object (enabled, schedule, retention, pitr). postgresql, mysql, and mongodb require database. redis may omit database and omits version. version for postgresql is 16, 17, or 18. mysql is 8.0 or 8.4. mongodb is 6, 7, or 8. Any other version returns 400 and creates no instance. Omitting version uses the server default. storage is 1Gi through 100Gi. When the client omits storage, the server uses 20Gi. The CLI sends 20Gi when --storage is left at its default. When the caller omits the backup object, the server applies the schedule for postgresql, mysql, and redis. application_id, when set, records the new service on that application's dflow.json before the service is ready. For postgresql, mysql, and mongodb, if that application already has platform database binding keys, the response is 409 conflict with a conflict message naming the linked database and app (DFLOW_DATABASE_) and no service row is inserted. For redis, if that application already has DFLOW_REDIS_ binding keys, the response is 409 conflict and no service row is inserted. A missing provider capability returns 412 and creates no operation. An unknown provider name returns 404.

Query Parameters

trust_skip?boolean

When true, apply immediately without staging.

Request Body

application/json
  1. body
provider*string
name*string
capability*string
parameters?
application_id?string

Application whose stored dflow.json should name this service.

Response Body

Service create staged.

application/json
  1. response
status?string
message?string
change_set_id?string
revision?integer
entry?
Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/services' \  -H 'Content-Type: application/json' \  -d '{  "provider": "fake",  "name": "demo",  "capability": "provision",  "parameters": {}}'
Example Response
{  "status": "string",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {}}
GET
/v1/services/{svc_id}

Returns desired and observed JSON without secret values.

Response Body

The service instance.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/services/{svc_id}'
Example Response
Empty
DELETE
/v1/services/{svc_id}

By default stages service.delete; deploy queues service.deprovision. trust_skip=true requires header Confirm-Name equal to the service name, returns HTTP 202 and a pending service.deprovision operation. Data is deleted without a backup. When an application's stored dflow.json names this service, the call returns 412 and deletes nothing. Header Force true unlinks those applications first: it removes DFLOW_DATABASE_HOST, PORT, NAME, and USERNAME, the DFLOW_DATABASE_PASSWORD secret, other secrets that reference the service, and the dflow.json service entry, then queues a deploy when the application already has one.

Query Parameters

trust_skip?boolean

When true, apply immediately without staging.

Header Parameters

Confirm-Name*string
Force?"true"

Unlink applications that name this service, then deprovision.

Value in"true"

Response Body

Accepted (trust_skip) or staged delete.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/services/{svc_id}' \  -H 'Confirm-Name: string'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
GET
/v1/services/{svc_id}/backups

Returns rows from service_backups for a postgresql, mysql, or redis service. MongoDB returns a precondition that backups are not available. Requires DFLOW_OBJECT_STORE_DRIVER=s3 on the API process. When backups are off, the call returns HTTP 412 database backups are not configured.

Response Body

Backup rows for this service.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/services/{svc_id}/backups'
Example Response
Empty

Request a manual backup

POST
/v1/services/{svc_id}/backups

By default HTTP 201 stages backup.create into the environment draft. postgresql, mysql, and redis can be backed up. MongoDB returns a precondition that backups are not available. A second request while a manual backup is still running returns 412 a backup is already running. An eighth manual backup returns 412 manual backup limit reached. No provider backup runs until changes deploy. Query trust_skip=true runs the immediate path and returns HTTP 202 with backup metadata.

Query Parameters

trust_skip?boolean

Response Body

Backup create was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/services/{svc_id}/backups'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
POST
/v1/services/{svc_id}/restores

Creates a new service in the same environment from the source backups. postgresql, mysql, and redis can be restored. MongoDB returns a precondition that backups are not available. Requires header Confirm-Name equal to the source service name. By default HTTP 201 stages service.restore. Query trust_skip=true queues restore immediately and returns HTTP 202.

Query Parameters

trust_skip?boolean

Header Parameters

Confirm-Name*string

Response Body

Restore was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/services/{svc_id}/restores' \  -H 'Confirm-Name: string'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
POST
/v1/services/{svc_id}/credentials

After the service is ready, the first call returns host, port, database, username, and password and writes an audit event. A second call returns 412 credentials_already_read and does not return the password. The runtime Kubernetes Secret is unchanged.

Response Body

One-time credential payload.

application/json
  1. response
host*string
port*string
database*string
username*string
password*string
Example Request
curl -X POST 'https://k8s.dflow.sh/v1/services/{svc_id}/credentials'
Example Response
{  "host": "string",  "port": "string",  "database": "string",  "username": "string",  "password": "string"}
POST
/v1/applications/{app_id}/service-bindings

By default stages service.bind into the environment draft. Query trust_skip=true applies immediately. Writes DFLOW_DATABASE_HOST, PORT, NAME, and USERNAME as env and DFLOW_DATABASE_PASSWORD as a secret, then queues application.deploy. Fails with 409 if any of those keys already exist.

Query Parameters

trust_skip?boolean

Request Body

application/json
  1. body
service_id*string

Response Body

Staged bind or accepted deploy when trust_skip is true.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/service-bindings' \  -H 'Content-Type: application/json' \  -d '{  "service_id": "string"}'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}

Read one application

GET
/v1/applications/{app_id}

Returns the desired image, port, replica count, and optional cpu_millicores and memory_mi together with the last observed status. When live informers are enabled, live holds the in-memory cluster snapshot and observed may mirror it.

Response Body

The application.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}'
Example Response200
Empty

Delete an application

DELETE
/v1/applications/{app_id}

Requires header Confirm-Name equal to the application name. Returns HTTP 202 and a pending application.delete operation. With no stored cluster credential the worker marks the application deleted without calling Kubernetes. The desired image row is kept. When the application is already deleting, send Force: true (or force=1) to re-queue delete.

Header Parameters

Confirm-Name*string
Force?"true"

Re-queue delete when status is already deleting.

Value in"true"

Response Body

The delete operation was accepted.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/applications/{app_id}' \  -H 'Confirm-Name: string'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
PUT
/v1/applications/{app_id}/document

Replaces the stored document for this application with the request body. The body is one dflow.json file and must include an application with this application's name. Env and secrets in the file are applied and stored on the document. The response redacts secret-like env values. A later dashboard change to env or secrets updates this same file.

Request Body

application/json
  1. body

Response Body

The application, with the stored document shown as names only.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/document' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
Empty
GET
/v1/applications/{app_id}/report

Returns identity, image, port, route, volumes, and pods (name, phase, ready) for support and dashboard log pod select (PRD-070). Does not include env or secret keys, replicas, CPU/memory, or latest_operation. When no cluster is selected or pods cannot be listed, pods is [] and pods_unavailable explains why; the response is still HTTP 200 when Postgres-backed fields load.

Response Body

The application report.

application/json
  1. response
id*string
name*string
status*string
workspace*
project*
environment*
image?string
port?integer
route?
volumes*array<>
pods*array<>
pods_unavailable?string

Present when pods could not be listed; pods is then [].

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/report'
Example Response
{  "id": "string",  "name": "string",  "status": "string",  "workspace": {    "id": "string",    "name": "string"  },  "project": {    "id": "string",    "name": "string"  },  "environment": {    "id": "string",    "name": "string"  },  "image": "string",  "port": 0,  "route": {    "url": "string"  },  "volumes": [    {      "name": "string",      "mount_path": "string"    }  ],  "pods": [    {      "name": "string",      "phase": "string",      "ready": true    }  ],  "pods_unavailable": "string"}

Request an image deploy

POST
/v1/applications/{app_id}/deployments

image is required. port defaults to 8080. replicas defaults to 1 and cannot exceed 5. Optional cpu_millicores and memory_mi are positive integers. Omitted fields use the stored dflow.json when that field is set, otherwise the platform defaults. The image must match letters, digits, and . _ / : @ + -, up to 512 characters. By default this stages image.set, and scale.set or resources.set when replicas or resource limits are sent, into the environment draft. HTTP 201 returns status staged with one or more entries. No deployment row or application.deploy operation is created until changes deploy. Query trust_skip=true runs the immediate path: HTTP 202 and a pending application.deploy operation. It does not mean the workload is ready. The worker marks a trust-skipped operation succeeded only when the new ReplicaSet rollout is complete and those pods have stayed Ready, with no container restart, for DFLOW_DEPLOY_STABLE_FOR (default 12s). observedGeneration is current. updatedReplicas, readyReplicas, and availableReplicas equal the desired count. No pod from an older ReplicaSet remains. A crash, ImagePullBackOff, ErrImagePull, CreateContainerConfigError, or a restart in that window fails the operation. The message keeps a short prefix and adds a note, cut to 180 characters, with the container name, the waiting or terminated reason, the exit code, and a short log. Secret and env values are removed. This is the same shape as the Pending note on a deploy timeout. Until a cluster credential is stored, the worker fails the operation with cluster credential is not stored and creates no object. A repeated Idempotency-Key with the same image, port, replicas, cpu_millicores, and memory_mi returns that operation on the trust-skip path only. A different body returns 409. A missing key still creates the deployment on trust-skip. GET observed, once a worker has written it, contains conditions Progressing, Available, and Degraded.

Query Parameters

trust_skip?boolean

When true, apply the deploy immediately and return a pending application.deploy operation.

Response Body

The deploy was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entries*array<>
Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/deployments'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entries": [    {      "id": "string",      "change_set_id": "string",      "target": {        "type": "string",        "id": "string",        "name": "string"      },      "op": "string",      "key": "string",      "before": null,      "after": null,      "summary": "string",      "depends_on": [        "string"      ],      "source": "string",      "author_label": "string",      "client_label": "string",      "agent": {        "session_id": "string",        "task_id": "string",        "task_title": "string"      },      "state": "string",      "stale": true,      "operation_id": "string",      "last_error": "string"    }  ]}
POST
/v1/applications/{app_id}/builds

JSON accepts repo (https github.com URL) or source (base64 tar.gz upload, at most 100MB packed). Multipart form accepts a source file part with the same limit. repo and source cannot both be set. Omit repo to clone build.repo from the application's stored dflow.json when source is not sent. Local uploads skip .git, node_modules, and .env at any depth. They keep .env.example and other names. An explicit repo is the clone URL. A dflow.json in that repository still supplies the other settings. A template install clones build.repo, branch, and root from the submitted document and does not replace that document with a file from the repository. A public repository needs no token. A private repository uses the GitHub App installation token when connected, otherwise the per-application git token from PUT /v1/applications/{app_id}/source/git-token, otherwise HTTP 412. Header X-Dflow-Git-Token supplies a one-time clone token for trust_skip builds only; staged builds reject that header. The clone URL stays free of the token. By default this stages source.set into the environment draft. HTTP 201 returns status staged with one entry. That staged entry does not carry the archive bytes. No application.build operation is created until changes deploy. Query trust_skip=true runs the immediate path: the server clones, builds with Railpack, pushes to DFLOW_REGISTRY, and deploys that image. HTTP 202 is the build operation. An empty registry is HTTP 412. A failed build returns the build log on the operation. The message says whether the failure is in the repository or in the builder. dFlow does not open a GitHub pull request. An upload of 700KB or less is mounted on the Job. A larger upload is fetched from GET /v1/build-sources/{token} when DFLOW_API_PUBLIC_URL is set. That GET has no bearer token. The token is the credential.

Query Parameters

trust_skip?boolean

When true, queue application.build immediately instead of staging source.set.

Response Body

The build was staged into the environment draft. The entry does not carry the archive bytes.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/builds'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
GET
/v1/build-sources/{token}

No bearer token. The token in the path is the credential. It is created for an upload larger than 700KB and cleared when the build worker finishes. A missing or cleared token is HTTP 404. The body is the tar.gz. Cache-Control is no-store.

Path Parameters

token*string

Response Body

The tar.gz archive.

response?fileapplication/gzip
Formatbinary
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/build-sources/string'
Example Response
"string"
GET
/v1/applications/{app_id}/releases

Each item has id, revision, image_digest, status, and current. current is true when that succeeded release is the desired image. An application in another workspace returns HTTP 404.

Response Body

The release list. items is empty when the application has no release.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/releases'
Example Response200
Empty
POST
/v1/applications/{app_id}/restart

Empty JSON body. Requires Idempotency-Key. Returns HTTP 202 and an operation of type application.restart. The worker sets pod-template annotation dflow.io/restart-operation to the operation id so Kubernetes replaces the pods. The Deployment image, env, secrets, resource requests, and replica count stay as they were. A viewer receives HTTP 403. An application with no deployment receives HTTP 412 with code precondition. The same actor and idempotency key returns the original operation.

Request Body

application/json
  1. body

Response Body

A pending application.restart operation.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/restart' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
POST
/v1/applications/{app_id}/rollbacks

Body is {"release_id":"rel_..."}. The response is HTTP 202 and an application.deploy operation. The image is that release's digest. Rollback does not start a build. An unknown release, or a release for another application, returns HTTP 404. A release that is not succeeded returns HTTP 412. The release that is already the desired image returns HTTP 409 and error code conflict with a message that names the release id and image as already running.

Response Body

A pending application.deploy operation.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/rollbacks'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
GET
/v1/applications/{app_id}/volumes

Read only. At most one volume, the one mounted on this application. There is no create on this path: create a volume with POST /v1/environments/{env_id}/volumes, then mount it with POST /v1/volumes/{volume_id}/mount. A POST here returns HTTP 405.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/volumes'
GET
/v1/environments/{env_id}/volumes

Active volumes, mounted or not. A volume that is not mounted has no application_id or mount_path.

Response Body

One row per active volume.

application/json
  1. response
volumes*array<>
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/volumes'
Example Response200
{  "volumes": [    {      "id": "string",      "workspace_id": "string",      "environment_id": "string",      "application_id": "string",      "name": "string",      "size_gi": 1,      "storage_class": "string",      "mount_path": "string",      "claim_name": "string",      "status": "pending",      "observed_phase": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/v1/environments/{env_id}/volumes

Body is name, size_gi (1 through 10), and storage_class, which must be on the cluster capability report. The volume belongs to the environment and is not mounted by any application. By default HTTP 201 stages volume.create into the environment draft. No volume row or volume.create operation is created until changes deploy. Query trust_skip=true runs the immediate path: requires Idempotency-Key, inserts the volume row, and returns HTTP 202 with a pending volume.create operation. The operation succeeds when the claim is Bound, or when it exists on a WaitForFirstConsumer class such as local-path. A second active volume with the same name in the environment returns HTTP 409. The body does not accept mount_path or application_id. Acceptance writes an audit event with action volume.create.

Query Parameters

trust_skip?boolean

When true, create the volume immediately instead of staging.

Response Body

The volume create was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/volumes'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}

Inspect one volume

GET
/v1/volumes/{volume_id}

Returns the volume row, including claim_name. A deleted volume or one in another workspace returns HTTP 404.

Response Body

The volume.

application/json
  1. response
id*string
workspace_id*string
environment_id*string
application_id?string

The application that mounts the volume. Absent while the volume is unmounted.

name*string
size_gi*integer
Range1 <= value <= 10
storage_class*string
mount_path?string

Absolute directory in the container. Absent while the volume is unmounted.

claim_name*string

The PersistentVolumeClaim name in the environment namespace.

status*string
Value in"pending""ready""deleted"
observed_phase?string

Last claim phase the worker saw, for example Bound or Pending.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/volumes/{volume_id}'
Example Response
{  "id": "string",  "workspace_id": "string",  "environment_id": "string",  "application_id": "string",  "name": "string",  "size_gi": 1,  "storage_class": "string",  "mount_path": "string",  "claim_name": "string",  "status": "pending",  "observed_phase": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
POST
/v1/volumes/{volume_id}/mount

Requires Idempotency-Key. Body is application_id and mount_path, an absolute directory. The application must be in the volume's environment and holds one volume. HTTP 202 starts a volume.mount operation. The volume row names the application and path at once. The worker rolls the application's Deployment with the claim mounted and succeeds when the claim is Bound. An application with no deployment yet gets the mount on its first deploy. Acceptance writes an audit event with action volume.mount.

Response Body

A pending volume.mount operation. resource_ref is the volume id.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/volumes/{volume_id}/mount'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
POST
/v1/volumes/{volume_id}/umount

Requires Idempotency-Key. No body. HTTP 202 starts a volume.umount operation. The worker rolls the application's Deployment without the mount, then clears application_id and mount_path on the row. The claim stays Bound and keeps its data. A volume that is already unmounted returns HTTP 400 with a validation error and no operation is stored. Acceptance writes an audit event with action volume.umount.

Response Body

A pending volume.umount operation. resource_ref is the volume id.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/volumes/{volume_id}/umount'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
POST
/v1/volumes/{volume_id}/expand

Body is size_gi, which must be larger than the stored size and at most 10. By default HTTP 201 stages volume.resize into the environment draft. No volume.expand operation is queued until changes deploy. Query trust_skip=true runs the immediate path: requires Idempotency-Key and returns HTTP 202 with a pending volume.expand operation. The worker raises the claim's requested storage and stores size_gi when the claim capacity shows it. Acceptance writes an audit event with action volume.expand.

Path Parameters

volume_id*string

The volume id, for example vol_01.

Query Parameters

trust_skip?boolean

When true, queue volume.expand immediately instead of staging volume.resize.

Request Body

application/json
  1. body
size_gi*integer

The new size in Gi. It must be larger than the current size_gi.

Range2 <= value <= 10

Response Body

The resize was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/volumes/string/expand' \  -H 'Content-Type: application/json' \  -d '{  "size_gi": 2}'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
POST
/v1/volumes/{volume_id}/delete

Body confirm_name must equal the stored name; a mismatch is validation and no operation is stored. By default HTTP 201 stages volume.delete into the environment draft. No volume.delete operation is queued until changes deploy. Query trust_skip=true runs the immediate path: requires Idempotency-Key. Data is deleted. A mounted volume is unmounted first in the same operation. Acceptance writes an audit event with action volume.delete.

Query Parameters

trust_skip?boolean

When true, queue volume.delete immediately instead of staging.

Response Body

The delete was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/volumes/{volume_id}/delete'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
GET
/v1/applications/{app_id}/jobs

Response Body

One row per Job or CronJob owned by the application.

application/json
  1. response
jobs*array<>
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/jobs'
Example Response200
{  "jobs": [    {      "id": "string",      "application_id": "string",      "name": "string",      "image": "string",      "command": [        "string"      ],      "active_deadline_seconds": 0,      "schedule": "string",      "concurrency_policy": "string",      "status": "pending",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}

Run or schedule a job

POST
/v1/applications/{app_id}/jobs

image is required. schedule of five cron fields creates a CronJob and stages job.schedule. Omitting schedule stages job.create. command is an optional argv array that replaces the image entrypoint. active_deadline_seconds is optional. Zero means 20 minutes. The value must be from 1 to 3600. privileged, host_path, host_network, host_pid, host_ipc, and security_context are rejected. The platform sets the security context. By default HTTP 201 stages the job into the environment draft. No job row or job.create operation is created until changes deploy. Query trust_skip=true runs the immediate path: requires Idempotency-Key, inserts the job row, and returns HTTP 202 with a pending job.create operation.

Query Parameters

trust_skip?boolean

When true, create the job immediately instead of staging job.create or job.schedule.

Response Body

The job was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/applications/{app_id}/jobs'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}
POST
/v1/jobs/{job_id}/delete

Body confirm_name must equal the stored name. By default HTTP 201 stages job.delete into the environment draft. No job.delete operation is queued until changes deploy. Query trust_skip=true runs the immediate path: requires Idempotency-Key and returns HTTP 202 with a pending job.delete operation.

Query Parameters

trust_skip?boolean

When true, queue job.delete immediately instead of staging.

Response Body

The delete was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/jobs/{job_id}/delete'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}

List recipe groups

GET
/v1/environments/{env_id}/groups

Each group is one shared dflow.json. An application that is not in a group keeps its own file.

Response Body

The groups in this environment.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/environments/{env_id}/groups'
Example Response200
Empty
POST
/v1/environments/{env_id}/groups

Body {"name","applications"} combines the stored dflow.json of those applications into one file. The same name replaces the member list and rebuilds the file. An application that leaves keeps its own slice. An application already in another group is a conflict. An empty applications list removes that group and writes each member its own file. This write does not deploy.

Request Body

application/json
  1. body
name*string
applications*array<string>

Response Body

The shared dflow.json and the applications that use it.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/groups' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "applications": [    "string"  ]}'
Example Response201
Empty

List official templates

GET
/v1/templates

Returns the recipes in templates/*/dflow.json. supabase is not listed. examples/ is not listed.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/templates'

Install a template

POST
/v1/environments/{env_id}/template-installs

Body {"name":"umami"} installs an official recipe. A dflow.json document, with applications and services, installs that document. By default HTTP 201 stages template.install into the environment draft. No template.install operation is queued until changes deploy. Query trust_skip=true requires Idempotency-Key and HTTP 202 starts the install immediately. The same template can be installed again in one environment. The application and database service keep the recipe names when those names are free. When either name is taken, both gain the same four-character suffix a route adds to a taken hostname. The operation succeeds only when the public URL returns HTTP 200. One-time secrets are read from GET /v1/template-installs/{install_id} once.

Query Parameters

trust_skip?boolean

When true, queue template.install immediately instead of staging.

Response Body

The install was staged into the environment draft.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/environments/{env_id}/template-installs'
Example Response
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}

Read a template install

GET
/v1/template-installs/{install_id}

Returns the public URL. Secrets are included once and then cleared.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/template-installs/{install_id}'

List config file paths

GET
/v1/applications/{app_id}/files
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/files'

Store one config file

PUT
/v1/applications/{app_id}/files

Body path and contents. path is absolute and is not /. Contents are not returned later. Requires a deployment. By default stages files.set. Query trust_skip=true stores immediately and queues application.deploy.

Query Parameters

trust_skip?boolean

Response Body

Staged file entry when not trust-skipping.

application/json
  1. response
status*"staged"
Value in"staged"
message*string
change_set_id*string
revision*integer
entry*

One row in an environment change-set draft or a staged API response.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/files'
Example Response200
{  "status": "staged",  "message": "string",  "change_set_id": "string",  "revision": 0,  "entry": {    "id": "string",    "change_set_id": "string",    "target": {      "type": "string",      "id": "string",      "name": "string"    },    "op": "string",    "key": "string",    "before": null,    "after": null,    "summary": "string",    "depends_on": [      "string"    ],    "source": "string",    "author_label": "string",    "client_label": "string",    "agent": {      "session_id": "string",      "task_id": "string",      "task_title": "string"    },    "state": "string",    "stale": true,    "operation_id": "string",    "last_error": "string"  }}

List tokens

GET
/v1/workspaces/{workspace_id}/tokens

Response Body

Token ids, optional names, prefixes, roles, expires_at, last_used_at, and expiry_backfilled. The bearer secret is absent. expiry_backfilled is true when the migration set a 90 day expiry on an existing row.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/tokens'
Example Response200
Empty

Create a token

POST
/v1/workspaces/{workspace_id}/tokens

Body role is owner, admin, developer, or viewer. expires_in is optional. Empty means 90 days. Units are m, h, and d. The shortest value is 1m and the longest is 365d. never is rejected. name is optional, at most 64 characters, and has no control characters. The response includes expires_at, the name when one was set, and the token secret once. An expired bearer later returns 401 unauthenticated with message token expired. Optional stage_only marks the token so it cannot call change deploy.

Response Body

The token secret is included once. expires_at is set. last_used_at is null.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/tokens'
Example Response
Empty
POST
/v1/workspaces/{workspace_id}/clusters

The response is HTTP 200 because the check finishes inside the request. A kubeconfig that does not parse, or a cluster that does not answer, finishes as failed and stores no cluster row. GET of the returned cluster_id is 404. When DFLOW_KUBECONFIG_KEY is set, a successful check stores an AES-256-GCM blob and the operation status is succeeded. When that variable is empty, status failed with error_code precondition means the report was saved and the credential was not stored. The response has no kubeconfig and no ciphertext. The body requires region, a short name such as in or us. This cluster stays on that workspace. A body with shared true is rejected. A platform cluster is POST /v1/admin/clusters and has no workspace. A missing Idempotency-Key creates no row.

Header Parameters

Idempotency-Key*string

Response Body

The operation already finished. This is not a stored credential.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/clusters' \  -H 'Idempotency-Key: string'
Example Response
Empty
GET
/v1/workspaces/{workspace_id}/clusters/{cluster_id}

Response Body

The cluster row. credential_state is not_persisted or stored. The response has no kubeconfig and no ciphertext.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/workspaces/{workspace_id}/clusters/{cluster_id}'
Example Response
Empty
GET
/v1/admin/clusters

Platform owner only. Each item has id, name, provider, and credential_state. workspace_id is present for a private cluster. A platform cluster has no workspace. The response has no kubeconfig.

Response Body

Items ordered by id. An empty list is an empty items array.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/clusters'
Example Response
Empty
POST
/v1/admin/clusters

Platform owner only. The cluster has a region and no workspace. Every workspace can place an environment on it. The response is HTTP 200 because the check finishes inside the request. The response has no kubeconfig. A kubeconfig that does not parse, or a cluster that does not answer, stores no row. A missing Idempotency-Key creates no row.

Header Parameters

Idempotency-Key*string

Response Body

The operation already finished.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/admin/clusters' \  -H 'Idempotency-Key: string'
Example Response
Empty
GET
/v1/admin/clusters/{cluster_id}

Platform owner only. The body matches one item from the list route. The response has no kubeconfig. Cross-tenant callers receive 404.

Path Parameters

cluster_id*string

Response Body

The cluster row without credentials.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/clusters/string'
Example Response
Empty
GET
/v1/admin/operations

Platform owner only. Each item has id, type, status, and workspace_id. message is present when the operation failed. page_size defaults to 50 and cannot exceed 200. There is no next page.

Response Body

The newest operations, newest first.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/operations'
Example Response
Empty
GET
/v1/admin/backups

Platform owner only. recovery_point and recovery_time are the word assumption. They are not a commitment. objective_met is false when no successful run finished inside 24 hours. last_local_at is the newest successful dump time. last_remote_at is the newest off-machine copy time. Both are empty when there is no such time. The response has no database URL, no platform key, and no age identity.

Response Body

The newest backup runs.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/backups'
Example Response
Empty
POST
/v1/admin/backups

Requires Idempotency-Key. HTTP 202 means the dump was queued. It does not mean the dump finished. An empty DFLOW_BACKUP_DIR or a directory on the database volume returns 412 and writes no file.

Response Body

Full Operation record accepted (id, operation_id, resource_id) with status pending.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/admin/backups'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
GET
/v1/admin/health

Platform owner only. With no object store, or with no age recipient, status is ok. A remote copy error on the latest successful dump returns 503. The 200 body has last_backup_at, last_remote_at, leader_id, queue.general, queue.build, oldest_pending_age_seconds, registry_disk, and registry_disk_used_pct. Empty times are empty strings. leader_id is empty when nobody holds the maintenance lock. registry_disk is ok, failing, or skipped. skipped means the hosted cluster is unset, its credential is not stored, or the volume stats could not be read. registry_disk_used_pct is the nearest integer percent, or 0 when skipped. A percent above 80 is HTTP 503 with status failing and registry_disk failing. That 503 body is this health object. A backup or read failure stays the error object. The body has no age identity, no object-store key, and no token.

Response Body

status ok, plus backup times, the leader id, and the pending queue.

application/json
  1. response
status*string
last_backup_at*string
last_remote_at*string
leader_id*string
oldest_pending_age_seconds*integer
registry_disk*string
registry_disk_used_pct*integer
queue*
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/health'
Example Response
{  "status": "ok",  "last_backup_at": "",  "last_remote_at": "",  "leader_id": "",  "oldest_pending_age_seconds": 0,  "registry_disk": "skipped",  "registry_disk_used_pct": 0,  "queue": {    "general": 0,    "build": 0  }}
GET
/v1/admin/maintenance

Platform owner only. Reports whether DFLOW_MAINTENANCE_MODE-style release freeze is currently on for this API process. Startup reads DFLOW_MAINTENANCE_MODE; PUT flips it in memory without restart. Not workspace suspend. Not an MCP tool.

Response Body

Current freeze flag.

application/json
  1. response
enabled*boolean
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/maintenance'
Example Response
{  "enabled": false}
PUT
/v1/admin/maintenance

Platform owner only. Sets the in-process release freeze without editing api.env or restarting. When enabled is true, mutating product /v1 routes return 503; GETs, probes, /v1/admin/*, and auth refresh/logout stay up. GET /v1/version.maintenance matches. A process restart reloads DFLOW_MAINTENANCE_MODE from the environment. dflow-server maintenance:on and maintenance:off call this route. Not an MCP tool.

Request Body

application/json
  1. body
enabled*boolean

Response Body

The freeze flag after the change.

application/json
  1. response
enabled*boolean
Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/admin/maintenance' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
Example Response
{  "enabled": true}

List signup invite codes

GET
/v1/admin/signup-invites

Platform owner only. The plaintext code is not included. used is how many accounts have been created with that code.

Response Body

items of id, email, max_uses, used, expires_at, created_at, created_by, and revoked_at. No code.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/admin/signup-invites'
Example Response
Empty
POST
/v1/admin/signup-invites

Platform owner only. The response code is the plaintext and is shown once. Later reads do not return it. The database stores the SHA-256 hash. email empty means any address can register with the code. max_uses defaults to 1 and must be 1 to 100. ttl_seconds defaults to 14 days and must be from 1 hour to 90 days. created_by is the token id, not the bearer secret.

Response Body

id, code, email, max_uses, used, expires_at, and created_at. code is not stored and is not logged.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/admin/signup-invites'
Example Response
Empty
POST
/v1/admin/signup-invites/{invite_id}/revoke

Platform owner only. A second revoke returns the same row. The id starts with inv_.

Response Body

The invite, including revoked_at. The plaintext code is not included.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/admin/signup-invites/{invite_id}/revoke'
Example Response
Empty
POST
/v1/stream-tokens

The caller sends a bearer token and exactly one of operation_id or application_id. The response token starts with st_ and expires_in is 60. It is HMAC-signed with a key derived from DFLOW_DATA_KEY and it is not stored. An empty data key is HTTP 412 with precondition. GET /v1/operations/{operation_id}/events and GET /v1/operations/{operation_id}/logs accept ?stream_token= for that operation. GET /v1/applications/{app_id}/logs, /events, and /pod-events accept it for that application on JSON and on follow=true. Any other route still requires a bearer token. An expired token or a token used on a different resource is HTTP 401. The access log omits the query string. A logged URL redacts stream_token.

Response Body

The token is shown once. Cache-Control is no-store.

application/json
  1. response
token*string
expires_in*integer
Example Request
curl -X POST 'https://k8s.dflow.sh/v1/stream-tokens'
Example Response
{  "token": "st_example",  "expires_in": 60}

Read one operation

GET
/v1/operations/{operation_id}

HTTP 200 includes a failed operation. A failed deploy's error_message names the container when the cluster reported one. request_id is the API request that queued the operation, or empty when the row predates that column. The body has no idempotency key and no credential.

Response Body

The operation. status failed is still HTTP 200.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref when both are present.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/operations/{operation_id}'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "resource_id": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z"}
GET
/v1/operations/{operation_id}/events

The response is text/event-stream. Each row is id, event, and one data JSON object with seq, kind, status, phase, detail, and at. kind is status, phase, or log_hint. The event name is status, phase, or log. log is the event name for kind log_hint. Last-Event-ID, or the after query when that header is absent, is the last seq the client has applied. The stream sends later rows, a comment line every 15 seconds while it waits, and event end after a terminal status. Cache-Control is no-cache. X-Accel-Buffering is no. Another workspace's operation is 404. A browser EventSource can send stream_token from POST /v1/stream-tokens instead of a bearer header. The token must be scoped to this operation. An expired or wrong-scope token is 401. The query value is not written to the access log.

Response Body

The event stream. It stays open until the operation is finished, then closes after event end.

response?stringtext/event-stream
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/operations/{operation_id}/events'
Example Response
"string"
GET
/v1/operations/{operation_id}/logs

Without follow, returns JSON {chunks:[{seq,stream,body,at}]} oldest first (PRD-069). When DFLOW_BETTERSTACK_QUERY_TOKEN and DFLOW_BETTERSTACK_QUERY_SOURCE_ID are set, historical reads prefer Better Stack filtered by this operation id (the same id on deployments.operation_id / source_builds.operation_id). An empty sink falls back to Postgres operation_log_chunks. When those settings are unset, chunks only. Query tail defaults to 500 and must be from 1 to 5000. An empty log is chunks [] and message No logs yet. follow=true returns text/event-stream from Postgres chunks only (live wait / --wait). Last-Event-ID, or the after query when that header is absent, is the last seq the client has applied. Each later chunk is id, event log, and data with seq, stream, body, and at. A comment line is written every 15 seconds while the stream waits. After the operation is finished and the stored chunks are sent, the stream sends event end and closes. The body is redacted. Another workspace's operation is 404. A stream_token scoped to this operation may replace the bearer header. An expired or wrong-scope token is 401. Product durability is Better Stack retention plus the operation id pointer; chunk retention stays a live-wait cache.

Query Parameters

tail?integer

Line count for non-follow historical reads. Ignored when follow=true.

Range1 <= value <= 5000
Default500
follow?boolean
after?integer

Last applied seq when Last-Event-ID is absent (follow only).

Range0 <= value

Response Body

JSON chunks, or a text/event-stream when follow=true.

  1. response
chunks*array<>
message?string
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/operations/{operation_id}/logs'
Example Response
{  "chunks": [],  "message": "No logs yet."}

Cancel one operation

POST
/v1/operations/{operation_id}/cancel

A pending operation becomes cancelled. A running operation stays running until the handler stops. A finished operation is unchanged.

Response Body

The operation was pending or running.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/operations/{operation_id}/cancel'
Example Response
Empty

Revoke a token

POST
/v1/tokens/{token_id}/revoke

An unknown token id is 404. A token that is already revoked is 409 with code conflict. The confirmation is the display prefix.

Response Body

The token is revoked after the display prefix matches.

Example Request
curl -X POST 'https://k8s.dflow.sh/v1/tokens/{token_id}/revoke'
Example Response
Empty
GET
/v1/applications/{app_id}/logs

Reads durable application logs from Better Stack when DFLOW_BETTERSTACK_QUERY_TOKEN and DFLOW_BETTERSTACK_QUERY_SOURCE_ID are set on dflow-api (PRD-068). When those are unset, falls back to live kubectl pod logs (PRD-023). Query format defaults to txt (text/plain). format=json returns application/json {"lines":[…]}. Empty JSON is {"lines":[]}. Lines are oldest to newest. Query tail defaults to 500 and must be from 1 to 5000. Query pods (repeatable or comma-separated) filters to named pods; omitted returns every replica. Query container selects one container name when present on sink events. follow=true returns text/event-stream of new sink lines (polled). since is an optional RFC3339 time for follow. Levels are normalized (warning→warn; missing→info; unknown lowercase passthrough). A bearer token, platform token, URL password, or kubeconfig secret in the text is replaced with [redacted]. Missing both sink credentials and a selected cluster returns 412 cluster_not_selected. A stream_token scoped to this application may replace the bearer header. An expired or wrong-scope token is 401.

Query Parameters

tail?integer
Range1 <= value <= 5000
Default500
format?string
Default"txt"
Value in"txt""text""json"
pods?string

Pod name filter; repeat or comma-separate for multiple.

container?string
follow?boolean
since?string
Formatdate-time

Response Body

text/plain txt tail, JSON {"lines":[…]}, or text/event-stream when follow=true.

response?string
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/logs'
Example Response
{  "lines": []}
GET
/v1/applications/{app_id}/pod-events

Returns events whose involved object is a pod labeled for this application. This is separate from the platform operation list. page_size defaults to 50 and must be from 1 to 200. An empty page includes message No pod events yet. No selected cluster returns 412. A stream_token scoped to this application may replace the bearer header. An expired or wrong-scope token is 401.

Response Body

Kubernetes events for this application's pods.

application/json
  1. response
events*array<>
next_page_token?string
message?string
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/pod-events'
Example Response
{  "events": [],  "message": "No pod events yet."}
GET
/v1/applications/{app_id}/events

Items are operation records. They are not Kubernetes Event objects. Newest first. page_size defaults to 50 and maxes at 100. page_token or cursor returns the next page. next_page_token and next_cursor are the same opaque cursor. An empty first page includes the message No events yet. Operation history stays available after the application is deleted so Activity and audits can replay deploy history. A stream_token scoped to this application may replace the bearer header. An expired or wrong-scope token is 401. The live server-sent stream is GET /v1/operations/{operation_id}/events.

Path Parameters

app_id*string

Query Parameters

page_size?integer
limit?integer
page_token?string
cursor?string
hide_succeeded_repairs?boolean

When true, hides succeeded application.repair rows (default true).

Response Body

Operation history for the application.

application/json
  1. response
items*array<>
next_page_token?string
next_cursor?string
message?string
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/string/events'
Example Response
{  "items": [],  "message": "No events yet."}
GET
/v1/applications/{app_id}/route

tls is tls_disabled, pending, or ready. custom_domains lists the extra hostnames. A stored platform hostname is returned even when the application's recipe says route.public is false. That flag skips creating a hostname. It does not hide one that is already stored. No platform row returns 404.

Response Body

The stored platform host, its custom hostnames, and the last observation. public is false when the document has no route.public true. The hostname stays stored.

application/json
  1. response
id?string
host?string
tls?string

tls_disabled, pending, or ready.

address?string
observed_at?string
public*boolean

True only when the application document route.public is true. False when the document has no public true. A false value keeps the stored hostname and does not make it live.

custom_domains?array<>
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/route'
Example Response
{  "id": "string",  "host": "string",  "tls": "string",  "address": "string",  "observed_at": "string",  "public": true,  "custom_domains": [    {      "id": "string",      "host": "string",      "tls": "string",      "address": "string",      "observed_at": "string"    }  ]}
PUT
/v1/applications/{app_id}/route

By default this stages domain.add into the environment draft and returns HTTP 202 with status staged. No domain row or application.route operation is created until changes deploy. Query trust_skip=true applies immediately and returns HTTP 202 with a pending application.route operation. An omitted host uses the application, project, and environment names plus DFLOW_APPS_DOMAIN. That platform hostname is the only name under the platform suffix. A host outside that suffix is a custom hostname. Adding one creates the platform hostname first when it is missing. An application stores at most 10 custom hostnames. A name under the platform suffix, other than the stored platform hostname, returns 400. An empty ingress class or an empty apps domain returns 412. The response has no kubeconfig.

Query Parameters

trust_skip?boolean

When true, apply the route change immediately.

Response Body

The route change was staged, or a route operation was accepted when trust_skip is true.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/route'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
DELETE
/v1/applications/{app_id}/route/{host}

By default this stages domain.remove. Query trust_skip=true removes immediately and returns a pending application.route operation. The platform hostname stays. An unknown host returns 404.

Query Parameters

trust_skip?boolean

Response Body

The route removal was staged, or a route operation was accepted when trust_skip is true.

application/json
  1. response
id*string
type*string
status*string
Value in"pending""running""succeeded""failed""cancelled"
resource_ref?string
resource_id?string

Same value as resource_ref. Present on HTTP 202 acceptance bodies for CLI compatibility.

request_id?string

The API request that queued this operation. Empty on a row created before the column existed.

error_code?string
error_message?string
created_at?string
Formatdate-time
started_at?string
Formatdate-time
finished_at?string
Formatdate-time
cancel_requested_at?string
Formatdate-time
operation_id?string

Same value as id. Present on HTTP 202 acceptance bodies for operator CLI compatibility.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/applications/{app_id}/route/{host}'
Example Response
{  "id": "string",  "type": "string",  "status": "pending",  "resource_ref": "string",  "request_id": "string",  "error_code": "string",  "error_message": "string",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z",  "resource_id": "string",  "operation_id": "string"}
GET
/v1/applications/{app_id}/env

Returns revision and values. Secret values are never included. Secret-like key names and URL userinfo are masked unless query reveal=true.

Query Parameters

reveal?boolean

Response Body

The stored non-secret map.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/env'
Example Response200
Empty
PUT
/v1/applications/{app_id}/env

Replaces the caller's non-secret variables. Keys the platform already stored are kept. That includes DFLOW_ link variables such as DFLOW_DATABASE_HOST, and PORT or KUBERNETES_SERVICE_HOST when one is already stored. Sending one of those keys with the same stored value is ignored. A new or different reserved name returns 400 and leaves the stored map unchanged. Env and secret writes always stage into the shared environment draft and return 200 with status staged unless the caller trust-skips. Query trust_skip=true runs the same trust-skip path as POST .../changes/entries: one private change set, role gates, audit, and application.deploy when needed.

Query Parameters

trust_skip?boolean

When true, trust-skip deploys env changes immediately.

Response Body

The map was unchanged or staged into the environment draft, or trust-skip finished without a deploy operation.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/env'
Example Response
Empty
DELETE
/v1/applications/{app_id}/env/{key}

Removes a caller-owned key in the environment draft unless the caller trust-skips with trust_skip=true.

Query Parameters

trust_skip?boolean

Response Body

The key was staged unset, removed with no change, or trust-skip finished without a deploy operation.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/applications/{app_id}/env/{key}'
Example Response
Empty

List secret key names

GET
/v1/applications/{app_id}/secrets

Returns sorted key names only. Values and ciphertext are never returned.

Response Body

The key name list.

Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/secrets'
Example Response200
Empty

Remove one secret

DELETE
/v1/applications/{app_id}/secrets/{key}

Stages secret removal unless the caller trust-skips with trust_skip=true.

Query Parameters

trust_skip?boolean

Response Body

The removal was staged or trust-skip finished without a deploy operation.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/applications/{app_id}/secrets/{key}'
Example Response
Empty
PUT
/v1/applications/{app_id}/secrets/{key}

Stores AES-256-GCM ciphertext under DFLOW_DATA_KEY. Writes always stage unless the caller trust-skips with trust_skip=true. GET of secrets never returns the value. A body field named data_key is rejected.

Query Parameters

trust_skip?boolean

Response Body

The secret was staged or trust-skip finished without a deploy operation.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/secrets/{key}'
Example Response
Empty

Git clone token presence

GET
/v1/applications/{app_id}/source/git-token

Returns whether a per-application git clone token is stored. The token value is never returned.

Response Body

Token presence.

application/json
  1. response
has_git_token*boolean
Example Request
curl -X GET 'https://k8s.dflow.sh/v1/applications/{app_id}/source/git-token'
Example Response200
{  "has_git_token": true}
DELETE
/v1/applications/{app_id}/source/git-token

Stages removal unless trust_skip=true. confirmation=yes is required.

Query Parameters

confirmation*"yes"
Value in"yes"
trust_skip?boolean

Response Body

Staged or trust-skip applied.

Example Request
curl -X DELETE 'https://k8s.dflow.sh/v1/applications/{app_id}/source/git-token?confirmation=yes'
Example Response
Empty

Store a git clone token

PUT
/v1/applications/{app_id}/source/git-token

AES-256-GCM under DFLOW_DATA_KEY. Write-only; stages like other config unless trust_skip=true. Optional repo binds the token to one private repository before the application document has build.repo.

Query Parameters

trust_skip?boolean

Request Body

application/json
  1. body
token*string
repo?string

HTTPS or owner/name URL; required for first private builds when build.repo is not set yet.

Response Body

Staged or trust-skip applied.

Example Request
curl -X PUT 'https://k8s.dflow.sh/v1/applications/{app_id}/source/git-token' \  -H 'Content-Type: application/json' \  -d '{  "token": "string"}'
Example Response
Empty

How is this guide?