hosting

POST /v1/sites/{siteId}/wordpress/cli

Run one allow-listed WP-CLI command on the site.

सभी hosting एंडपॉइंट्स

सभी डेवलपर दस्तावेज़

प्रमाणन

बेरर टोकन के रूप में एक API कुंजी भेजें। कुंजी के पास sites.view अनुमति होनी चाहिए; इसके बिना एक कुंजी को 404 के बजाय 403 के साथ अस्वीकार कर दिया जाता है।

यह एंडपॉइंट कोई संगठन आईडी नहीं लेता है। आपकी कुंजी पहले से ही उस संगठन की पहचान करती है जिससे वह संबंधित है, और प्रतिक्रिया उसी के दायरे में है।

इसे आज़माएँ

कोणार्कित ब्रैकेट्स में दी गई किसी भी चीज़ को अपने मानों से बदलें, और की प्लेसहोलर को अपने डैशबोर्ड की एक की से बदलें।

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/wordpress/cli \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "command": <string> }'

साइन इन हैं? आपके डैशबोर्ड में मौजूद API कंसोल आपकी वास्तविक संगठन आईडी और आपकी अपनी कुंजी स्वतः भर देता है, और लाइव API के विरुद्ध अनुरोध चलाता है ताकि आप वास्तविक प्रतिक्रिया देख सकें। इस एंडपॉइंट को API कंसोल में खोलें

विवरण

An audited WP-CLI console. Every invocation is recorded in the site's WordPress activity log with its argv and exit code — never its output. ⛔ Allow-listed, never arbitrary. An unrestricted passthrough is remote code execution as the site user: wp eval runs arbitrary PHP, wp db query runs arbitrary SQL, and wp --require=/tmp/x.php loads code the caller chose before WP-CLI decides what to do. The permitted commands are reads and idempotent cache operations, listed by listWordPressCliCommands; anything else answers 422 naming the whole list. ⛔ config get and config list are deliberately absent — they read wp-config.php, whose constants include the database password and the authentication salts. ⛔ A non-zero exit_code still answers 200. The console's product is what WP-CLI said, and mapping a bad argument onto a 4xx would put our error page over the diagnosis the customer asked for. A 422 means we refused the command, which is a different answer. ⛔ The command travels in the body, not the path, so it never reaches a proxy or edge access log — option get names options a plugin may have stored a credential in. ⛔ Fleet only — refused where wp_cli is false. Requires sites.view and sites.panel_access.

पैरामीटर

नामप्रकारआवश्यकयह क्या है
siteId (path)UuidहाँSite ID (UUIDv7).

अनुरोध बॉडी

नामप्रकारआवश्यकयह क्या है
commandstringहाँThe WP-CLI command, with or without a leading wp.

प्रतिक्रिया

नामप्रकारआवश्यकयह क्या है
argvstring[]हाँWhat actually ran, after the allow-list normalised it — echoed back so wp plugin list and plugin list are visibly the same command.
exit_codeintegerहाँWP-CLI's exit code. 0 is success.
stdoutstringहाँWhat WP-CLI printed, up to the console's cap.
stderrstringहाँWP-CLI's diagnostics, carried separately and never merged into stdout — WP-CLI writes PHP notices here on runs that succeed, so folding them together would corrupt the JSON…
truncatedbooleanहाँTrue when stdout was cut at the cap. ⛔ Stated rather than hidden: a silently cut-off JSON document is worse than none, because it nearly parses.

त्रुटियाँ जो यह एंडपॉइंट लौटा सकता है

401 · 403 · 404 · 422 · 429 · 503