WordPress Site Environments

The available WordPress site environments include:

Using the environments endpoint, you can:

You can obtain the site_id using the GET request with the WordPress Sites endpoint.

The site_id is also shown in the URL in MyKinsta when you access the environment, for example in the URL https://my.kinsta.com/sites/details/fbab4927-e354-4044-b226-29ac0fbd20ca/c84ce214-69b9-4a32-8e67-880672cf1d38?idCompany=bdd25d71-5706-4890-870f-1adda17c505d:

  • The site_id is fbab4927-e354-4044-b226-29ac0fbd20ca
  • The environment_id is c84ce214-69b9-4a32-8e67-880672cf1d38
  • The company_id is bdd25d71-5706-4890-870f-1adda17c505d

The change-environment-php-allocation and change-site-php-allocation endpoints are not currently available to customers who have the PHP memory add-on or those on any of following plans: Single 1.25M or above, WP 60 or above, Agency, or a custom plan.

The PHP memory limit and number of PHP threads must add up to the existing total memory pool of the site. You can only change the total memory pool within PHP performance in MyKinsta.

change-environment-php-allocation can only be used for premium staging environments.

change-site-php-allocation updates the PHP memory limit of the live environment and all standard staging environments. Strandard staging environments will always have 2 PHP threads regardless of their memory allocated. You cannot use this endpoint to update premium staging environments.

Get site environments

SecuritybearerAuth
Request
path Parameters
site_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Responses
200

Successfully found site environments

401

No or invalid API key provided to the request

404

Could not find the site environments or the user does not have permissions to retrieve data

500

Error occurred while retrieving site environments

get/sites/{site_id}/environments
Request samples
Response samples
application/json
{
  • "site": {
    }
}

Create a WordPress site environment

SecuritybearerAuth
Request
path Parameters
site_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
required
display_name
required
string
site_title
required
string
is_premium
required
boolean
admin_email
required
string
admin_password
required
string
admin_user
required
string
wp_language
required
is_subdomain_multisite
boolean
is_multisite
boolean
woocommerce
boolean
wordpress_plugin_edd
boolean
wordpressseo
boolean
Responses
202

Environment creation action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while creating an environment

post/sites/{site_id}/environments
Request samples
application/json
{
  • "display_name": "development",
  • "site_title": "My First Site - development",
  • "is_premium": false,
  • "is_subdomain_multisite": false,
  • "admin_email": "[email protected]",
  • "admin_password": "vJnFnN-~v)PxF[6k",
  • "admin_user": "admin",
  • "is_multisite": false,
  • "woocommerce": false,
  • "wordpress_plugin_edd": false,
  • "wordpressseo": false,
  • "wp_language": "en_US"
}
Response samples
application/json
{
  • "operation_id": "environment:add-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Adding environment in progress",
  • "status": 202
}

Push a WordPress site environment

SecuritybearerAuth
Request
path Parameters
site_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
source_env_id
required
string
target_env_id
required
string
push_db
boolean
Default: true
push_files
boolean
Default: true
run_search_and_replace
boolean
Default: true
Responses
202

Pushing environment action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while pushing an environment

put/sites/{site_id}/environments
Request samples
application/json
{
  • "source_env_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "target_env_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "push_db": true,
  • "push_files": true,
  • "run_search_and_replace": true
}
Response samples
application/json
{
  • "operation_id": "environments:push-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Pushing environment in progress",
  • "status": 202
}

Create a plain environment (no WordPress installed)

SecuritybearerAuth
Request
path Parameters
site_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
required
display_name
required
string
is_premium
required
boolean
Responses
202

Creating plain environment action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while creating an environment

post/sites/{site_id}/environments/plain
Request samples
application/json
{
  • "display_name": "development",
  • "is_premium": false
}
Response samples
application/json
{
  • "operation_id": "environment:clone-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Creating plain environment in progress",
  • "status": 202
}

Clone an environment

SecuritybearerAuth
Request
path Parameters
site_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
required
display_name
required
string
is_premium
required
boolean
source_env_id
required
string
Responses
202

Cloning environment action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while creating an environment

post/sites/{site_id}/environments/clone
Request samples
application/json
{
  • "display_name": "development",
  • "is_premium": false,
  • "source_env_id": "0010cdaf-0b94-472e-86bd-7edf6fceaa1c"
}
Response samples
application/json
{
  • "operation_id": "environment:clone-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Cloning environment in progress",
  • "status": 202
}

Delete a WordPress site environment

SecuritybearerAuth
Request
path Parameters
env_id
required
string
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Responses
202

Deleting envrionment action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while deleting an environment

delete/sites/environments/{env_id}
Request samples
Response samples
application/json
{
  • "operation_id": "environments:delete-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Deleting environment in progress",
  • "status": 202
}

Change PHP allocation settings for a premium staging environment

SecuritybearerAuth
Request
path Parameters
env_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
required
worker_number
required
number
worker_memory
required
number
Responses
202

Environment PHP allocation change action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while changing PHP allocation settings

post/sites/environments/{env_id}/change-environment-php-allocation
Request samples
application/json
{
  • "worker_number": 2,
  • "worker_memory": 256
}
Response samples
application/json
{
  • "operation_id": "environments:change-environment-php-allocation-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Environment PHP allocation change in progress",
  • "status": 202
}

Change PHP allocation settings for a site's live and standard staging environments

SecuritybearerAuth
Request
path Parameters
site_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
required
worker_number
required
number
worker_memory
required
number
Responses
202

Site PHP allocation change action started. Check MyKinsta for status

400

One or more of the required parameters were not provided to the request

401

No or invalid API key provided to the request

500

Error occurred while changing PHP allocation settings

post/sites/{site_id}/change-site-php-allocation
Request samples
application/json
{
  • "worker_number": 2,
  • "worker_memory": 256
}
Response samples
application/json
{
  • "operation_id": "sites:change-site-php-allocation-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Site PHP allocation change in progress",
  • "status": 202
}