set_spend_policy
Save a spend policy whole: agent_id for one agent, or leave it out for the workspace default every other agent spends under. An omitted field takes its default, so read get_spend_policy first and send every rule you want to keep. An agent's own key cannot change the rules that bind it: use a workspace-wide key. Needs a Last Price credential with routing write scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preset | No | procurement switches on company buying rules in one step, filling ask_above 500, quotes_required_above 5000 and, with preferred_sellers, block_unknown_sellers for whichever you leave out. Only where get_spend_policy says procurement.available. | |
| agent_id | No | The agent this policy governs. Null or omitted for the workspace default. | |
| currency | No | Currency of every amount here. Purchases in another are denied, or converted at a recorded rate where get_spend_policy lists rail units. Defaults to USD. | |
| ask_above | No | Purchases above this wait for a person's approval. Null (the default) for never. | |
| daily_cap | No | Most all purchases may cost in one UTC day. Null (the default) for no cap. | |
| fair_price | No | When verify_price judges a price too high: off (ignore, the default), ask a person, or deny. | |
| hold_seconds | No | How long an allowed purchase's reservation stays open for the purchase to start. Defaults to 900. | |
| allowed_sellers | No | Only these sellers. Null (the default) for any. | |
| blocked_sellers | No | Never these sellers. Defaults to none. | |
| max_per_purchase | No | Most one purchase may cost. Null (the default) for no limit. | |
| preferred_sellers | No | Vendors procurement approved. Another seller waits for a person, or is denied with block_unknown_sellers. | |
| allowed_categories | No | Only these categories. Null (the default) for any. | |
| expired_quote_action | No | When a check's seller quote has expired: deny it (the default) or ask a person. ask only where get_spend_policy lists quote expiry. | |
| block_unknown_sellers | No | Deny any seller not on preferred_sellers. Defaults to false. | |
| quotes_required_above | No | Purchases above this need quotes from at least two sellers. | |
| allowed_agent_subjects | No | Only these AgentIDs (the subject in their token) may spend. Null for any verified or unverified agent the other rules allow. | |
| require_verified_agent | No | Only agents that prove who they are with an AgentID token on check_purchase may spend. Only where get_spend_policy says verified agents are available. | |
| category_monthly_budgets | No | Most spent per category in one UTC month, e.g. {"software": 2000}. Checks must then name a category. |