KI-Crawler-Regeln schreiben
POST
/sites/{siteId}/geo/ai-crawlers- Berechtigung
actions:apply- MCP-Tool
apply_ai_crawler_rules
Approve AI crawler rules and write them into robots.txt The same rules as "Write rules to robots.txt" in the app: WordPress connected and writable, undo in the app for 30 days, robots.txt read again. Send the full set; crawlers left out get no rule from MonoRanks and {} removes its rules. Known crawlers: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, PerplexityBot, Google-Extended, Applebot-Extended, CCBot, Bytespider, meta-externalagent, Amazonbot.
Die Beschreibungen kommen aus dem OpenAPI-Dokument und sind auf Englisch.
Parameter
| Name | Ort | Details |
|---|---|---|
siteIdPflicht | Pfad | stringWebsite id, from GET /sites. |
Anfrage (Body)
| Feld | Details |
|---|---|
rules | object · required; allow or deny per crawler name (any letter case) |
rules.<name> | allow | deny |
{
"rules": {
"GPTBot": "deny",
"OAI-SearchBot": "allow"
}
}Antwort
200 · application/json
| Feld | Details |
|---|---|
approved | true or false · required; Always true |
batchId | string · required; Change batch id; GET shows its state as lastChange |
rules | object · required; The rules approved, with the crawler names as MonoRanks writes them |
rules.GPTBot | string |
rules.OAI-SearchBot | string |
note | string · required; What happens next |
link | address (URL) · required; The AI readiness screen in the app |
Fehler
| Status | Bedeutung |
|---|---|
400 | Bad request. Codes: bad_rules, unknown_crawler. |
401 | Missing, unknown or revoked key. Codes: missing_key, invalid_key. |
403 | The key lacks the scope, covers another website, or its owner lost access. Codes: missing_scope, other_site, owner_left, no_owner, forbidden. |
404 | Not found. Codes: not_found. |
409 | Conflict with the current state. Codes: wordpress_not_connected, wordpress_not_writable, no_change. |
429 | Too many requests this hour for this key. Codes: rate_limited. |
503 | Switched off for now. Codes: feature_off. |
Beispielanfrage
curl -X POST \
-H "Authorization: Bearer mr_ws_…" \
-H "Content-Type: application/json" \
-d '{"rules":{"GPTBot":"deny","OAI-SearchBot":"allow"}}' \
"https://app.monoranks.com/api/v1/sites/SITE_ID/geo/ai-crawlers"const res = await fetch("https://app.monoranks.com/api/v1/sites/SITE_ID/geo/ai-crawlers", {
method: "POST",
headers: { Authorization: "Bearer mr_ws_…", "Content-Type": "application/json" },
body: JSON.stringify({
"rules": {
"GPTBot": "deny",
"OAI-SearchBot": "allow"
}
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
res = requests.post(
"https://app.monoranks.com/api/v1/sites/SITE_ID/geo/ai-crawlers",
headers={"Authorization": "Bearer mr_ws_…"},
json={
"rules": {
"GPTBot": "deny",
"OAI-SearchBot": "allow",
},
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://app.monoranks.com/api/v1/sites/SITE_ID/geo/ai-crawlers");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer mr_ws_…", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"rules":{"GPTBot":"deny","OAI-SearchBot":"allow"}}',
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);import axios from "axios";
const { data } = await axios.post(
"https://app.monoranks.com/api/v1/sites/SITE_ID/geo/ai-crawlers",
{
"rules": {
"GPTBot": "deny",
"OAI-SearchBot": "allow"
}
},
{ headers: { Authorization: "Bearer mr_ws_…" } },
);Beispielantwort
{
"approved": true,
"batchId": "f6b8d0f2-4a6c-4e8a-ac2e-6a8cae2a4c6d",
"rules": {
"GPTBot": "deny",
"OAI-SearchBot": "allow"
},
"note": "Queued: the worker writes the rules into robots.txt through WordPress, then reads robots.txt again.",
"link": "https://app.monoranks.com/sites/3f6c2a1e-8b4d-4c7a-9e21-5d0b7a6f4c13/geo"
}{
"error": {
"code": "bad_rules",
"message": "Send { \"rules\": { \"GPTBot\": \"deny\", \"OAI-SearchBot\": \"allow\" } }; {} removes the rules MonoRanks wrote."
}
}{
"error": {
"code": "missing_key",
"message": "Send the key as Authorization: Bearer mr_site_…"
}
}{
"error": {
"code": "missing_scope",
"message": "This key does not have the scope this call needs."
}
}{
"error": {
"code": "not_found",
"message": "Website not found."
}
}{
"error": {
"code": "wordpress_not_connected",
"message": "This website has no WordPress connector, so MonoRanks cannot publish this. Connect WordPress in the app, or ship the file in your own code."
}
}{
"error": {
"code": "rate_limited",
"message": "More than 1200 requests this hour for this key."
}
}{
"error": {
"code": "feature_off",
"message": "AI readiness is switched off for now."
}
}Der MCP-Server macht dasselbe mit dem Tool apply_ai_crawler_rules.