Skip to main content
POST
/
sites
/
environments
/
{env_id}
/
run-wp-cli-command
Run a WP CLI command
curl --request POST \
  --url https://api.kinsta.com/v2/sites/environments/{env_id}/run-wp-cli-command \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "wp_command": "wp core version"
}
'
{
  "message": "Running a WP CLI command in progress",
  "status": 202,
  "operation_id": "environment:run-wp-cli-command-54fb80af-576c-4fdc-ba4f-b596c83f15a1"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

env_id
string<uuid>
required
Example:

"54fb80af-576c-4fdc-ba4f-b596c83f15a1"

Body

application/json
wp_command
string
required
Maximum string length: 5000
Pattern: ^wp\s+[a-zA-Z0-9_\-./:=@'\s]+$
Example:

"wp core version"

Response

Running a WP CLI command action started. Check MyKinsta for status

message
string
required
Example:

"Running a WP CLI command in progress"

status
number
required
Example:

202

operation_id
string
Example:

"environment:run-wp-cli-command-54fb80af-576c-4fdc-ba4f-b596c83f15a1"