Skip to content

Disconnect a cloud account

Removes your organization's stored account for one bring-your-own offering. The stored details are deleted, not kept disabled. Refused while servers created with this account may still hold something in it — delete them first. When the provider has refused the stored account (its status is credential_invalid), servers already on their way out (being deleted, revoked or failed) cannot be cleaned up through it. When every server still using it is on its way out, a disconnect without forget_hosts is refused with details.reason forget_available; while any of them is still live, the refusal carries no reason and that server must be deleted first. Connecting working details for that same account and deleting those servers again removes what they left. Where that is not possible (the account was closed or its project deleted), forget_hosts=true disconnects anyway and Forge forgets them. Their entries stay in List servers until they are deleted; that delete finishes without asking the provider. What they left in the account stays there, and shows up as orphans in List servers once a working account for it is connected again, and can be deleted there. Disconnecting an offering that has no stored account succeeds with nothing to do. Requires a bearer token (or API key) whose principal holds the manage_forge capability in the acting organization; it works while Forge cloud compute is switched off, so switching the feature off never strands a stored secret.

DELETEhttps://api.aitronos.com/v1/forge/compute/credentials/{offering_id}

Path Parameters

offering_id string required

The bring-your-own offering to disconnect, e.g. hetzner. A stored account is removed even when its offering has since left the catalog.

Query Parameters

forget_hosts boolean optional · Defaults to false

Disconnect even though servers still use this account, forgetting them. Only allowed when the provider has refused the stored account and every one of those servers is being deleted, revoked or failed (delete the others first: that works whatever the account answers); otherwise refused with FORGE_COMPUTE_HOSTS_EXIST and details.reason. A disconnect without it that this would get past is refused with details.reason forget_available; prefer connecting working details for that same account and deleting the servers again, which removes what they left. Whatever forgotten servers may have left in the account stays there and may still be charged: check the account at the provider. Once a working account for it is connected again, those leftovers are listed as orphans and can be deleted.

organization_id string optional

The organization to act in. Defaults to your current organization. You must be an active member of it, or the request is refused with 403 ORGANIZATION_ACCESS_DENIED.

Headers

X-Organization-Id string optional

The same as organization_id, as a header. When both are sent, the query parameter wins.


Returns

No body — 204 No Content on success, whether an account was removed or none was stored.

Errors

StatusCodeWhen
401AUTHENTICATION_REQUIREDNo valid credential.
403ORGANIZATION_ACCESS_DENIEDorganization_id or X-Organization-Id names an organization you are not an active member of.
403INSUFFICIENT_PERMISSIONSThe caller does not hold manage_forge in the acting organization.
404FORGE_COMPUTE_OFFERING_NOT_FOUNDThe id is neither an offering nor a stored account.
409FORGE_COMPUTE_HOSTS_EXISTServers created with this account may still hold a resource. details.live_hosts is the count. Without forget_hosts, details.reason is forget_available when the same request with forget_hosts=true would be accepted (deleting those servers again changes nothing while the provider refuses the stored account: connect working details for that same account first, then delete them, or forget them), and absent otherwise. With forget_hosts=true, details.reason says why the servers cannot be forgotten: account_works (the provider still accepts the stored account, so delete the servers instead) or hosts_hold_resources (a server is not being deleted, revoked or failed: delete it first, then disconnect again).
cURL
curl -X DELETE "https://api.aitronos.com/v1/forge/compute/credentials/hetzner" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Response:

(empty body)