WordPress CDN

Kinsta's premium CDN powered by Cloudflare helps to maximize the performance of your site. With the cdn endpoint you can:

You can obtain the environment_id 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

You can obtain the cdn_cache_id using the GET request with the WordPress Site Environments endpoint.

The CDN endpoints may trigger longer tasks (from a few seconds to around a minute) on your environments. This is why they provide 202 Accepted response, with an operation_id in the body. To check the progress, you can use the /operations endpoint.

Clear Site CDN Cache

SecuritybearerAuth
Request
Request Body schema: application/json
required
environment_id
required
string
cdn_cache_id
required
string
Responses
202

Clearing site CDN cache in progress

401

No or invalid API key provided to the request

500

Error occurred while trying to clear cache

post/sites/cdn/clear-cache
Request samples
application/json
{
  • "environment_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "cdn_cache_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
Response samples
application/json
{
  • "operation_id": "cdn-cache:clear-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Clearing site CDN cache in progress",
  • "status": 202
}

Update CDN Image Optimization

SecuritybearerAuth
Request
Request Body schema: application/json
required
environment_id
required
string <uuid>
image_optimization_type
required
string
Enum: "off" "lossy" "lossless"
Responses
202

Updating Site Image Optimization in progress

401

No or invalid API key provided to the request

500

Error occurred while updating CDN Image Optimization

put/sites/cdn/image-optimization
Request samples
application/json
{
  • "environment_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "image_optimization_type": "lossy"
}
Response samples
application/json
{
  • "operation_id": "cdn:update-image-optimization-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
  • "message": "Updating Site Image Optimization in progress",
  • "status": 202
}
OSZAR »