Korrekturen einer Aktion anwenden
/sites/{siteId}/actions/{issueId}/apply- Berechtigung
actions:apply- MCP-Tool
apply
Apply approved values through WordPress Approves new SEO titles, meta descriptions, canonicals or noindex for the pages of one action, writes them through the WordPress connector, then rechecks. The key owner is recorded as approver; undo is in the app for 30 days. A category or tag archive takes an SEO title or meta description when the WordPress plugin supports it; otherwise it is refused with not_writable and the reason. Image alt text and redirects are applied in the app only.
Die Beschreibungen kommen aus dem OpenAPI-Dokument und sind auf Englisch.
Parameter
| Name | Ort | Details |
|---|---|---|
siteIdPflicht | Pfad | stringWebsite id, from GET /sites. |
issueIdPflicht | Pfad | stringIssue id of the action, from GET /sites/{siteId}/actions. |
Anfrage (Body)
| Feld | Details |
|---|---|
changes | list of object · required; at most 500 items; One change per page, at most 500 |
changes[].url | string · required; A page the action lists, a published WordPress item synced to MonoRanks |
changes[].value | string · required; The new value; for noindex, 1 to set it and 0 to remove it |
{
"changes": [
{
"url": "https://acmebikes.com/products/trail-pro-29",
"value": "Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns."
}
]
}Antwort
200 · application/json
| Feld | Details |
|---|---|
approved | integer · required; Changes approved |
batchId | string · required; Batch id; see lastChange of the issue |
note | string · required; What happens next |
link | string · required; The action in the app |
Hinweise
Senden Sie die Werte, die Sie genehmigen, an POST /sites/{siteId}/actions/{issueId}/apply als { "changes": [ { "url": "…", "value": "…" } ] } (höchstens 500). Über die API schreibt apply SEO-Titel, Meta-Beschreibungen, Canonicals und noindex; Alt-Texte von Bildern und Weiterleitungen wenden Sie in der App an.
Fehler
| Status | Bedeutung |
|---|---|
400 | Bad request. Codes: field_not_supported, no_changes, not_a_wordpress_post, not_applied. |
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. |
422 | The request cannot be carried out. Codes: not_writable. |
429 | Too many requests this hour for this key. Codes: rate_limited. |
Beispielanfrage
curl -X POST \
-H "Authorization: Bearer mr_ws_…" \
-H "Content-Type: application/json" \
-d '{"changes":[{"url":"https://acmebikes.com/products/trail-pro-29","value":"Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns."}]}' \
"https://app.monoranks.com/api/v1/sites/SITE_ID/actions/ISSUE_ID/apply"const res = await fetch("https://app.monoranks.com/api/v1/sites/SITE_ID/actions/ISSUE_ID/apply", {
method: "POST",
headers: { Authorization: "Bearer mr_ws_…", "Content-Type": "application/json" },
body: JSON.stringify({
"changes": [
{
"url": "https://acmebikes.com/products/trail-pro-29",
"value": "Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns."
}
]
}),
});
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/actions/ISSUE_ID/apply",
headers={"Authorization": "Bearer mr_ws_…"},
json={
"changes": [
{
"url": "https://acmebikes.com/products/trail-pro-29",
"value": "Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns.",
},
],
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://app.monoranks.com/api/v1/sites/SITE_ID/actions/ISSUE_ID/apply");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer mr_ws_…", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"changes":[{"url":"https://acmebikes.com/products/trail-pro-29","value":"Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns."}]}',
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/actions/ISSUE_ID/apply",
{
"changes": [
{
"url": "https://acmebikes.com/products/trail-pro-29",
"value": "Trail Pro 29: a light aluminium trail bike with 140 mm travel and a 12-speed drivetrain. Free delivery and 30-day returns."
}
]
},
{ headers: { Authorization: "Bearer mr_ws_…" } },
);Beispielantwort
{
"approved": 1,
"batchId": "f6b8d0f2-4a6c-4e8a-ac2e-6a8cae2a4c6d",
"note": "Written by the worker, then rechecked. Undo is available in the app for 30 days.",
"link": "https://app.monoranks.com/sites/3f6c2a1e-8b4d-4c7a-9e21-5d0b7a6f4c13/actions/b2e4c6a8-1d3f-4a5b-9c7d-0e2f4a6b8c1d"
}{
"error": {
"code": "field_not_supported",
"message": "Through the API, apply supports SEO titles, descriptions, canonical and noindex. Use the app for image alt text and redirects."
}
}{
"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": "Action not found."
}
}{
"error": {
"code": "not_writable",
"message": "https://acmebikes.com/category/gravel/ is a category or tag archive. Update the MonoRanks plugin in WordPress so MonoRanks can write its title and description."
}
}{
"error": {
"code": "rate_limited",
"message": "More than 1200 requests this hour for this key."
}
}Der MCP-Server macht dasselbe mit dem Tool apply.