Skip to main content
Version: v1

Enable CDN for Domain

Method to enable CDN for a domain

info

When enabling CDN for a delegated domain, a Let's Encrypt certificate will be automatically generated. To use your own custom certificate for the domain, please use the certificate upload method.

info

A background task will be created upon successful request. You can track the task progress using the Tasks API.

Request Parameters

POST /api/clients/v1/domains/{id}/enableCdn/

Path

ParameterTypeConstraintsDescriptionExample
idinteger> 0, requiredDomain ID1

Response Parameters

JSON body

ParameterTypeDescription
task_idstringTask ID

Examples

200 OK

Task ID for enabling CDN for the domain. The task result and created domain ID are contained in the task object.

{
"task_id": "bb4dcd80-01a5-4a73-8c2b-62c5027a9b72"
}
400 Bad Request

CDN is already enabled for this domain

[
"CDN for this domain is already enabled"
]
401 Unauthorized

Authentication credentials missing or invalid

{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden

CDN can only be enabled for domains in your own project

{
"detail": "Only project participants can enable CDN for domain"
}
404 Not Found

Domain with this ID not found

{
"detail": "Not found"
}