The module lifecycle stage: Generally available version

The module has requirements for installation

A Technology Preview of an actively developed Terraform provider is available for Deckhouse Commander; it works via the Integration API described in this section. Currently, the provider supports creating, updating, and deleting clusters and cluster templates within a single workspace, so use it with an API key of a workspace service account: such a key needs no workspace context.

Overview

Deckhouse Commander exposes an external API for automation and integration scenarios — CI/CD, self-service portals, IDP platforms. Interactive OpenAPI (Swagger) documentation is built into the web interface and always matches the running backend; to open it, click the gear icon in the top menu bar:

  • on a page outside workspaces, for example in the Workspaces section, the API Documentation item opens the global API reference at /documentation;
  • on a workspace page, the API Documentation item opens the workspace API reference at /workspaces/<workspace-slug>/auth-tokens/documentation.

Every request must include an API key in the X-Auth-Token HTTP header. All paths are relative to https://$COMMANDER_HOST; examples in this document use $COMMANDER_HOST for the host and $COMMANDER_GLOBAL_TOKEN / $COMMANDER_TOKEN for keys.

GET /api/v1/workspaces HTTP/1.1
Host: $COMMANDER_HOST
X-Auth-Token: $COMMANDER_GLOBAL_TOKEN
Accept: application/json

An API key belongs to a service account — the identity that makes the call. Permissions come from the roles bound to that account, not from the key: all keys of one account act with the same permissions, and revoking a key does not change them. Keys are issued in the “Service accounts” tab of the “Users and Permissions” section (see Integration API and service accounts for the full procedure).

There are two kinds of service accounts, and the kind determines which API methods a key can call:

  • Global service accounts — managed in the global “Users and Permissions” section, an item of the top menu on pages outside workspaces. With a global role binding they call the global methods: workspaces, global roles, global role bindings, workspace role bindings, and billing. They also call the workspace methods in every workspace they have a binding in, with an explicit workspace context — see Workspace context.
  • Workspace service accounts — managed in the “Users and Permissions” section of their own workspace. They call the workspace methods of that workspace only: clusters, cluster templates, inventory catalogs, records, container registries, and projects. The global methods and any other workspace return 403 Forbidden.

Requests without a key, or with a revoked, expired, or unrecognized key, return 401 Unauthorized. Permissions on the resources below are checked as described in Access Management. Service accounts and their keys are managed only in the web interface and are not part of the Integration API, so an account cannot issue keys for itself. For exhaustive request and response schemas, enums, and per-method status codes, always consult the Swagger UI.

Workspace context

A workspace service account needs no workspace context: the workspace follows from the account itself. The X-Commander-Workspace-ID header is accepted only when it repeats that same workspace.

A global service account specifies the workspace in the X-Commander-Workspace-ID header, which takes the workspace UUID:

GET /api/v1/clusters HTTP/1.1
Host: $COMMANDER_HOST
X-Auth-Token: $COMMANDER_GLOBAL_TOKEN
X-Commander-Workspace-ID: 7f3b9e6a-2c4d-4f8a-9b1e-5d7c6a8f0b2c
Accept: application/json

The rules are the same for every method:

Service account Methods X-Commander-Workspace-ID Result
Global Global Absent Permissions from the global role bindings of the account
Global Global Present 400 invalid_workspace_context
Global Workspace Valid workspace ID Permissions of the account in the selected workspace
Global Workspace Absent or malformed 400 invalid_workspace_context
Workspace Its own workspace Absent, or equal to that workspace Permissions from the workspace role bindings of that workspace
Workspace Another workspace, or the global methods Any 403 Forbidden

An object of another workspace, of a workspace that does not exist, or an object that does not exist at all, returns 403 Forbidden: the API does not reveal whether an inaccessible object exists.

Available global methods

Available to a global service account with the matching global role bindings. Billing methods are global as well and are listed in Billing operations.

  1. Manage global roles:
    • GET /api/v1/global_roles
    • POST /api/v1/global_roles
    • GET /api/v1/global_roles/:id
    • PUT /api/v1/global_roles/:id
    • DELETE /api/v1/global_roles/:id
  2. Manage global role bindings:
    • GET /api/v1/global_role_bindings
    • POST /api/v1/global_role_bindings
    • GET /api/v1/global_role_bindings/:id
    • PUT /api/v1/global_role_bindings/:id
    • DELETE /api/v1/global_role_bindings/:id
  3. Manage workspaces:
    • GET /api/v1/workspaces
    • POST /api/v1/workspaces
    • PUT /api/v1/workspaces/:id
    • DELETE /api/v1/workspaces/:id
  4. Manage workspace role bindings:
    • GET /api/v1/workspace_role_bindings
    • POST /api/v1/workspace_role_bindings
    • GET /api/v1/workspace_role_bindings/:id
    • PUT /api/v1/workspace_role_bindings/:id
    • DELETE /api/v1/workspace_role_bindings/:id

Billing operations

The Integration API lets you retrieve calculated costs, manage accounts, tariff plans, and tariffs, and list and create financial operations and resource classes. Worked requests are in Billing examples.

Billing methods belong to the global API, and the conditions for reaching them differ from the rest of it:

  • billing must be enabled;
  • the caller must be a global service account, and the call is made in the global context, not in a workspace context;
  • the billing-admin role covers every billing method, and narrower access is a global role with the required resources and verbs, see billing permissions.

The complete request and response schemas, filters, CSV headers, and errors are available in the global Swagger UI at /documentation. The global API provides the following billing operations:

Operation Method and path
Calculated cost details GET /api/v1/billing_costs
List or create accounts GET /api/v1/billing_accounts, POST /api/v1/billing_accounts
Read, update, or archive an account GET /api/v1/billing_accounts/:id, PUT /api/v1/billing_accounts/:id, DELETE /api/v1/billing_accounts/:id
Schedule or replace an account plan change POST /api/v1/billing_accounts/:id/tariff_plan_changes
Cancel a scheduled plan change DELETE /api/v1/billing_accounts/:id/tariff_plan_changes/:change_id
List transactions or post a financial operation GET /api/v1/billing_accounts/:id/transactions, POST /api/v1/billing_accounts/:id/transactions
Read one transaction GET /api/v1/billing_accounts/:id/transactions/:transaction_id
List or create tariff plans GET /api/v1/billing_tariff_plans, POST /api/v1/billing_tariff_plans
Read or update a plan GET /api/v1/billing_tariff_plans/:id, PUT /api/v1/billing_tariff_plans/:id
Copy a plan POST /api/v1/billing_tariff_plans/:id/copy
Change the default plan PUT /api/v1/billing_tariff_plans/:id/default
Archive a plan POST /api/v1/billing_tariff_plans/:id/archive
Scheduled changes blocking archive GET /api/v1/billing_tariff_plans/:id/pending_tariff_plan_changes
List or create tariffs GET /api/v1/billing_tariffs, POST /api/v1/billing_tariffs
Read, update, or delete a tariff GET /api/v1/billing_tariffs/:id, PUT /api/v1/billing_tariffs/:id, DELETE /api/v1/billing_tariffs/:id
Import new tariffs POST /api/v1/billing_tariffs/import
List or create compute classes GET /api/v1/billing_resources/compute_classes, POST /api/v1/billing_resources/compute_classes
List or create storage classes GET /api/v1/billing_resources/storage_classes, POST /api/v1/billing_resources/storage_classes
List generated reports GET /api/v1/billing_reports

