> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save a preset

> Save a named preset, or replace its rules. Saving filters nothing until the preset is attached.

The rules are replaced, not merged: send every rule the preset should hold. A replacement keeps every attachment, and purchases already counted toward a cap stay counted, so replacing the rules never resets a rolling window. Saving a preset attaches it to nothing; attach it to a stored card. Takes a platform access token or an API key.

Write the rules one of three ways: as the fields below, as `preset` with a built-in name (`daily`, `cli_only`, `weekday_meals`, or `ai_labs`), or as `privileges`, an array of rules in the same shape a card preset takes.

**name** `string` *required*

1 to 64 letters, digits, hyphens or underscores, starting with a letter or digit.

**total** `number`

Cap on the purchases under each attachment, over all time, in US dollars.

**per\_day** `number`

Rolling 24-hour cap, in US dollars, for the purchases under each attachment.

**per\_week** `number`

Rolling 7-day cap, in US dollars.

**per\_month** `number`

Rolling 30-day cap, in US dollars.

**categories** `string`

Categories the merchant must be in, comma-separated: `meals`, `groceries`, `travel`, `software`, `ai`, `wellness`, `retail`. Judged on the merchant Agentcard names from `checkout_origin` and the payment request, never on the `merchant` text.

**only\_merchants** `string`

Comma-separated patterns the merchant's name or checkout host must match, such as `EXAMPLE SHOP,shop.example.com`. The `merchant` text your agent sends is not matched.

**only\_in** `string`

Places the merchant must be in, comma-separated: a country (`US`, `Canada`), a US state (`California`, `US-CA`), or a region (`europe`, `north-america`, `apac`).

**currencies** `string`

The currencies a purchase may be in, comma-separated, by code or common name: `usd,eur` or `dollars,euros`.

**only\_days** `string`

`mon,tue`, or `weekdays` / `weekends`.

**only\_hours** `string`

For example `9-17`, 24-hour clock, in `timezone`.

**timezone** `string`

IANA zone for `only_days` and `only_hours`. Default `UTC`.

**only\_from** `string`

Where purchases may come from. Vault purchases come from your agent and count as `api`.

**mode** `string`

What the preset does when a purchase breaks any of its rules: `strict` refuses it (the default), `watch` lets it through and tells you.

**preset** `string`

A built-in name instead of the fields above.

**privileges** `object[]`

The rules as an array, for a rule the fields do not cover, such as `{"kind": "merchant_allow", "patterns": ["BRAXTER'S DELI"]}`.

```bash cURL theme={null}
curl -X PUT https://api.agentcard.sh/api/v2/vault/presets/office-supplies \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"per_day": 50, "only_merchants": "EXAMPLE SHOP,ACME", "currencies": "usd"}'
```

```json 200 theme={null}
{
  "object": "vault_preset",
  "name": "office-supplies",
  "id": "pol_5a6b7c8d9e0f1a2b3c4d5e6f",
  "version": 1,
  "summary": "Up to $50.00 per day. Merchants: EXAMPLE SHOP, ACME. Currency: USD.",
  "attachments": []
}
```

A merchant Agentcard does not know has no category and no country, so a category or place rule on a `strict` preset refuses a purchase there with `category_unknown` or `geo_unknown`.

**Errors.** `400 policy_invalid` when the name or the rules cannot be read; the message names the field or the rule. `502 policy_update_failed` when the rules could not be saved; nothing changed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.