curl -X POST https://delegatezero.com/api/v1/decisions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request": "Customer is requesting a refund after 46 days.",
"context": {
"source": "helpdesk",
"data": "Customer: Acme Corp, Plan: Operator, MRR: $149"
},
"instructions": {
"confidence_threshold": 0.80
}
}'
import axios from "axios";
const decision = await axios.post(
"https://delegatezero.com/api/v1/decisions",
{
request: "Customer is requesting a refund after 46 days.",
context: {
source: "helpdesk",
data: "Customer: Acme Corp, Plan: Operator, MRR: $149"
},
instructions: {
confidence_threshold: 0.80
}
},
{
headers: {
Authorization: `Bearer ${process.env.API_KEY}`
}
}
);
import requests, os
response = requests.post(
"https://delegatezero.com/api/v1/decisions",
headers={
"Authorization": f"Bearer {os.environ['API_KEY']}",
"Content-Type": "application/json"
},
json={
"request": "Customer is requesting a refund after 46 days.",
"context": {
"source": "helpdesk",
"data": "Customer: Acme Corp, Plan: Operator, MRR: $149"
},
"instructions": {
"confidence_threshold": 0.80
}
}
)
{
"id": "dec_8f2kx9pq",
"decision": "execute",
"confidence": 0.84,
"response": "Approved: partial refund of $74.50 (50%) given the 46-day timeline and Operator tier relationship. Refund processed.",
"reason": "Refund policy allows exceptions within 60 days for Operator+ customers with active subscriptions. Applying 50% exception precedent from similar case dec_6a1bm3nw.",
"audit_url": "https://delegatezero.com/app/decisions/dec_8f2kx9pq"
}