GET /api/v1/billing_reports returns completed scheduled reports in the “Detailed CSV” format. “Dashboard table” files are excluded. After a technical outage, active schedules catch up missed runs, so files may appear later with their original periods. A calendar change can leave days without a file at the boundary. Pausing or deleting a schedule stops new runs but leaves previously created files available. Before a “Detailed CSV” schedule is paused or deleted, the web interface warns that its reports are available through the API and suggests checking the configuration of external integrations that use these files.

Plan creation and updates require billingtariffs:create and billingtariffs:update respectively; reading requires billingtariffs:get. The first plan automatically becomes the default. Changing the name or description of an archived plan with PUT /api/v1/billing_tariff_plans/:id returns 422.

Plan listing supports filter[name], filter[archived], per_page (20 by default, from 1 to 9999), and cursor. Archived plans are excluded by default; filter[archived]=true selects only archived plans.

Plan responses include accounts_count (current non-archived accounts) and used_accounts_count (accounts with current or applied historical assignments) only with billingaccounts:get. Without this permission, both fields are omitted.

Copying a plan accepts a new unique name and optional description, requires billingtariffs:create, and returns the new plan with status 201. All tariffs and prices are copied atomically; a failure leaves no partial copy. The source may be empty or archived.

Changing the default and archiving require billingtariffs:update and return the plan with status 200. The new default must be active; changing it does not reassign existing accounts. For workspaces without an account, it also applies when calculating past periods. The current default cannot be archived. Archiving preserves tariffs and cost calculations for existing accounts, but prevents new assignments and scheduled changes to that plan. Violating these restrictions or copying with a duplicate name returns 422 with field errors. Deleting and restoring plans are not supported.

Listing changes that block plan archiving requires billingtariffs:update. The response contains data with changes: id, account_id, account_name, starts_on. The list contains only accessible accounts; without billingaccounts:get, the response has data: []. An archive refusal contains a general reason without account names or change dates.

Changing an account plan requires billingaccounts:update. The request contains tariff_plan_id, starts_on (a future date in Europe/Moscow), and a required reason. To replace a change, pass pending_tariff_plan_change.id from the account as expected_change_id; when no change exists, omit it or pass null. A stale identifier, or a missing identifier when a change is already scheduled, returns 409 without replacing the change. The new plan must be active and differ from the current plan; field errors return 422.

Scheduling returns the account with status 201, cancellation with status 200. A change that has taken effect cannot be cancelled. Archiving an account cancels its scheduled change; a plan selected as the destination of a scheduled account change cannot be archived. The dashboard, reports, calculated account expense, and suggested deductions use the previous plan before each change and the new plan from its date. Posted financial operations remain unchanged. Scheduling, replacement, cancellation, and application are recorded in the audit history.

Cost details and data export

Cost details are calculated synchronously, by the same rules as the billing dashboard; available groupings and filters are listed in Swagger. The from and to parameters are UTC timestamps that fall on calendar-day boundaries in Europe/Moscow, and to is exclusive.

Use tariff_plan_ids[] to retain consumption intervals of selected plans and group_by=tariff_plan_id to group by plan. Each JSON and CSV row includes tariff_plan_id. Requests without this filter continue to evaluate all selected resources by the existing rules.

The tariff_plan_ids[] filter accepts UUIDs of existing plans; an unknown ID returns 422. An archived plan without consumption in the selected period produces an empty cost result.

JSON is the default response format. CSV export and paging work differently for cost details and for lists:

Data CSV Paging
Cost details response_format=csv None, the whole result is returned at once
Lists of accounts, transactions, and tariffs response_format=csv Cursor-based, per_page from 1 to 9999 (20 by default)

The next page is requested with the returned cursor: JSON carries it in the cursor field, CSV in the X-Next-Cursor header. A null cursor in JSON or an empty X-Next-Cursor header in CSV marks the last page.

Which calculated values an account carries depends on how it is read:

  • the account list contains the posted balance and paid_until, but does not calculate current expense or forecast;
  • reading one account adds them;
  • the forecast_days and forecast_until fields stay empty while the available balance is not positive or nothing is being consumed.

A successful response does not confirm that metrics cover the entire requested period. Missing samples or gaps produce a partial or empty result with 200, and the response carries no indicator of metric coverage. Therefore, no rows or a zero total does not prove that there was no consumption.

Classes with positive consumption and zero calculated cost are counted separately when a tariff applies:

  • partial_tariff_unpriced_rows holds the total, and unpriced_compute_classes with unpriced_storage_classes break it down by kind of class;
  • in CSV the same values arrive in the X-Unpriced-Classes, X-Unpriced-Compute-Classes, and X-Unpriced-Storage-Classes headers.

A non-zero value can indicate a missing class price or an explicitly configured zero price. Periods without an applicable tariff produce no rows and do not contribute to these counters.

Each query to the metrics source has a 120-second client timeout, and one API request may run several of them, so set caller and proxy timeouts accordingly. If the metrics source is unavailable, the API returns a 503 JSON error with error_code: prometheus_unavailable and no partial data. Retry later; if the request times out, shorten the period or use filters to narrow the selection.

Accounts and financial operations

An account is what consumption is billed to: it holds the balance, the linked workspaces, the holders, and the history of top-ups and deductions. Deleting an account archives it — the workspace and holder assignments are removed, the transaction history is preserved, and an archived account can neither be changed nor accept new financial operations.

The optional tariff_plan_id field selects an unarchived plan when creating an account. Without the field, the account inherits the default plan or has no plan if the catalog is empty. Unknown or archived plans are rejected. Selecting a plan at creation requires only billingaccounts:create, without tariff read permission. Ordinary account updates do not change its plan.

Cost queries use each workspace’s current account and its plan history for consumption dates. Account expense and suggested deductions follow the same rule with current workspace membership. Workspaces without an account use the current default plan. Moving a workspace preserves posted transactions and does not transfer its previous account’s paid_until. A suggestion may therefore include consumption already paid elsewhere or skip unpaid consumption before the destination account’s “paid until” date. Reconcile both accounts’ transactions and set the amount manually; the first period’s start can be changed while the destination account has no deductions. A deduction must be positive, and posting it advances paid_until regardless of the manually chosen amount.

Posting a top-up or deduction requires the Idempotency-Key header. The key belongs to the immutable service-account ID, so rotating an API key does not change the idempotency scope. What a repeat returns depends on the request body:

Request with an Idempotency-Key Result
First one with this key 201 and the created transaction
Repeat with the same body 200 and the same transaction, nothing is posted twice
Repeat with a changed body 409 idempotency_conflict

Two more properties of the account methods are worth knowing in advance:

  • a transaction response does not include the account balance — read the account separately when it is needed;
  • reading one account and the first deduction on an account query the metrics source, so both return 503 when it is unavailable.

