Toggle HTTPS redirect
Turns the HTTP to HTTPS redirect of the website on or off, based on isenabled.
Turns the HTTP to HTTPS redirect of the website on or off, based on is_enabled. Does
nothing when the redirect is already in the requested state. Turning it on requires an
installed certificate (status active or expired on Get SSL status) and returns 422
when there is none; turning it off is always accepted.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
usernamestringRequiredExample:
u123456789domainstringRequiredExample:
Domain name
mydomain.tldBody
is_enabledbooleanRequiredExample:
Turn the HTTP to HTTPS redirect on (true) or off (false) for the website.
trueResponses
200
Success empty response
application/json
messagestringOptionalExample:
Request accepted401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
patch/api/hosting/v1/accounts/{username}/websites/{domain}/ssl/https-redirect/toggle
PATCH /api/hosting/v1/accounts/{username}/websites/{domain}/ssl/https-redirect/toggle HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"is_enabled": true
}{
"message": "Request accepted"
}Last updated
Was this helpful?