Set decide budget and fail mode
Request
Content type: application/json · required
| Field | Type | Required | Description |
|---|---|---|---|
budget_ms |
integer | No | default 300 |
fail_mode |
string | No | one of fail_open, fail_closed |
curl -X PUT "$MONICHEK_API/decide:config" \
-H "Authorization: Bearer $MONICHEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"budget_ms": 300,
"fail_mode": "fail_open"
}'const res = await fetch(`${MONICHEK_API}/decide:config`, {
method: "PUT",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"budget_ms": 300,
"fail_mode": "fail_open"
}),
});
const data = await res.json();import os
import requests
res = requests.put(
f"{os.environ['MONICHEK_API']}/decide:config",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
json={
"budget_ms": 300,
"fail_mode": "fail_open"
},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/decide:config');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MONICHEK_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'budget_ms' => 300,
'fail_mode' => 'fail_open',
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
200 OK
config
application/json
{
"object": "decide_config",
"tenant_id": "ten_SANDBOX",
"budget_ms": 300,
"fail_mode": "fail_open"
}Error responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Unauthorized | RFC 9457 problem |
| 422 | Unprocessable Entity | RFC 9457 problem |
Errors use the RFC 9457 problem format with a stable code.