Tariff changes and import

When creating or importing a tariff, the optional tariff_plan_id selects an unarchived plan. If omitted, the current default plan is used. An unknown or archived plan is rejected. Without a default plan, a request without tariff_plan_id is rejected: create a plan first. Tariff creation and import requests do not create a plan automatically. Changing the default also affects subsequent requests that omit tariff_plan_id.

An unfiltered tariff list includes tariffs from all plans, including archived ones; filter[tariff_plan_id] narrows it. Tariff responses include tariff_plan_id and tariff_plan_name; names and dates can match across plans. A created tariff cannot be moved to another plan. These rules affect the compatibility of older initialization and tariff-listing scripts.

A tariff sets the price of a resource class starting from a given date. Period costs use the dated tariffs of the account plans effective on consumption dates; workspaces without an account use the default plan. The API keeps no immutable tariff versions, so updating or deleting a tariff also changes what a repeated calculation returns for the period it applied to. To change prices for a future period, create a new tariff with a later start_date instead of editing an active or historical one.

Tariff import accepts JSON or UTF-8 CSV and only creates tariffs — it never updates existing ones. In JSON, set tariff_plan_id in each item of tariffs; in CSV, use the optional tariff_plan_id column. The exact fields and required CSV columns are listed in Swagger. The permissions it needs are:

  • billingtariffs:create and billingresources:get — always;
  • billingresources:create — additionally, when a referenced class does not exist yet.

Exports include the source plan ID. Before importing into another installation, replace tariff_plan_id with a local plan ID or remove the field to use the local default plan. An explicitly supplied unknown ID returns an error.

Import runs in two steps, and the step that fails determines what is left behind:

Step What it does A failure at this step
Class preparation Creates the missing compute and storage classes Stops the import before any tariff is created; the classes already created remain
Tariff creation Processes each tariff on its own Leaves the other tariffs processed; every entry carries its own created or error result

An HTTP 200 response does not mean that every tariff was imported. Check each tariff’s result.

Available workspace methods

All methods operate on a single workspace: the workspace of the account for a workspace service account, or the workspace from X-Commander-Workspace-ID for a global one. Methods marked (archivable) accept an archived=true query parameter to include archived entities in the response; archived entities are excluded by default.

  1. Manage cluster templates:
    • GET /api/v1/cluster_templates (archivable)
    • POST /api/v1/cluster_templates
    • GET /api/v1/cluster_templates/:id
    • PUT /api/v1/cluster_templates/:id
    • DELETE /api/v1/cluster_templates/:id
    • DELETE /api/v1/cluster_templates/:id/permanent
  2. Manage inventory catalogs:
    • GET /api/v1/catalogs (archivable)
    • POST /api/v1/catalogs
    • GET /api/v1/catalogs/:id
    • PUT /api/v1/catalogs/:id
    • DELETE /api/v1/catalogs/:id
  3. Manage catalog records:
    • POST /api/v1/records
    • GET /api/v1/records (archivable)
    • GET /api/v1/records/:id
    • PUT /api/v1/records/:id
    • DELETE /api/v1/records/:id
  4. Manage clusters:
    • POST /api/v1/clusters
    • GET /api/v1/clusters (archivable)
    • GET /api/v1/clusters/:id
    • GET /api/v1/clusters/:id/status
    • PUT /api/v1/clusters/:id
    • DELETE /api/v1/clusters/:id
    • DELETE /api/v1/clusters/:id/force
    • DELETE /api/v1/clusters/:id/permanent
  5. Manage container registries:
    • POST /api/v1/registries
    • GET /api/v1/registries
    • GET /api/v1/registries/:id
    • DELETE /api/v1/registries/:id
  6. Manage projects:
    • GET /api/v1/projects
    • POST /api/v1/projects
    • GET /api/v1/projects/:id
    • PUT /api/v1/projects/:id
    • DELETE /api/v1/projects/:id
  7. Approve cluster change requests:
    • GET /api/v1/cluster_change_requests
    • GET /api/v1/cluster_change_requests/:id
    • POST /api/v1/cluster_change_requests/:id/approve
  8. Read cluster tasks and logs:
    • GET /api/v1/cluster_tasks (archivable)
    • GET /api/v1/cluster_task_logs (archivable)

Requests created by cluster creation approval are an exception: they are decided in the web interface only. Such a request is marked with approval_flow: true in the response, and POST /api/v1/cluster_change_requests/:id/approve returns 409 approval_flow_not_supported for it. The /approve endpoint keeps working for confirmation of destructive infrastructure changes.

Errors

Application errors share the same JSON envelope:

{
  "error": "Human-readable message",
  "error_code": "invalid",
  "errors": { "name": ["can't be blank"] }
}

Rely on error_code as the stable contract for application errors; the error message is localized and may change. Some responses are generated before the request reaches the application and have no JSON body: 429 Too Many Requests when the request rate limit is exceeded and, on the Gateway API path, 403 with an empty body. For them, rely on the status code instead of the response body; retry 429 as described in Request rate limit. Standard HTTP status codes apply; the full per-method list is in the Swagger UI. The most common cases:

  • 400 invalid_workspace_context — the X-Commander-Workspace-ID header is missing or malformed where the request needs it, or present where it is not allowed. See Workspace context.
  • 401 no_token / invalid_token — the X-Auth-Token header is missing, or its key is revoked, expired, or not recognized. A key is also rejected after its service account is deleted.
  • 403 forbidden — the service account has no permission for the operation, or the request targets a resource outside the workspace available to it.
  • 403 with an empty body, only on the Gateway API path — the alb module did not get the result of the token check within one second, or the check failed, usually because Deckhouse Commander is overloaded or temporarily unavailable. Unlike 403 forbidden, the response has no body, no Content-Type header and no error_code. This is not a permission error: retry the request with exponential backoff and reduce the number of parallel requests.
  • 409 stale_object on a PUT — the resource was modified concurrently; re-fetch, merge, and retry with the new current_revision.
  • 409 conflict on /cluster_change_requests/:id/approve (already_approved, already_completed, cluster_cannot_be_converged and similar) — do not retry approval; re-read the change request and decide on the next action.
  • 409 approval_flow_not_supported on /cluster_change_requests/:id/approve — the request was created by cluster creation approval (approval_flow: true) and can only be decided in the web interface. Retrying will not help.
  • 422 invalid — validation failed; the data field contains per-field errors.
  • 422 when creating a cluster with a registry_mode or changing it (direct_mode_unsupported, registry_mode_direct_prerequisites, registry_mode_switch_requires_direct, init_configuration_after_install, registry_mode_change_blocked, registry_mode_attached_without_template) — the registry mode or the transition is not available in the current cluster state; the error message explains the condition: “{Direct|Unmanaged} is unavailable: the resolved version … (1.75+ is required)”, “Switching to the Direct or Unmanaged mode (through ModuleConfig) is available for clusters on DKP 1.72+ with containerd v2”, “When the registry is changed, the cluster is switched to the Direct mode”, “The mode ‘InitConfiguration (deprecated)’ is available only when creating a cluster, before the installation starts”, “The registry mode can be changed after a template is connected”. The transition rules are in the “Cluster registry mode” section of the user guide.
  • 429 Too Many Requests — the request rate limit was exceeded, or there were more than 10 failed token checks within a minute from one client address (this response comes from Deckhouse Commander, with a JSON body and the Retry-After header); wait for the number of seconds from the Retry-After response header before retrying, and if the header is absent, use exponential backoff (see Request rate limit). The response body is not a stable contract.
  • 500 internal_server_error — unexpected backend error; safe to retry idempotent requests with exponential backoff.

