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}

Addresshttps://api.hanzo.ai/v1/principal/agents/{ref}
MethodGET
Operationget_principal_agents_by_ref
AuthAuthorization: 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.

FieldInTypeRequiredDescription
refpathstringyesRef is the agent's id or its name in the caller's org.

Response

StatusBodyMeaning
200principal.Attestationok
defaultproblem-detailsrefused

200 body — 14 fields.

FieldInTypeAlwaysDescription
agentbodyprincipal.AgentBrief—
agent.idbodystring—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.namebodystring—Name is the display name a person reads in a member list.
agent.parentbodystring—Parent is the agent that spawned this one; empty for an agent a person defined.
agent.statusbodystring—Status is the registry status VERBATIM, never a boolean.
expiresbodyinteger (int64)—Expires is when the statement stops being valid, unix seconds.
kidbodystring—Kid is the key that signed it.
orgbodystring—Org is the principal it answers to — the org it was defined in.
parentsbodyprincipal.AgentBrief[]—Parents are the agents that spawned it, nearest first.
parents[].idbodystring—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[].namebodystring—Name is the display name a person reads in a member list.
parents[].parentbodystring—Parent is the agent that spawned this one; empty for an agent a person defined.
parents[].statusbodystring—Status is the registry status VERBATIM, never a boolean.
statementbodystring—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();
curl https://api.hanzo.ai/v1/principal/agents/<ref> \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches principal through the principal tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP 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_principals"
         }
       }
     }'

Principal API · All Hanzo APIs · Interactive reference

Was this page useful?