Create report
Request
Content type: application/json · required
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | No | — |
case_id |
string | No | — |
curl -X POST "$MONICHEK_API/reports" \
-H "Authorization: Bearer $MONICHEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "person",
"case_id": "cas_01M3R..."
}'const res = await fetch(`${MONICHEK_API}/reports`, {
method: "POST",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "person",
"case_id": "cas_01M3R..."
}),
});
const data = await res.json();import os
import requests
res = requests.post(
f"{os.environ['MONICHEK_API']}/reports",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
json={
"type": "person",
"case_id": "cas_01M3R..."
},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/reports');
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([
'type' => 'person',
'case_id' => 'cas_01M3R...',
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
201 Created
report
application/json
{
"object": "report",
"id": "rpt_01M3R..."
}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.