---
title: "Restore rules from the most recent backup"
method: POST
path: "/v1/agents/{agent_id}/rules/restore"
tags: ["rules"]
---

# Restore rules from the most recent backup

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

## 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/restore`
- Auth: none declared

Deletes current rules and recreates them from the most recent backup.

## Path parameters

- `agent_id` string, uuid, 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)
