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

# Attach a preset

> Attach a saved preset to one of a user's stored cards. Only the purchases paid with that card are judged.

A preset applies only where it is attached. Attach it to a stored card and every purchase paid with that card is judged. A cap counts the purchases paid with that card. Attaching twice is one attachment. Takes a platform access token or an API key. See [Set rules on a card](/vault/set-rules-on-a-card).

A preset attached to a card is judged when your agent opens the purchase if the card is already known, because the agent pinned it with `card_id` or the user has exactly one stored card; otherwise it is judged right before the card is sent, once the user has unlocked it.

<ParamField path="name" type="string" required>The preset's name.</ParamField>
<ParamField body="kind" type="string" required>`card`.</ParamField>
<ParamField body="target_id" type="string" required>A stored card id from [List a user's vaulted cards](/api-reference/vault/cards-list) or the `vault.card_stored` event.</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://api.agentcard.sh/api/v2/vault/presets/office-supplies/attachments \
    -H "Authorization: Bearer $ORG_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"kind": "card", "target_id": "CARD_ID"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "vault_preset",
    "name": "office-supplies",
    "id": "cmtvwbc0g000bjpcc88yiyx8z",
    "version": 1,
    "summary": "Up to $50.00 per day. Merchants: EXAMPLE SHOP, ACME. Currency: USD.",
    "attachments": [
      { "kind": "card", "target_id": "CARD_ID", "last4": "7318" }
    ]
  }
  ```
</ResponseExample>

**Errors.** `404 preset_not_found` when no preset of that name is saved. `404 card_not_found` when the card id is not a card stored by one of your users. `400 invalid_request` for a `kind` other than `card`, or a missing `target_id`.
