API reference OpenAPI 3.1
POST /decide:simulate

Replay transactions through a candidate rule set

Bearer API key or staff session application/json operation simulateDecide

Request

Content type: application/json · required

FieldTypeRequiredDescription
transactions array of object No —
rule_set_version integer No —
labels array of string No —
timeout_ms integer No —
curl -X POST "$MONICHEK_API/decide:simulate" \
  -H "Authorization: Bearer $MONICHEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "transactions": [
    {}
  ],
  "rule_set_version": 1,
  "labels": [
    "string"
  ],
  "timeout_ms": 1
}'
const res = await fetch(`${MONICHEK_API}/decide:simulate`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${MONICHEK_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "transactions": [
      {}
    ],
    "rule_set_version": 1,
    "labels": [
      "string"
    ],
    "timeout_ms": 1
  }),
});

const data = await res.json();
import os
import requests

res = requests.post(
    f"{os.environ['MONICHEK_API']}/decide:simulate",
    headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
    json={
      "transactions": [
        {}
      ],
      "rule_set_version": 1,
      "labels": [
        "string"
      ],
      "timeout_ms": 1
    },
)
print(res.json())
$ch = curl_init(getenv('MONICHEK_API') . '/decide:simulate');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('MONICHEK_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'transactions' => [
            [],
        ],
        'rule_set_version' => 1,
        'labels' => [
            'string',
        ],
        'timeout_ms' => 1,
    ]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Responses

200 OK agreement, confusion, lift, flag-rate deltas application/json
{
  "id": "sim_01M3R...",
  "result": {
    "transactions": 1,
    "errors": 0,
    "truncated": false,
    "rule_set_version": 1,
    "agreement_rate": 1,
    "newly_flagged": 0,
    "missed_by_candidate": 0,
    "flag_rate_current": 0,
    "flag_rate_candidate": 0,
    "lift": 0,
    "sample_diffs": []
  }
}

Error responses

StatusMeaningBody
422 Unprocessable Entity RFC 9457 problem

Errors use the RFC 9457 problem format with a stable code.