Logs out one account and stops the sessions it was running.
Logs out one account and stops the sessions it was running.
DELETE /v1/link/{id}
| Address | https://api.hanzo.ai/v1/link/{id} |
| Method | DELETE |
| Operation | delete_link_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Logs out one account and stops the sessions it was running.
It revokes a single linked account and stops the agent sessions that ran under it, answering with the revoked row and how many sessions stopped. The link is RETAINED with a revoked status rather than deleted, so its usage history and the audit trail survive the log-out — which also means a revoked account still appears in the list, and is excluded from the route plan rather than absent from it. The session stop is narrowed to the revoking user's own sessions on that device, provider and account, and a stop that fails does not fail the revoke: the revoked row is the durable truth. An id that does not exist, or belongs to another user or org, is the same 404.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the link to act on, from the path. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | revokeResp | ok |
200 body — 18 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
links | body | linkView[] | — | Links is each revoked row with its new status — retained, not deleted, so usage history and the audit trail survive the log-out. |
links[].account | body | string | — | Account is the provider-side account identifier, when the collector knows it. |
links[].billing | body | string | — | Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path). |
links[].createdAt | body | string | — | CreatedAt is when the link was first registered, RFC 3339 UTC. |
links[].host | body | string | — | Host is the machine's human hostname label, from its most recent report. |
links[].id | body | string | — | ID is the link's opaque handle ("link_" + 32 hex chars). |
links[].kind | body | string | — | Kind is how the account authenticates: subscription or apikey. |
links[].lastSeen | body | string | — | LastSeen is when the account last reported, RFC 3339 UTC. |
links[].machine | body | string | — | Machine is the stable machine identifier the collector reports. |
links[].os | body | string | — | OS is the machine's operating system label. |
links[].plan | body | string | — | Plan is the provider plan label (e.g. |
links[].provider | body | string | — | Provider is the AI provider this account belongs to (claude, openai, hanzo…). |
links[].status | body | string | — | Status is linked or revoked. |
links[].updatedAt | body | string | — | UpdatedAt is when the link was last refreshed, RFC 3339 UTC. |
links[].usage | body | any | — | Usage is the last good usage snapshot, clamped and re-serialized to known fields at ingest. |
links[].user | body | string | — | User is the owning subject — the validated caller who registered the link. |
revoked | body | integer | — | Revoked is how many links this call revoked. |
sessionsStopped | body | integer | — | SessionsStopped is how many of the caller's own agent sessions stopped. |
Failure carries the platform error shape — see Errors.
Examples
hanzo links rm <id>import { Configuration, LinkApi } from 'hanzoai';
const api = new LinkApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteLinkById({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LinkApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LinkApi(client).delete_link_by_id(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.LinkAPI.DeleteLinkById(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, link_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = link_api::delete_link_by_id(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LinkApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new LinkApi(client).deleteLinkById();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X DELETE https://api.hanzo.ai/v1/link/<id> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches link through the link tool, which names its 11 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_links"
}
}
}'How is this guide?