---
title: "Apply a rule template to an agent"
method: POST
path: "/v1/agents/{agent_id}/rules/template"
tags: ["rules"]
---

# Apply a rule template to an agent

`POST /v1/agents/{agent_id}/rules/template`

## Request

- Base URL: `https://api.spendnod.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.spendnod.com/v1/agents/{agent_id}/rules/template`
- Auth: none declared

Backs up the agent's current rules, then replaces them with the named template.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- ApplyTemplateRequest
  - `template_name` string, required

## Response `200`

Successful Response

- RuleResponse[]
  - `id` string, uuid, required
  - `agent_id` string, uuid, required
  - `rule_type` 'max_per_transaction' | 'max_per_day' | 'max_per_month' | 'allowed_vendors' | 'blocked_vendors' | 'allowed_categories' | 'blocked_categories' | 'require_approval_above' | 'auto_approve_below', required
  - `value` object, required
  - `is_active` boolean, required
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/spendnod/apis/spendnod-api.md) · [All operations](https://skmtc.dev/spendnod/apis/spendnod-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spendnod/apis/spendnod-api/revisions/170dc867d036?raw)