When polling a cluster, inspect both status and render_errors: a template-render error leaves the cluster in a non-terminal status but populates render_errors.

Request rate limit

The request rate to the integration API is limited: 3000 requests per minute by default.

How exactly it is enforced depends on the path Deckhouse Commander is published through.

Publication path Limit unit Burst Retry-After header when the limit is exceeded
Ingress objects (ingress-nginx module) requests per minute allowed sent
Gateway API (alb module) requests per second, derived from the limit by dividing by 60 and rounding up only within one second’s worth of the limit not sent

On both paths the limit applies to each client IP address separately. On the Gateway API path there is also a total limit for all clients, five times the per-client limit. Integrations sending requests from one IP address share its limit.

Practical consequences for integrations:

  • Do not rely on Retry-After. When the rate limit is exceeded on the Gateway API path, the 429 response has no Retry-After header, so 429 handling has to work without it, through exponential backoff. On the Gateway API path a 429 can also come when the total limit for all clients is exceeded, even if your own rate is within the limit.
  • Spread requests over time. On the Gateway API path a burst is rejected where the Ingress path used to let it through: the limit is the same, but 3000 requests per minute become 50 requests per second, and a burst above that is tolerated only within one second’s worth of requests.
  • Limit parallel requests. On the Gateway API path, under load a request can get 403 with an empty body instead of a slow response: the token check has one second to complete.

Examples

All examples below assume the following shell variables are set:

export COMMANDER_HOST="commander.example.com"
export COMMANDER_GLOBAL_TOKEN="..."  # API key of a global service account.
export COMMANDER_TOKEN="..."         # API key of a workspace service account.

Create a workspace

curl -X "POST" \
    "https://$COMMANDER_HOST/api/v1/workspaces" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"name":"Workspace from API"}'

The response contains the workspace data. The id is needed for subsequent requests.

{
    "id": "088b8e03-e7c0-4655-aae7-d11b7609c579",
    "slug": "sftpp",
    "name": "Workspace from API",
    "comment": null,
    "main": false,
    "current_revision": 0,
    "created_at": "2026-01-15T12:19:57.002+03:00",
    "updated_at": "2026-01-15T12:19:57.002+03:00"
}

Look up a global role

To assign a global role to a user or group, fetch the role’s id:

curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/global_roles" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN"

The response contains role objects; the id field is what’s needed:

[
  {
    "id": "818c3814-4973-452e-9985-d75fbe35eb4c",
    "name": "commander-admin",
    "comment": null,
    "labels": {
      "commander.deckhouse.io/owned-by": "commander"
    },
    "current_revision": 0,
    "commander_rules": [
      {
        "id": "455ccf46-f34c-4c75-970d-4dbc361adc68",
        "verbs": ["*"],
        "resources": ["*"],
        "resource_names": null,
        "created_at": "2025-04-30T23:46:18.616+03:00",
        "updated_at": "2025-04-30T23:46:18.616+03:00"
      }
    ],
    "kubernetes_rules": [
      {
        "id": "9713527d-69df-4ecb-9db2-35df194e18b5",
        "verbs": ["*"],
        "resources": ["*"],
        "resource_names": null,
        "api_groups": ["*"],
        "created_at": "2025-06-06T16:56:32.208+03:00",
        "updated_at": "2025-06-06T16:56:32.208+03:00"
      }
    ],
    "created_at": "2025-04-30T23:46:18.567+03:00",
    "updated_at": "2025-04-30T23:46:18.567+03:00"
  }
]

Create a workspace role binding

PAYLOAD="$(jq -nc '{
    "workspace_id": "088b8e03-e7c0-4655-aae7-d11b7609c579",
    "name": "workspace-admins",
    "comment": "Role binding from API",
    "role": {
        "type": "GlobalRole",
        "id": "818c3814-4973-452e-9985-d75fbe35eb4c"
    },
    "subjects": [
        {
            "kind": "User",
            "name": "commander-admin@deckhouse.io"
        }
    ]
}')"

curl -X "POST" \
    "https://$COMMANDER_HOST/api/v1/workspace_role_bindings" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD"

Successful response:

{
    "id": "05b3abdf-20a5-447b-823b-8e1a57b46158",
    "name": "workspace-admins",
    "comment": "Role binding from API",
    "current_revision": 0,
    "role_type": "GlobalRole",
    "role": {
        "id": "818c3814-4973-452e-9985-d75fbe35eb4c",
        "name": "commander-admin",
        "comment": null,
        "labels": {
            "commander.deckhouse.io/owned-by": "commander"
        },
        "current_revision": 0,
        "created_at": "2025-04-30T23:46:18.567+03:00",
        "updated_at": "2025-04-30T23:46:18.567+03:00"
    },
    "subjects": [
        {
            "kind": "User",
            "name": "commander-admin@deckhouse.io",
            "created_at": "2026-01-15T14:01:01.858+03:00",
            "updated_at": "2026-01-15T14:01:01.858+03:00"
        }
    ],
    "created_at": "2026-01-15T14:01:01.821+03:00",
    "updated_at": "2026-01-15T14:01:01.821+03:00"
}

Add a user group to a role binding

PUT /api/v1/workspace_role_bindings/:id replaces subjects wholesale and requires current_revision for optimistic locking.

PAYLOAD="$(jq -nc '{
    "current_revision": 0,
    "subjects": [
        {
            "kind": "User",
            "name": "commander-admin@deckhouse.io"
        },
        {
            "kind": "Group",
            "name": "Administrators"
        }
    ]
}')"

curl -X "PUT" \
    "https://$COMMANDER_HOST/api/v1/workspace_role_bindings/05b3abdf-20a5-447b-823b-8e1a57b46158" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD"

Get the current template version

TEMPLATE_ID="fb999a72-efe7-4db7-af53-11b17bc0a687"

curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/cluster_templates/$TEMPLATE_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq "del(.cluster_template_versions)"

The current_cluster_template_version_id field references the latest template version:

{
  "id": "fb999a72-efe7-4db7-af53-11b17bc0a687",
  "name": "YC Dev",
  "current_cluster_template_version_id": "8e75210a-f05c-421d-84b3-fc0697814d6d",
  "comment": "",
  "current_revision": 12,
  "immutable": false,
  "created_at": "2024-02-05T17:35:44.318+03:00",
  "updated_at": "2024-04-10T18:00:57.835+03:00",
  "archived_at": null,
  "archive_number": null
}

