Ploi API
Ploi API

Run WP CLI command

Runs a WordPress CLI command

This call can take longer than usual because the actual command is run on-demand on your server.

POST api/servers/{server}/wp-cli/run


Parameter Type Status Description
command string required A command to run agains the WP CLI tool, an example is: cache flush --path=/home/ploi/, do not include the wp command, this is automatically appended

Example request:

curl -X POST "{server}/wp-cli/run" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
   --data '{ 
         "command": "cache flush --path=/home/ploi/"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

    "status": "ok",
    "message": "Success: The cache was flushed.\n"