Documentación para desarrolladores

Escribir reglas para rastreadores de IA

POST/sites/{siteId}/geo/ai-crawlers
Permiso
actions:apply
Herramienta MCP
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.

Las descripciones vienen del documento OpenAPI y están en inglés.

Parámetros

NombreDóndeDetalles
siteIdObligatoriorutastringWebsite id, from GET /sites.

Cuerpo de la petición

CampoDetalles
rulesobject · required; allow or deny per crawler name (any letter case)
rules.<name>allow | deny
{
  "rules": {
    "GPTBot": "deny",
    "OAI-SearchBot": "allow"
  }
}

Respuesta

200 · application/json

CampoDetalles
approvedtrue or false · required; Always true
batchIdstring · required; Change batch id; GET shows its state as lastChange
rulesobject · required; The rules approved, with the crawler names as MonoRanks writes them
rules.GPTBotstring
rules.OAI-SearchBotstring
notestring · required; What happens next
linkaddress (URL) · required; The AI readiness screen in the app

Errores

EstadoSignificado
400Bad request. Codes: bad_rules, unknown_crawler.
401Missing, unknown or revoked key. Codes: missing_key, invalid_key.
403The key lacks the scope, covers another website, or its owner lost access. Codes: missing_scope, other_site, owner_left, no_owner, forbidden.
404Not found. Codes: not_found.
409Conflict with the current state. Codes: wordpress_not_connected, wordpress_not_writable, no_change.
429Too many requests this hour for this key. Codes: rate_limited.
503Switched off for now. Codes: feature_off.

Petición de ejemplo

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"

Respuesta de ejemplo

{
  "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"
}

El servidor MCP hace lo mismo con la herramienta apply_ai_crawler_rules.