SDK reference · Node SDK

prov.mandate.grants.addTrustedAgent

prov.mandate.grants.addTrustedAgent in Node SDK. Add a trusted outside agent (an admin key).

Signature

prov.mandate.grants.addTrustedAgent(params: AddTrustedAgentParams): Promise<TrustedAgent>

Parameters

paramsAddTrustedAgentParamsRequired

Request fields

receiverobjectRequired
provenance_agent with agent_id, or key with name, origin and holder_key.
Show child attributes
kindenumRequired
How the agent is named. One of provenance_agent, key.
agent_idstring
An agent registered in another account.
namestring
The agent's name (up to 100 characters).
originstring
The agent's https origin, such as https://seats.skydesk.example.
holder_keyobject
The agent's P-256 public key (JWK).
max_amountnumber
The highest per-order cap that skips the ask.
budget_amountnumber
The highest budget that skips the ask.

Returns

Promise<TrustedAgent> The trusted agent.

HTTP operation

POST /v1/mandate/trusted_agents: Add a trusted outside agent

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/trusted_agents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "receiver": {
      "kind": "key",
      "name": "SkyDesk Seats",
      "origin": "https://seats.skydesk.example",
      "holder_key": {
        "kty": "EC",
        "crv": "P-256",
        "x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
        "y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
      }
    },
    "max_amount": 600
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.