Entwicklerdokumentation

Korrekturen einer Aktion anwenden

POST/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

NameOrtDetails
siteIdPflichtPfadstringWebsite id, from GET /sites.
issueIdPflichtPfadstringIssue id of the action, from GET /sites/{siteId}/actions.

Anfrage (Body)

FeldDetails
changeslist of object · required; at most 500 items; One change per page, at most 500
changes[].urlstring · required; A page the action lists, a published WordPress item synced to MonoRanks
changes[].valuestring · 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

FeldDetails
approvedinteger · required; Changes approved
batchIdstring · required; Batch id; see lastChange of the issue
notestring · required; What happens next
linkstring · 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

StatusBedeutung
400Bad request. Codes: field_not_supported, no_changes, not_a_wordpress_post, not_applied.
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.
422The request cannot be carried out. Codes: not_writable.
429Too 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"

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

Der MCP-Server macht dasselbe mit dem Tool apply.