Capture it for later use:

TEMPLATE_VERSION_ID="$(curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/cluster_templates/$TEMPLATE_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq -r ".current_cluster_template_version_id")"

Find an unused record in the catalog

Inspect the input parameter schema of the selected template version:

curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/cluster_templates/$TEMPLATE_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq -r --arg ver "$TEMPLATE_VERSION_ID" '
        .cluster_template_versions[]
        | select(.id == $ver)
        | .params'

The schema has three required parameters; one of them is a record from the yandex-cloud-slot catalog (the catalog field):

[
  { "header": "Cluster Parameters" },
  {
    "key": "slot",
    "span": 4,
    "title": "Slot for cluster in Yandex Cloud",
    "catalog": "yandex-cloud-slot",
    "immutable": true
  },
  {
    "key": "releaseChannel",
    "enum": ["Alpha", "Beta", "EarlyAccess", "Stable", "RockSolid"],
    "span": 1,
    "title": "Update channel",
    "default": "EarlyAccess"
  },
  {
    "key": "kubeVersion",
    "enum": ["Automatic", "1.25", "1.26", "1.27", "1.28", "1.29"],
    "span": 1,
    "title": "Kubernetes version",
    "default": "Automatic"
  }
]

A creatable multi-select requires type: "array" and items.suggestions as an array (may be empty). The value is an array of strings; listed suggestions are UI options, and custom strings are allowed:

{
  "key": "kubeVersions",
  "type": "array",
  "title": "Kubernetes versions",
  "items": {
    "type": "string",
    "suggestions": ["1.32", "1.33", "1.34"]
  }
}
{
  "key": "tags",
  "type": "array",
  "title": "Tags",
  "items": {
    "type": "string",
    "suggestions": []
  }
}

A strict multi-select uses type: "array" with items.enum. Only listed strings are accepted (a scalar string is rejected):

{
  "key": "harddrive",
  "type": "array",
  "title": "Disk selection",
  "items": {
    "enum": ["sdk1", "sdk2"]
  }
}

Look up the catalog by its slug:

CATALOG_ID="$(curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/catalogs" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq -r '.[] | select(.slug == "yandex-cloud-slot") | .id')"

Pick the first record that is not yet taken by another cluster (cluster_id == null) and prepare it for use in the cluster by embedding the record ID in the special x-commander-record-id field:

SLOT_VALUES="$(curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/records" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq -c --arg cid "$CATALOG_ID" '
        [ .[]
          | select(.catalog_id == $cid and .cluster_id == null) ][0]
        | .values + { "x-commander-record-id": .id }')"

echo "$SLOT_VALUES"

Result:

{
  "ip": "158.166.177.188",
  "name": "x",
  "x-commander-record-id": "5f6727e7-630c-4b18-bcf0-868ea96a27ee"
}

The x-commander-record-id key is used instead of a plain id so it never collides with user-defined id fields inside a record.

Create the cluster

PAYLOAD="$(jq -nc --argjson slot "$SLOT_VALUES" --arg ver "$TEMPLATE_VERSION_ID" '{
    "name": "Cluster from API",
    "cluster_template_version_id": $ver,
    "values": {
        "kubeVersion": "1.29",
        "releaseChannel": "EarlyAccess",
        "slot": $slot
    }
}')"

curl -X "POST" \
    "https://$COMMANDER_HOST/api/v1/clusters" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD"

The response carries the cluster state. Some fields (rendered configuration, timestamps) are omitted here for brevity:

{
    "id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
    "name": "Cluster from API",
    "values": {
        "slot": {
            "ip": "158.166.177.188",
            "name": "x",
            "x-commander-record-id": "5f6727e7-630c-4b18-bcf0-868ea96a27ee"
        },
        "kubeVersion": "1.29",
        "releaseChannel": "EarlyAccess"
    },
    "cluster_template_version_id": "8e75210a-f05c-421d-84b3-fc0697814d6d",
    "was_created": false,
    "status": "new"
}

Update a cluster

PUT /api/v1/clusters/:id replaces the cluster parameters as a whole: fields missing from the request are reset. Therefore, build the request body from the cluster’s current state and change the value you need:

CLUSTER_ID="5436e6ef-d811-472f-9c9c-46cb9c6321d9"

PAYLOAD="$(curl -sS -X "GET" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" |
    jq -c '{name, current_revision, cluster_template_version_id, registry_id, registry_mode, values}
        | .values.releaseChannel = "Stable"')"

curl -X "PUT" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD"

If the cluster changed between the read and the write, PUT returns 409 stale_object: re-read the cluster and retry with the new current_revision.

For a cluster with a legacy cloud provider configuration, set migrate_provider_format to true in the update request to render a universal template in the new format. Without this field, a universal template retains the legacy format. A template that renders the new format unconditionally can also change the format. If the update changes the format, the API returns 422 provider_format_change_requires_confirmation with difference paths and errors.provider_format_change.diff_hash. After reviewing the differences, repeat the same request with confirm_provider_format_change set to the first value of diff_hash and confirm_provider_format_preview set to the first value of errors.provider_format_change.preview_token. The encrypted preview expires after 15 minutes. If the configuration or the migration data changes, review the new response before confirming again. The migration resource set itself is not available through the Integration API.

If migration is requested but the template still renders the legacy format, the API returns 422 provider_format_migration_unavailable. Check that the cluster runs Deckhouse 1.78.0 or later, or a compatible installed dev build, and that the selected template version supports the new format. If installation was interrupted, complete it before migrating the provider configuration.

When assigning a template to an attached cluster, 422 captured_provider_resources_incomplete means that the template replaces the captured provider configuration but does not include all its resources in managed groups. The errors.missing_resources array lists their identities. Add them to managed template groups and retry the request. 422 captured_provider_resources_unparsable means the resource sets could not be compared; check the YAML and remove duplicate resources from managed groups.

Create a managed cluster

The target cluster’s kubeconfig is passed in values as a template parameter. In the pre-installed “Managed Kubernetes” template it is kubeconfig. TEMPLATE_VERSION_ID here is the current version of that template (how to get it is described in Get the current template version), and REGISTRY_ID is a container registry ID from GET /api/v1/registries:

PAYLOAD="$(jq -nc --arg ver "$TEMPLATE_VERSION_ID" --arg registry "$REGISTRY_ID" \
    --arg kubeconfig "$(cat kubeconfig.yaml)" '{
    "name": "Managed cluster from API",
    "cluster_template_version_id": $ver,
    "registry_id": $registry,
    "values": { "kubeconfig": $kubeconfig }
}')"

curl -X "POST" \
    "https://$COMMANDER_HOST/api/v1/clusters" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD"

To replace the kubeconfig, change values.kubeconfig as described in Update a cluster.

Create a cluster with a registry mode

The registry_mode parameter sets the cluster registry mode. The accepted values are:

Value Interface name Registry configuration
Direct Direct ModuleConfig deckhouse, the registry module in the Direct mode
ModuleUnmanaged Unmanaged ModuleConfig deckhouse, the registry module in the Unmanaged mode
Manual Manual (YAML) the template describes the registry section
Unmanaged InitConfiguration (deprecated) InitConfiguration; available only when the cluster is created, before the installation starts

