EndpointsUpdate an OpenCode Server

OpenCode Servers

Update an OpenCode Server

Changes the name, labels and guardrails of a server that is not deleted. Requires If-Match with the server's etag.

PATCH/opencodes/{id}
Authorizationstringheaderrequired

Bearer token for the authenticated caller.

Optional workspace/scope context for the request. Carries a single workspace wire id (ws_…) today. Only needed for broad tokens - a workspace-owned token implies its workspace.

Required string length: 1 - 53

Example: "ws_j572abc123def4"

if-matchstringrequired

The etag of the resource version the client last read. Required on writes when the resource exposes an etag field. Mismatch returns 409 ABORTED with the current etag in the error metadata.

Required string length: 1 - 256

Example: "42"

idstringrequired

OpenCode Server id (oc_...).

Pattern: ^oc_[a-z0-9]{1,64}$

Example: "oc_j572abc123def456"

Body

application/json

Fields left out stay as they are. labels replaces the whole map; features changes only the toggles named.

namestring

Display name.

Required string length: 1 - 100

hostnamestring

DNS label chosen for the server's browser UI; unique across the platform. Created from the name plus a short random suffix when not given. The UI is served at web_url until chosen hostnames are routed.

Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$

Example: "acme-agents"

labelsrecord<string, string>

Free-form string labels: up to 32 keys of up to 63 characters.

Maximum object length: 32 entries

budgetobject
child attributes
budget.monthly_limitinteger | nullrequired

Monthly limit in metered usage units. The unit and its pricing are not defined yet; the value is stored and returned, not enforced. null: no limit.

Required range: x >= 0

featuresobject
child attributes

OpenCode worktree creation in the web UI.

OpenCode terminals in the web UI.

Response

application/json

OpenCode Server updated

idstringrequired

OpenCode Server id (oc_...).

Pattern: ^oc_[a-z0-9]{1,64}$

Example: "oc_j572abc123def456"

workspace_idstringrequired

Required string length: 1 - 53

namestringrequired

Display name.

Required string length: 1 - 100

hostnamestringrequired

DNS label chosen for the server's browser UI; unique across the platform. Created from the name plus a short random suffix when not given. The UI is served at web_url until chosen hostnames are routed.

Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$

Example: "acme-agents"

labelsrecord<string, string>required

Free-form string labels: up to 32 keys of up to 63 characters.

Maximum object length: 32 entries

stateenum<string>required

ACTIVE: serves OpenCode protocol traffic. SUSPENDED: the gateway refuses protocol traffic until it is resumed. DELETED: terminal; the id stays reserved. SUSPENDING, RESUMING and DELETING: a requested change is in progress; its Operation finishes when the server reached the new state. A deletion always finishes.

Available options: ACTIVE, SUSPENDING, SUSPENDED, RESUMING, DELETING, DELETED

defaultbooleanrequired

True for the Workspace's default server, which exists as soon as the Workspace uses OpenCode and cannot be deleted.

budgetobjectrequired
child attributes
budget.monthly_limitinteger | nullrequired

Monthly limit in metered usage units. The unit and its pricing are not defined yet; the value is stored and returned, not enforced. null: no limit.

Required range: x >= 0

featuresobjectrequired

Web UI feature toggles. Everything else in OpenCode's UI stays on.

child attributes
features.worktreesbooleanrequired

OpenCode worktree creation in the web UI.

features.terminalbooleanrequired

OpenCode terminals in the web UI.

vault_idstringrequired

The Vault of the server's third-party credentials: the one named at creation, or the Vault created for this server.

web_urlstring | nullrequired

Where people open the server's web UI: https://oc-<key>.akua.run/, a browser origin of its own, derived from the server id. null when this deployment hosts no OpenCode Servers.

server_urlstring | nullrequired

The long form of the server's address, https://<api host>/v1/opencodes/{id}/: OpenCode's protocol under api/, its web UI at the base. null when this deployment hosts no OpenCode Servers.

short_urlstring | nullrequired

The short form, https://<site host>/{id}/: protocol requests only, always with an explicit token. null when this deployment has none.

created_atintegerrequired

Unix timestamp (seconds)

Required range: x >= 0

updated_atintegerrequired

Unix timestamp (seconds)

Required range: x >= 0

etagstringrequired

Send as If-Match on PATCH.