Skip to content

cURL Examples

Quick reference for interacting with Vargate from the command line.


Setup

Set your API key as an environment variable:

export VARGATE_URL="https://vargate.ai/api"
export VARGATE_API_KEY="vg-abc123..."

Submit a Governed Tool Call

curl -X POST "$VARGATE_URL/mcp/tools/call" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -d '{
    "agent_id": "my-agent-v1",
    "agent_type": "autonomous",
    "agent_version": "1.0.0",
    "tool": "http",
    "method": "GET",
    "params": {"url": "https://api.example.com/data"}
  }'

Verify Audit Chain

curl "$VARGATE_URL/audit/verify" \
  -H "X-API-Key: $VARGATE_API_KEY"

View Audit Log

# Last 10 records
curl "$VARGATE_URL/audit/log?limit=10" \
  -H "X-API-Key: $VARGATE_API_KEY"

Replay a Decision

curl -X POST "$VARGATE_URL/audit/replay" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -d '{"action_id": "550e8400-e29b-41d4-a716-446655440000"}'

Get Merkle Proof

curl "$VARGATE_URL/audit/merkle/proof/RECORD_HASH_HERE" \
  -H "X-API-Key: $VARGATE_API_KEY"

List Policy Templates

curl "$VARGATE_URL/policy/templates" \
  -H "X-API-Key: $VARGATE_API_KEY"

Apply a Policy Template

curl -X PATCH "$VARGATE_URL/dashboard/settings" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -d '{
    "policy_template": "financial",
    "policy_config": {
      "transaction_limit": 10000,
      "approval_threshold": 5000
    }
  }'

Configure Webhooks

curl -X PATCH "$VARGATE_URL/dashboard/settings" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -d '{
    "webhook_url": "https://your-server.com/webhook",
    "webhook_events": ["action.denied", "action.pending"]
  }'

Test Webhook Delivery

curl -X POST "$VARGATE_URL/webhooks/test" \
  -H "X-API-Key: $VARGATE_API_KEY"

Check Gateway Health

curl "$VARGATE_URL/health"

Blockchain Anchor Status

curl "$VARGATE_URL/anchor/status" \
  -H "X-API-Key: $VARGATE_API_KEY"

Export Compliance Package

# JSON format
curl "$VARGATE_URL/compliance/export/YOUR_TENANT_ID?from=2026-01-01&to=2026-12-31&format=json" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -o compliance-report.json

# PDF format
curl "$VARGATE_URL/compliance/export/YOUR_TENANT_ID?from=2026-01-01&to=2026-12-31&format=pdf" \
  -H "X-API-Key: $VARGATE_API_KEY" \
  -o compliance-report.pdf

GDPR Erasure

# Erase subject data
curl -X POST "$VARGATE_URL/audit/erase/user-123" \
  -H "X-API-Key: $VARGATE_API_KEY"

# Verify erasure
curl "$VARGATE_URL/audit/erase/user-123/verify" \
  -H "X-API-Key: $VARGATE_API_KEY"

Rotate API Key

curl -X POST "$VARGATE_URL/api-keys/rotate" \
  -H "X-API-Key: $VARGATE_API_KEY"
# Save the new key from the response!