SDK reference · Python SDK

prov.identify.add_signing_key

prov.identify.add_signing_key in Python SDK. Publish an Ed25519 PUBLIC key for one of your agents (free).

Signature

prov.identify.add_signing_key(agent_id: str, jwk: dict, expires_at: Optional[str] = …) -> Any

Parameters

agent_idstrRequired
jwkdictRequired
expires_atOptional[str]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The agent's ID.
jwkobjectRequired
The public key: kty OKP, crv Ed25519 and x. A kid, when sent, must be the key's JWK thumbprint.
Show child attributes
ktyenum
The key type. One of OKP.
crvenum
The curve. One of Ed25519.
xstring
The 32-byte public key, base64url.
kidstring
Optional; the key's JWK thumbprint.
expires_attimestamp
When the key stops being published.

Returns

Any The signing key, with the agent's directory and card URLs.

HTTP operation

POST /v1/identify/agents/{id}/signing_keys: Add a signing key

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "name": "pantry-pal", "category": "shopping_agent" }),
})).json();
const agentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/identify/agents/${agentId}/signing_keys`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "jwk": {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "G_STrQBvTD7Bi8OjlNnLcKPPiPp03Vh0sJKTMG7QzFY"
    }
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.