Use the parameter when the automation cannot determine the DKP version — for example, for a registry with a dev branch built on DKP below 1.75:

curl -X "POST" \
    "https://$COMMANDER_HOST/api/v1/clusters" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"name\": \"legacy\", \"cluster_template_version_id\": \"$TEMPLATE_VERSION_ID\",
         \"registry_id\": \"$REGISTRY_ID\", \"registry_mode\": \"Unmanaged\"}"

The registry_mode field of the response contains the chosen mode (Direct, ModuleUnmanaged, Manual or Unmanaged), and the registry_module_mode field contains the actual mode of the registry module in the cluster from the last check (null until the module reports it and for a cluster without the module, DKP below 1.72). Without the parameter the mode is chosen automatically by the same rules as in the web interface: if the version resolved from the registry is 1.75 or above — Direct, below 1.75 — Unmanaged (InitConfiguration); the automation never chooses ModuleUnmanaged and Manual. The Direct and ModuleUnmanaged modes are rejected with 422 (direct_mode_unsupported) when the resolved version is below 1.75. Changing the mode via PUT /api/v1/clusters/:id follows the same rules as in the web interface; a transition that is not allowed is rejected with 422. When the registry of an installed cluster is changed, a cluster in Unmanaged (InitConfiguration) is switched to Direct, while a cluster in Direct, ModuleUnmanaged or Manual keeps its mode. A switch of an installed cluster to Direct or ModuleUnmanaged, including the switch that comes with a registry change, requires DKP 1.72+ with containerd v2; otherwise the request is rejected with 422 (registry_mode_direct_prerequisites), and such a cluster changes its registry only in the Manual mode. A switch to Unmanaged (InitConfiguration) after the installation has started is not possible. The mode of an attached cluster without a template cannot be changed until a template is connected (registry_mode_attached_without_template).

Poll cluster provisioning status

After creating or updating a cluster, poll GET /api/v1/clusters/:id until the cluster reaches status: "in_sync". Take render_errors into account: a non-empty list means the template did not render and the operation cannot proceed until the input values are fixed via PUT /api/v1/clusters/:id.

CLUSTER_ID="5436e6ef-d811-472f-9c9c-46cb9c6321d9"
DEADLINE=$(( $(date +%s) + 60 * 60 ))  # one-hour timeout

while : ; do
    RESP="$(curl -sS -X "GET" \
        "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID" \
        -H "accept: application/json" \
        -H "X-Auth-Token: $COMMANDER_TOKEN")"

    STATUS="$(jq -r ".status" <<<"$RESP")"
    RENDER_ERRORS="$(jq -r ".render_errors // [] | length" <<<"$RESP")"

    echo "status=$STATUS render_errors=$RENDER_ERRORS"

    if [ "$STATUS" = "in_sync" ]; then
        echo "cluster is ready"
        break
    fi

    if [ "$RENDER_ERRORS" != "0" ]; then
        echo "template render failed, see render_errors:"
        jq ".render_errors" <<<"$RESP"
        exit 1
    fi

    if [ "$(date +%s)" -gt "$DEADLINE" ]; then
        echo "timeout while waiting for in_sync"
        exit 1
    fi

    sleep 10
done

Typical sequence of status values: new → creating → in_sync. A stuck creating together with a non-empty render_errors indicates a template or input-value problem; update the cluster via PUT and the poll will resume.

Pause and resume a cluster

A pause stops checks and changes of the cluster by Deckhouse Commander (see the “Cluster processing pause” section of the user guide):

curl -X "POST" "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID/pause" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN"

The response contains the cluster data with the pause attributes:

{
    "id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
    "paused": true,
    "paused_at": "2026-09-26T10:00:00.000+03:00",
    "paused_by": "terraform"
}

Resuming lifts the pause and starts a check right away:

curl -X "POST" "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID/resume" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN"

Both operations are idempotent: pausing a paused cluster and resuming an active one return 200 and change nothing. While the cluster is paused, PUT /api/v1/clusters/:id saves the configuration without creating tasks. The pause attributes (paused, paused_at, paused_by) are present both in GET /api/v1/clusters/:id and in the lightweight status. A running check or change is interrupted by the pause the same way as by “Stop the change”. The 422 not_available error means the pause is not available (the cluster is not installed, is archived, being deleted or detached).

Fetch a lightweight cluster status

For frequent polling and status dashboards, use GET /api/v1/clusters/:id/status. It returns a compact snapshot — current status, active alerts, an Upmeter summary, and master-node connection info — and omits sensitive fields such as rendered configuration and the agent API key.

curl -s -X "GET" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID/status" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" | jq .
{
  "id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
  "status": "in_sync",
  "active_alerts": [
    { "name": "KubeletDown", "severity_level": 4 }
  ],
  "upmeter": {
    "status": "up",
    "components": [
      { "name": "control-plane", "status": "up" },
      { "name": "synthetic", "status": "up" }
    ]
  },
  "master_node": {
    "host": "203.0.113.10",
    "user": "ubuntu"
  }
}

active_alerts may be empty; upmeter and master_node may be null while the cluster agent is still collecting data.

Delete a cluster and wait for it to be destroyed

DELETE /api/v1/clusters/:id only schedules deletion — the response contains the cluster with status: "delete" and is_locked: true. The cluster is fully removed when a subsequent GET returns 404 not_found.

CLUSTER_ID="5436e6ef-d811-472f-9c9c-46cb9c6321d9"

curl -sS -X "DELETE" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" | jq "{id, status, is_locked}"
{
  "id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
  "status": "delete",
  "is_locked": true
}

Poll until the cluster is gone:

DEADLINE=$(( $(date +%s) + 60 * 60 ))

while : ; do
    HTTP_CODE="$(curl -sS -o /dev/null -w "%{http_code}" -X "GET" \
        "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID" \
        -H "accept: application/json" \
        -H "X-Auth-Token: $COMMANDER_TOKEN")"

    echo "http_code=$HTTP_CODE"

    if [ "$HTTP_CODE" = "404" ]; then
        echo "cluster fully deleted"
        break
    fi

    if [ "$(date +%s)" -gt "$DEADLINE" ]; then
        echo "timeout while waiting for deletion"
        exit 1
    fi

    sleep 10
done

If the cluster is locked by another operation (for example, a converge is in progress), DELETE returns 409 Conflict:

{
  "error": "Cluster is locked",
  "error_code": "conflict",
  "errors": null
}

Retry DELETE after the blocking operation finishes, or inspect pending cluster change requests via GET /api/v1/cluster_change_requests?cluster_id=$CLUSTER_ID and approve or cancel them.

Deckhouse Commander moves a managed cluster to the archive right away, without a deletion task: the DELETE response already contains status: "deleted", and there is nothing to wait for. The cluster itself and the Deckhouse installed in it are not deleted.

Force-delete a cluster

