WordPress Site Domains

With the domains endpoint, you can:

You can obtain the environment_id and domain_ids using the GET request with the WordPress Site Environments endpoint.

The environment_id is also shown after the site_id 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

Add new site domain

SecuritybearerAuth
Request
path Parameters
env_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
domain_name
required
string
is_wildcardless
boolean
Default: false
custom_ssl_key
string
custom_ssl_cert
string
Responses
202

Site domain 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 adding a site domain

post/sites/environments/{env_id}/domains
Request samples
application/json
{
  • "domain_name": "string",
  • "is_wildcardless": false,
  • "custom_ssl_key": "string",
  • "custom_ssl_cert": "string"
}
Response samples
application/json
{
  • "operation_id": "sites:add-domain-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Adding site domain in progress",
  • "status": 202
}

Delete one or more site domains

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

Site domain deletion 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 site domains

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

Get list of site domains for the environment

SecuritybearerAuth
Request
path Parameters
env_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Responses
200

Response object of site domains requests

401

No or invalid API key provided to the request

404

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

500

Error occurred while retrieving site domains

get/sites/environments/{env_id}/domains
Request samples
Response samples
application/json
{
  • "environment": {
    }
}

Get list of verification and pointing records for the site domain

SecuritybearerAuth
Request
path Parameters
site_domain_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Responses
200

Response object of verification and pointing records requests

401

No or invalid API key provided to the request

404

Could not find the verification and pointing records or the user does not have permissions to retrieve data

500

Error occurred while retrieving verification and pointing records

get/sites/environments/domains/{site_domain_id}/verification-records
Request samples
Response samples
application/json
{
  • "site_domain": {
    }
}

Change primary domain of an environment

SecuritybearerAuth
Request
path Parameters
env_id
required
string <uuid>
Example: 54fb80af-576c-4fdc-ba4f-b596c83f15a1
Request Body schema: application/json
domain_id
required
string
run_search_and_replace
required
boolean
Default: false
Responses
202

Changing primary domain 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 primary domain

put/sites/environments/{env_id}/change-primary-domain
Request samples
application/json
{
  • "domain_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "run_search_and_replace": true
}
Response samples
application/json
{
  • "operation_id": "sites:change-primary-domain-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Changing primary site domain in progress",
  • "status": 202
}