For the complete documentation index, see llms.txt. This page is also available as Markdown.

Toggle HTTPS redirect

Turns the HTTP to HTTPS redirect of the website on or off, based on isenabled.

Toggle HTTPS redirect

patch

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: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Body
is_enabledbooleanRequired

Turn the HTTP to HTTPS redirect on (true) or off (false) for the website.

Example: true
Responses
200

Success empty response

application/json
messagestringOptionalExample: Request accepted
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?