انتشار llms.txt
POST
/sites/{siteId}/geo/llms-txt- Scope
actions:apply- ابزار MCP
apply_llms_txt
Approve a new /llms.txt and write it through WordPress The same rules as "Publish /llms.txt" in the app: WordPress connected and writable, at most 60,000 characters, undo in the app for 30 days. Then /llms.txt is read again; GET shows lastChange.status and live.matchesLastWrite. An empty value removes the file MonoRanks wrote.
توضیح ها از سند OpenAPI می آیند و انگلیسی اند.
پارامترها
| نام | محل | توضیح |
|---|---|---|
siteIdاجباری | path | stringWebsite id, from GET /sites. |
بدنه درخواست
| فیلد | توضیح |
|---|---|
value | string · required; at most 60000 characters; The full new file; an empty string removes the file MonoRanks wrote |
{
"value": "# Acme Bikes\n\n> Road, gravel and e-bikes with free fitting.\n\n## Shop\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\n"
}پاسخ
200 · application/json
| فیلد | توضیح |
|---|---|
approved | true or false · required; Always true |
batchId | string · required; Change batch id; GET shows its state as lastChange |
note | string · required; What happens next |
link | address (URL) · required; The AI readiness screen in the app |
خطاها
| کد | معنی |
|---|---|
400 | Bad request. Codes: bad_value, too_long. |
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. |
نمونه درخواست
curl -X POST \
-H "Authorization: Bearer mr_ws_…" \
-H "Content-Type: application/json" \
-d '{"value":"# Acme Bikes\n\n> Road, gravel and e-bikes with free fitting.\n\n## Shop\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\n"}' \
"https://app.monoranks.com/api/v1/sites/SITE_ID/geo/llms-txt"const res = await fetch("https://app.monoranks.com/api/v1/sites/SITE_ID/geo/llms-txt", {
method: "POST",
headers: { Authorization: "Bearer mr_ws_…", "Content-Type": "application/json" },
body: JSON.stringify({
"value": "# Acme Bikes\n\n> Road, gravel and e-bikes with free fitting.\n\n## Shop\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\n"
}),
});
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/llms-txt",
headers={"Authorization": "Bearer mr_ws_…"},
json={
"value": "# Acme Bikes\n\n> Road, gravel and e-bikes with free fitting.\n\n## Shop\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\n",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://app.monoranks.com/api/v1/sites/SITE_ID/geo/llms-txt");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer mr_ws_…", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"value":"# Acme Bikes\\n\\n> Road, gravel and e-bikes with free fitting.\\n\\n## Shop\\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\\n"}',
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/llms-txt",
{
"value": "# Acme Bikes\n\n> Road, gravel and e-bikes with free fitting.\n\n## Shop\n- [Gravel bikes](https://acmebikes.com/gravel-bikes/)\n"
},
{ headers: { Authorization: "Bearer mr_ws_…" } },
);نمونه پاسخ
{
"approved": true,
"batchId": "f6b8d0f2-4a6c-4e8a-ac2e-6a8cae2a4c6d",
"note": "Queued: the worker writes /llms.txt through WordPress, then reads it again.",
"link": "https://app.monoranks.com/sites/3f6c2a1e-8b4d-4c7a-9e21-5d0b7a6f4c13/geo"
}{
"error": {
"code": "bad_value",
"message": "Send the new file as { \"value\": \"# Name\\n…\" }; an empty string removes the file 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."
}
}سرور MCP همین کار را با ابزار apply_llms_txt انجام می دهد.