API reference OpenAPI 3.1
POST /features

Create feature

Bearer API key or staff session application/json operation createFeature

Request

Content type: application/json · required

FieldTypeRequiredDescription
key string Yes —
curl -X POST "$MONICHEK_API/features" \
  -H "Authorization: Bearer $MONICHEK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "rule_key"
}'
const res = await fetch(`${MONICHEK_API}/features`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${MONICHEK_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "key": "rule_key"
  }),
});

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

res = requests.post(
    f"{os.environ['MONICHEK_API']}/features",
    headers={"Authorization": f"Bearer {os.environ['MONICHEK_API_KEY']}"},
    json={
      "key": "rule_key"
    },
)
print(res.json())
$ch = curl_init(getenv('MONICHEK_API') . '/features');
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([
        'key' => 'rule_key',
    ]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Responses

201 Created feature application/json

No response example is published for this status.