Hanzo
OpenapiLink

Logs out every account on one machine and stops its sessions.

Logs out every account on one machine and stops its sessions.

POST /v1/link/devices/{machine}/revoke

Addresshttps://api.hanzo.ai/v1/link/devices/{machine}/revoke
MethodPOST
Operationpost_link_devices_by_machine_revoke
AuthAuthorization: Bearer $HANZO_API_KEY

Logs out every account on one machine and stops its sessions.

It revokes every one of the caller's accounts on one machine and stops the agent sessions they were running, answering with how many of each. This is the "I lost that laptop" button. Revoked links are RETAINED, not deleted, so usage history and the audit trail survive a log-out — the rows come back in the response with their new status. The session stop reaches only the REVOKING user's own sessions, so a shared machine name can never be used to stop a co-tenant's work, and a stop that fails does not fail the revoke: the revoked row is the durable truth and the count then honestly reports fewer. A machine with nothing left to revoke is 404.

Request

1 field.

FieldInTypeRequiredDescription
machinepathstringyesMachine is the machine to act on, from the path.

Response

StatusBodyMeaning
200revokeRespok

200 body — 18 fields.

FieldInTypeAlwaysDescription
linksbodylinkView[]Links is each revoked row with its new status — retained, not deleted, so usage history and the audit trail survive the log-out.
links[].accountbodystringAccount is the provider-side account identifier, when the collector knows it.
links[].billingbodystringBilling is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path).
links[].createdAtbodystringCreatedAt is when the link was first registered, RFC 3339 UTC.
links[].hostbodystringHost is the machine's human hostname label, from its most recent report.
links[].idbodystringID is the link's opaque handle ("link_" + 32 hex chars).
links[].kindbodystringKind is how the account authenticates: subscription or apikey.
links[].lastSeenbodystringLastSeen is when the account last reported, RFC 3339 UTC.
links[].machinebodystringMachine is the stable machine identifier the collector reports.
links[].osbodystringOS is the machine's operating system label.
links[].planbodystringPlan is the provider plan label (e.g.
links[].providerbodystringProvider is the AI provider this account belongs to (claude, openai, hanzo…).
links[].statusbodystringStatus is linked or revoked.
links[].updatedAtbodystringUpdatedAt is when the link was last refreshed, RFC 3339 UTC.
links[].usagebodyanyUsage is the last good usage snapshot, clamped and re-serialized to known fields at ingest.
links[].userbodystringUser is the owning subject — the validated caller who registered the link.
revokedbodyintegerRevoked is how many links this call revoked.
sessionsStoppedbodyintegerSessionsStopped is how many of the caller's own agent sessions stopped.

Failure carries the platform error shape — see Errors.

Examples

hanzo links devices revoke <machine>

Link API · All Hanzo APIs · Interactive reference

How is this guide?

On this page