Use DELETE /api/v1/clusters/:id/force when the infrastructure has already been destroyed outside Deckhouse Commander, or the cluster is stuck in a state from which the regular DELETE /api/v1/clusters/:id cannot recover. A force delete removes the cluster record from Deckhouse Commander without running dhctl destroy and does not touch any external resources — clean up the infrastructure yourself.

curl -sS -X "DELETE" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID/force" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" | jq "{id, status, is_locked}"

Prefer the regular DELETE /api/v1/clusters/:id for normal disposal and keep force delete as a manual recovery tool

Permanently delete an archived cluster

Use DELETE /api/v1/clusters/:id/permanent to irreversibly remove a cluster that is already in the archive. The endpoint returns 204 No Content on success. A non-archived cluster returns 409 Conflict with error_code: not_archived.

curl -sS -X "DELETE" \
    "https://$COMMANDER_HOST/api/v1/clusters/$CLUSTER_ID/permanent" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -w "\n%{http_code}\n"

Permanent deletion removes the cluster record from Deckhouse Commander and does not run dhctl destroy. The cluster change history is kept.

Permanently delete an archived cluster template

Use DELETE /api/v1/cluster_templates/:id/permanent to irreversibly remove a cluster template that is already in the archive and is not referenced by any cluster. The endpoint returns 204 No Content on success.

curl -sS -X "DELETE" \
    "https://$COMMANDER_HOST/api/v1/cluster_templates/$CLUSTER_TEMPLATE_ID/permanent" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -w "\n%{http_code}\n"

If the template is not archived, the API returns 409 Conflict with error_code: not_archived. If any cluster still references the template, the API returns 409 Conflict with error_code: used_by_clusters.

Managing projects

The API lets you list projects and create, update, or delete projects of kind commander. Projects of kind deckhouse are DKP projects (Project resources of the multitenancy-manager module) created directly in the target cluster and not managed by Deckhouse Commander; Deckhouse Commander discovers and displays them, but modifying or deleting such projects through the API is forbidden — an attempt returns 403. For details on project kinds, statuses, and name collisions, see the Projects section of the user guide.

All examples use a workspace token (X-Auth-Token: $COMMANDER_TOKEN).

Listing projects

curl -s -X 'GET' \
    "https://$COMMANDER_HOST/api/v1/projects" \
    -H 'accept: application/json' \
    -H "X-Auth-Token: $COMMANDER_TOKEN"

The response contains an array of workspace projects. The example below is trimmed for brevity:

[
  {
    "id": "1a0c4f1b-8f24-4d0a-9a21-0c2d7e1a2b3c",
    "name": "web-frontend",
    "kind": "commander",
    "description": "Team public site",
    "resource_quota": {
      "requests": {
        "cpu": "2",
        "memory": "4Gi",
        "storage": "50Gi"
      }
    },
    "cumulative_status": "deployed",
    "status_data": {},
    "kubernetes_project_id": "b7c1d1d8-9d0e-4cbb-8d9e-2b77b6b9f9c1",
    "cluster_id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
    "cluster_name": "prod-eu-1",
    "administrators": [
      { "kind": "User",  "name": "alice@example.com" },
      { "kind": "Group", "name": "platform-admins" }
    ],
    "error_messages": [],
    "created_at": "2026-04-10T12:00:00Z",
    "synced_at":  "2026-04-23T18:15:32Z"
  }
]

Key response fields:

  • id — project identifier in Deckhouse Commander;
  • name — project name (matches the namespace name in the target cluster);
  • kind — project kind: commander or deckhouse;
  • cluster_id, cluster_name — the target cluster where the project is created;
  • cumulative_status — combined project status (see Project statuses);
  • kubernetes_project_id — the identifier of the Project resource in the target cluster; populated once the agent applies it;
  • resource_quota — the project resource quotas that have been set;
  • administrators — users and groups assigned as project administrators;
  • error_messages — project application error messages, if any.

Creating a project

curl -s -X 'POST' \
    "https://$COMMANDER_HOST/api/v1/projects" \
    -H 'accept: application/json' \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H 'Content-Type: application/json' \
    -d '{
  "name": "web-frontend",
  "cluster_id": "5436e6ef-d811-472f-9c9c-46cb9c6321d9",
  "description": "Team public site",
  "resource_quota": {
    "requests": {
      "cpu": "2",
      "memory": "4Gi",
      "storage": "50Gi"
    }
  },
  "administrators": [
    { "kind": "User",  "name": "alice@example.com" },
    { "kind": "Group", "name": "platform-admins" }
  ]
}'

Request parameters:

  • name (required) — project name. Must follow the Kubernetes namespace naming rules; the names default and deckhouse are reserved; uniqueness is checked within the cluster.
  • cluster_id (required) — target cluster identifier. It cannot be changed after the project is created.
  • administrators (required, at least one entry) — an array of {"kind": "User"|"Group", "name": "..."} objects. Only User and Group are accepted in kind.
  • description — free-form project description.
  • resource_quota — resource quotas; supported keys are requests.cpu, requests.memory, and requests.storage. Limits (limits) are not exposed in the current iteration.

On success, the response is 201 Created with the project object in the same shape as in the list endpoint. Right after creation the cumulative_status is usually initialized; it then transitions to synchronization and, once applied, to deployed.

Validation errors return 422 Unprocessable Entity, for example when the administrators list is empty:

{
  "errors": {
    "administrators": ["A project must have at least one administrator"]
  }
}

Updating a project

curl -s -X 'PUT' \
    "https://$COMMANDER_HOST/api/v1/projects/1a0c4f1b-8f24-4d0a-9a21-0c2d7e1a2b3c" \
    -H 'accept: application/json' \
    -H "X-Auth-Token: $COMMANDER_TOKEN" \
    -H 'Content-Type: application/json' \
    -d '{
  "name": "web-frontend",
  "description": "Team public site (prod)",
  "resource_quota": {
    "requests": {
      "cpu":     "4",
      "memory":  "8Gi",
      "storage": "100Gi"
    }
  },
  "administrators": [
    { "kind": "User",  "name": "alice@example.com" },
    { "kind": "User",  "name": "bob@example.com" },
    { "kind": "Group", "name": "platform-admins" }
  ]
}'

The request body matches the creation payload with one exception: the target cluster of an existing project cannot be changed, so cluster_id is not accepted on update. The response contains the updated project object.

Updating a project of kind deckhouse returns 403 Forbidden.

Deleting a project

Deleting a project through the API is an irreversible operation. All resources created in the project (namespace, workloads, configurations, and secrets) are deleted from the target cluster together with the project. The deletion cannot be cancelled, and neither the project itself nor its resources can be restored afterwards. Before issuing the DELETE request, make sure the project and its data are no longer needed — in integration scenarios require an explicit delete confirmation on the calling system’s side.

curl -s -X 'DELETE' \
    "https://$COMMANDER_HOST/api/v1/projects/1a0c4f1b-8f24-4d0a-9a21-0c2d7e1a2b3c" \
    -H 'accept: application/json' \
    -H "X-Auth-Token: $COMMANDER_TOKEN"

