Documentation Index
Fetch the complete documentation index at: https://spendguard.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
GET /v1/policies/{policy_id}
Authentication: Required (X-API-Key header)
Path Parameters
| Parameter | Type | Description |
|---|
policy_id | string | The policy ID to retrieve |
Query Parameters
| Parameter | Type | Default | Description |
|---|
version | integer | Latest | Specific version number to retrieve (must be >= 1) |
Example Request
Get the latest version
curl https://spendguardapi.com/v1/policies/my_refund_policy \
-H "X-API-Key: $SPENDGUARD_API_KEY"
Get a specific version
curl "https://spendguardapi.com/v1/policies/my_refund_policy?version=1" \
-H "X-API-Key: $SPENDGUARD_API_KEY"
Response — 200 OK
{
"policy_id": "my_refund_policy",
"name": "My Refund Policy",
"description": "Controls AI agent refund authorization",
"version": 1,
"rules": [
{
"rule_id": "r1",
"rule_type": "max_amount",
"description": "Block refunds over $500",
"parameters": { "limit": 500, "currency": "USD" }
},
{
"rule_id": "r2",
"rule_type": "escalate_if",
"description": "Escalate refunds over $200",
"parameters": { "amount_above": 200, "action_types": ["refund"] }
}
],
"created_at": "2026-04-03T12:00:00Z",
"updated_at": "2026-04-03T12:00:00Z",
"metadata": null
}
Error Responses
| Status | Code | When |
|---|
| 401 | unauthorized | Missing or invalid API key |
| 404 | policy_not_found | No policy exists with this ID (or specific version doesn’t exist) |
| 500 | internal_error | Server error |