Get agents
Attests which principal one of the caller's agents answers to: the org, the chain of agents that spawned it, and the same signed with the platform's key as a JWS (EdDSA) a verifier checks offline against GET /v1/principal/keys.
GET /v1/principal/agents/{ref}
| Address | https://api.hanzo.ai/v1/principal/agents/{ref} |
| Method | GET |
| Operation | get_principal_agents_by_ref |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Attests which principal one of the caller's agents answers to: the org, the chain of agents that spawned it, and the same signed with the platform's key as a JWS (EdDSA) a verifier checks offline against GET /v1/principal/keys. Any member of the agent's org.
An agent of another org is not found. A spawned agent answers to its parent's org, which is its own: a parent is resolved only in the org the agent is created in. The statement is valid for 24 hours.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
ref | path | string | yes | Ref is the agent's id or its name in the caller's org. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | principal.Attestation | ok |
default | problem-details | refused |
200 body — 14 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
agent | body | principal.AgentBrief | — | |
agent.id | body | string | — | ID is the agent id — the ref a run names and the value a member id derives from, so it must be stable across a reconcile. |
agent.name | body | string | — | Name is the display name a person reads in a member list. |
agent.parent | body | string | — | Parent is the agent that spawned this one; empty for an agent a person defined. |
agent.status | body | string | — | Status is the registry status VERBATIM, never a boolean. |
expires | body | integer (int64) | — | Expires is when the statement stops being valid, unix seconds. |
kid | body | string | — | Kid is the key that signed it. |
org | body | string | — | Org is the principal it answers to — the org it was defined in. |
parents | body | principal.AgentBrief[] | — | Parents are the agents that spawned it, nearest first. |
parents[].id | body | string | — | ID is the agent id — the ref a run names and the value a member id derives from, so it must be stable across a reconcile. |
parents[].name | body | string | — | Name is the display name a person reads in a member list. |
parents[].parent | body | string | — | Parent is the agent that spawned this one; empty for an agent a person defined. |
parents[].status | body | string | — | Status is the registry status VERBATIM, never a boolean. |
statement | body | string | — | Statement is the same, signed: a JWS a verifier checks offline against GET /v1/principal/keys. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, PrincipalApi } from 'hanzoai';
const api = new PrincipalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPrincipalAgentsByRef({ ref: 'ref' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import PrincipalApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = PrincipalApi(client).get_principal_agents_by_ref(ref='ref')cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.PrincipalAPI.GetPrincipalAgentsByRef(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, principal_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = principal_api::get_principal_agents_by_ref(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.PrincipalApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new PrincipalApi(client).getPrincipalAgentsByRef();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 https://api.hanzo.ai/v1/principal/agents/<ref> \
-H "Authorization: Bearer $HANZO_API_KEY"MCP declares no tool for principal — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
How is this guide?