Skip to main content

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

ParameterTypeDescription
policy_idstringThe policy ID to retrieve

Query Parameters

ParameterTypeDefaultDescription
versionintegerLatestSpecific 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

StatusCodeWhen
401unauthorizedMissing or invalid API key
404policy_not_foundNo policy exists with this ID (or specific version doesn’t exist)
500internal_errorServer error