Deckhouse Commander removes its internal labels from the project and asks the agent to delete the Project resource in the target cluster. The response contains the deleted project object with the updated status.

Deleting a project of kind deckhouse through the API is not allowed and returns 403 Forbidden; such projects are deleted directly in Deckhouse using the multitenancy-manager module.

Managing project members (the ProjectRoleBinding resources) and user-defined project templates through the Integration API is not supported in the current release and will be added in future releases.

Billing examples

All examples use a global token (X-Auth-Token: $COMMANDER_GLOBAL_TOKEN) and send no workspace context.

Retrieve cost details for a period

The request returns CPU costs for 1 September 2026, grouped by cluster:

$ curl -s -G "https://$COMMANDER_HOST/api/v1/billing_costs" \
    --data-urlencode "from=2026-08-31T21:00:00Z" \
    --data-urlencode "to=2026-09-01T21:00:00Z" \
    --data-urlencode "resources[]=cpu" \
    --data-urlencode "group_by=cluster_id" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN"

Every item carries the measured quantity, the price from the tariff that applied, and the resulting cost:

{
  "from": "2026-08-31T21:00:00Z",
  "to": "2026-09-01T21:00:00Z",
  "group_by": "cluster_id",
  "entity_type": "pods",
  "total": 120.0,
  "partial_tariff_unpriced_rows": 0,
  "unpriced_compute_classes": 0,
  "unpriced_storage_classes": 0,
  "items": [
    {
      "from": "2026-08-31T21:00:00Z",
      "to": "2026-09-01T21:00:00Z",
      "resource": "cpu",
      "entity_type": "pod",
      "metrics_kind": "usage",
      "class_kind": "compute",
      "unit": "core*hour",
      "class_name": "standard",
      "quantity": 96.0,
      "price": 1.25,
      "cost": 120.0,
      "tariff_plan_id": "dd2d24d9-156e-4c76-8416-1f2dcba9e7ca",
      "tariff": {
        "id": "8f2b1c4e-5a9d-4f13-8c6b-2d7e0a935114",
        "name": "Standard 2026",
        "start_date": "2026-01-01"
      },
      "group": {
        "cluster_id": "3c81a2f7-6b54-4e29-9d10-7a5f8c2b40e6"
      }
    }
  ]
}

Export cost details and page through a list

To export these cost details as CSV, add response_format=csv:

$ curl -s -D - -o billing_costs.csv -G "https://$COMMANDER_HOST/api/v1/billing_costs" \
    --data-urlencode "from=2026-08-31T21:00:00Z" \
    --data-urlencode "to=2026-09-01T21:00:00Z" \
    --data-urlencode "resources[]=cpu" \
    --data-urlencode "response_format=csv" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN"
HTTP/1.1 200 OK
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="billing_costs.csv"
X-Total: 120.0
X-Billing-From: 2026-08-31T21:00:00Z
X-Billing-To: 2026-09-01T21:00:00Z
X-Billing-Group-By: cluster_id
X-Billing-Entity-Type: pods
X-Unpriced-Classes: 0
X-Unpriced-Compute-Classes: 0
X-Unpriced-Storage-Classes: 0

Example of the next transaction history page with one record:

$ curl -s -G "https://$COMMANDER_HOST/api/v1/billing_accounts/$ACCOUNT_ID/transactions" \
    --data-urlencode "per_page=1" \
    --data-urlencode "cursor=6d1f0b83-9c2a-4e57-b840-1f93c7de5a20" \
    -H "accept: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN"
{
  "data": [
    {
      "id": "b47c9e02-3d18-4a6f-95be-0c2a71d84f35",
      "account_id": "5e90d7a1-8c34-4b26-a1df-93f70e6c2b58",
      "kind": "deduction",
      "source": "auto",
      "amount": "-181.44",
      "period_from": "2026-09-01T00:00:00+03:00",
      "period_to": "2026-09-02T00:00:00+03:00",
      "description": "September accrual",
      "idempotency_key": null,
      "created_at": "2026-09-02T09:15:44.318+03:00"
    }
  ],
  "per_page": 1,
  "cursor": "b47c9e02-3d18-4a6f-95be-0c2a71d84f35",
  "total": 37
}

Top up an account and retry safely

Use a unique source operation ID as Idempotency-Key, such as an invoice number:

$ curl -s -X "POST" \
    "https://$COMMANDER_HOST/api/v1/billing_accounts/$ACCOUNT_ID/transactions" \
    -H "accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: invoice-2026-0917" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -d '{"kind": "top_up", "amount": "100.00", "description": "Invoice payment"}'

Response with status 201:

{
  "id": "1a6f2d70-4c85-4b19-9e33-8d02fb71c9a4",
  "account_id": "5e90d7a1-8c34-4b26-a1df-93f70e6c2b58",
  "kind": "top_up",
  "source": "integration",
  "amount": "100.0",
  "period_from": null,
  "period_to": null,
  "description": "Invoice payment",
  "idempotency_key": "invoice-2026-0917",
  "created_at": "2026-09-17T12:04:03.921+03:00"
}

Changing amount to 250.00 while keeping the same key returns 409 idempotency_conflict.

Create the first tariff plan

On an empty installation, create a plan before creating or importing tariffs. The first plan automatically becomes the default; the import examples below use that default.

$ curl -s -X "POST" \
    "https://$COMMANDER_HOST/api/v1/billing_tariff_plans" \
    -H "accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -d '{"name": "Standard"}'

Import tariffs

For permissions and error handling, see Tariff changes and import. Example of creating a tariff from JSON:

$ curl -s -X "POST" \
    "https://$COMMANDER_HOST/api/v1/billing_tariffs/import" \
    -H "accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    -d '{
          "tariffs": [
            {
              "name": "Standard 2027",
              "start_date": "2027-01-01",
              "aggregation": "average",
              "metrics_kind": "usage",
              "tariff_bindings": [
                {"label_kind": "compute", "label_name": "standard", "cpu_price": "1.25", "ram_price": "2.50"}
              ]
            }
          ]
        }'

Abbreviated example of a successful response (200):

[
  {
    "index": 0,
    "name": "Standard 2027",
    "status": "created",
    "tariff": {
      "id": "c0a4e18b-77d3-4f52-b6ac-9e1d3820f4a7",
      "name": "Standard 2027",
      "start_date": "2027-01-01"
    }
  }
]

In CSV, rows that share a tariff_key are combined into one tariff with several bindings. Save the following example as tariffs.csv:

tariff_key,name,start_date,aggregation,metrics_kind,label_kind,label_name,cpu_price,ram_price,storage_price
standard-2027,Standard 2027,2027-01-01,average,usage,compute,standard,1.25,2.50,
standard-2027,Standard 2027,2027-01-01,average,usage,storage_class,fast-ssd,,,0.40
$ curl -s -X "POST" \
    "https://$COMMANDER_HOST/api/v1/billing_tariffs/import" \
    -H "accept: application/json" \
    -H "Content-Type: text/csv" \
    -H "X-Auth-Token: $COMMANDER_GLOBAL_TOKEN" \
    --data-binary @tariffs.csv