Activate rule set
The authenticated staff caller is the approver. Activation is rejected when the caller authored the selected version; caller-supplied approver names are ignored. A second staff member must perform this call.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | — |
Request
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
version |
integer | No | — |
curl -X POST "$MONICHEK_API/rule-sets/{id}:activate" \
-H "Authorization: Bearer $MONICHEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": 1
}'const res = await fetch(`${MONICHEK_API}/rule-sets/{id}:activate`, {
method: "POST",
headers: {
Authorization: `Bearer ${MONICHEK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": 1
}),
});
const data = await res.json();import os
import requests
res = requests.post(
f"{os.environ['MONICHEK_API']}/rule-sets/{id}:activate",
headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
json={
"version": 1
},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/rule-sets/{id}:activate');
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([
'version' => 1,
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Replace {id} with the resource id.
Responses
200 OK
promoted
application/json
{
"object": "promoted",
"state": "active"
}Error responses
| Status | Meaning | Body |
|---|---|---|
| 403 | Forbidden | RFC 9457 problem |
| 409 | Conflict | RFC 9457 problem |
Errors use the RFC 9457 problem format with a stable code.