hosting
POST /v1/sites/{siteId}/wordpress/cli
Run one allow-listed WP-CLI command on the site.
ავტორიზაცია
API გასაღები გაგზავნეთ როგორც მატარებელი ტოკენი (bearer token). გასაღებს უნდა ჰქონდეს sites.view ნებართვა; ამის გარეშე გასაღები უარყოფილი იქნება 403 და არა 404 სტატუსით.
ეს ბოლო წერტილი არ იღებს ორგანიზაციის იდენტიფიკატორს. თქვენი გასაღები უკვე აიდენტიფიცირებს იმ ორგანიზაციას, რომელსაც ის ეკუთვნის, და პასუხი შემოფარგლულია მისით.
სცადეთ
შეSubstituted any value inside angle brackets with your own and the key placeholder with a key from your dashboard.
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 კონსოლი ავტომატურად ამატებს თქვენი რეალური ორგანიზაციის ID-სა და საკუთარ გასაღებს და ატარებს მოთხოვნას ცოცხალ API-ს წინააღმდეგ, რათა იხილოთ რეალური პასუხი. გაAღით ეს ენდპოინტი 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). |
მოთხოვნის სხეული
| სახელი | ტიპი | სავალდებულო | რა არის ეს |
|---|---|---|---|
command | string | დიახ | The WP-CLI command, with or without a leading wp. |
პასუხი
| სახელი | ტიპი | სავალდებულო | რა არის ეს |
|---|---|---|---|
argv | string[] | დიახ | What actually ran, after the allow-list normalised it — echoed back so wp plugin list and plugin list are visibly the same command. |
exit_code | integer | დიახ | WP-CLI's exit code. 0 is success. |
stdout | string | დიახ | What WP-CLI printed, up to the console's cap. |
stderr | string | დიახ | 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… |
truncated | boolean | დიახ | 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