We’ve refreshed our API documentation with a brand-new look and feel. Don’t worry, everything you rely on is still there. The content hasn’t changed; it’s just had a makeover to make it cleaner, clearer, and easier to navigate.
cURL
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" }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
"54fb80af-576c-4fdc-ba4f-b596c83f15a1"
5000
^wp\s+[a-zA-Z0-9_\-./:=@'\s]+$
"wp core version"
Running a WP CLI command action started. Check MyKinsta for status
"Running a WP CLI command in progress"
202
"environment:run-wp-cli-command-54fb80af-576c-4fdc-ba4f-b596c83f15a1"