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
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
command | string | required | A command to run agains the WP CLI tool, an example is: cache flush --path=/home/ploi/wpcli.examplehosting.com/public , do not include the wp command, this is automatically appended |
Example request:
curl -X POST "https://ploi.io/api/servers/{server}/wp-cli/run" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{
"command": "cache flush --path=/home/ploi/wpcli.examplehosting.com/public"
}'
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "ok",
"message": "Success: The cache was flushed.\n"
}