SpendNod Rules API
The rules API from SpendNod — 6 operation(s) for rules.
The rules API from SpendNod — 6 operation(s) for rules.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/spendnod-com:spendnod-com-rules-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: SpendNod Rules API
description: Human authorization gateway for AI agent transactions. Agents submit requests; humans approve or deny via the dashboard.
version: 0.1.0
tags:
- name: Rules
paths:
/v1/rules/templates:
get:
tags:
- Rules
summary: List rule templates
description: 'Returns preset rule configurations: Conservative, Moderate, Permissive, Online Shopping, Procurement, and Ad Spending.'
operationId: list_rule_templates_v1_rules_templates_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/RuleTemplate'
type: array
title: Response List Rule Templates V1 Rules Templates Get
/v1/agents/{agent_id}/rules:
get:
tags:
- Rules
summary: List rules for an agent
operationId: list_rules_v1_agents__agent_id__rules_get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid
title: Agent Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RuleResponse'
title: Response List Rules V1 Agents Agent Id Rules Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- Rules
summary: Add a rule to an agent
operationId: create_rule_v1_agents__agent_id__rules_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid
title: Agent Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RuleCreate'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RuleResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/rules/{rule_id}:
patch:
tags:
- Rules
summary: Update a rule
operationId: update_rule_v1_rules__rule_id__patch
parameters:
- name: rule_id
in: path
required: true
schema:
type: string
format: uuid
title: Rule Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RuleUpdate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RuleResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Rules
summary: Delete a rule
operationId: delete_rule_v1_rules__rule_id__delete
parameters:
- name: rule_id
in: path
required: true
schema:
type: string
format: uuid
title: Rule Id
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/agents/{agent_id}/rules/template:
post:
tags:
- Rules
summary: Apply a rule template to an agent
description: Backs up the agent's current rules, then replaces them with the named template.
operationId: apply_template_v1_agents__agent_id__rules_template_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid
title: Agent Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ApplyTemplateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RuleResponse'
title: Response Apply Template V1 Agents Agent Id Rules Template Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/agents/{agent_id}/rules/backup:
get:
tags:
- Rules
summary: Get the most recent rule backup for an agent
operationId: get_rule_backup_v1_agents__agent_id__rules_backup_get
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid
title: Agent Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/RuleBackupResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/agents/{agent_id}/rules/restore:
post:
tags:
- Rules
summary: Restore rules from the most recent backup
description: Deletes current rules and recreates them from the most recent backup.
operationId: restore_rules_v1_agents__agent_id__rules_restore_post
parameters:
- name: agent_id
in: path
required: true
schema:
type: string
format: uuid
title: Agent Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RuleResponse'
title: Response Restore Rules V1 Agents Agent Id Rules Restore Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
RuleTemplate:
properties:
name:
type: string
title: Name
description:
type: string
title: Description
rules:
items:
$ref: '#/components/schemas/RuleTemplateRule'
type: array
title: Rules
risk_level:
type: string
title: Risk Level
type: object
required:
- name
- description
- rules
- risk_level
title: RuleTemplate
RuleType:
type: string
enum:
- max_per_transaction
- max_per_day
- max_per_month
- allowed_vendors
- blocked_vendors
- allowed_categories
- blocked_categories
- require_approval_above
- auto_approve_below
title: RuleType
RuleBackupResponse:
properties:
id:
type: string
format: uuid
title: Id
agent_id:
type: string
format: uuid
title: Agent Id
user_id:
type: string
format: uuid
title: User Id
rules_json:
items:
additionalProperties: true
type: object
type: array
title: Rules Json
template_applied:
anyOf:
- type: string
- type: 'null'
title: Template Applied
created_at:
type: string
format: date-time
title: Created At
type: object
required:
- id
- agent_id
- user_id
- rules_json
- template_applied
- created_at
title: RuleBackupResponse
RuleResponse:
properties:
id:
type: string
format: uuid
title: Id
agent_id:
type: string
format: uuid
title: Agent Id
rule_type:
$ref: '#/components/schemas/RuleType'
value:
additionalProperties: true
type: object
title: Value
is_active:
type: boolean
title: Is Active
created_at:
type: string
format: date-time
title: Created At
type: object
required:
- id
- agent_id
- rule_type
- value
- is_active
- created_at
title: RuleResponse
RuleUpdate:
properties:
value:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Value
is_active:
anyOf:
- type: boolean
- type: 'null'
title: Is Active
type: object
title: RuleUpdate
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
RuleTemplateRule:
properties:
rule_type:
$ref: '#/components/schemas/RuleType'
value:
additionalProperties: true
type: object
title: Value
type: object
required:
- rule_type
- value
title: RuleTemplateRule
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
RuleCreate:
properties:
rule_type:
$ref: '#/components/schemas/RuleType'
value:
additionalProperties: true
type: object
title: Value
description: 'Rule value payload. Examples: {"amount": 50.0} for amount rules, {"vendors": ["AWS", "GCP"]} for vendor rules.'
type: object
required:
- rule_type
- value
title: RuleCreate
ApplyTemplateRequest:
properties:
template_name:
type: string
title: Template Name
type: object
required:
- template_name
title: ApplyTemplateRequest