# Enable or disable secure redirects

This function enables or disables secure redirects (HTTPS) for the cPanel account's domains that you specify.

Important:

To call this function, one of the following conditions must exist:

* AutoSSL must exist on the domains for which you enable secure redirects.
* A valid SSL certificate must exist for each domain for which you wish to enable secure redirects.
* You must own the domains for which you wish to enable secure redirects.

Endpoint: GET /SSL/toggle_ssl_redirect_for_domains
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `domains` (string, required)
    A comma-separated list of the cPanel account's domains for which to enable or disable secure redirects.

Important:

To enable or disable redirects for addon domains, you must pass the addon domain and its subdomain.
    Example: "main.example,addon.example,addon.main.example"

  - `state` (integer, required)
    Whether to enable or disable redirects for the specified domains.

* 1 — Enable.
* 0 — Disable.
    Enum: 0, 1

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "toggle_ssl_redirect_for_domains"

  - `module` (string)
    The name of the module called.
    Example: "SSL"

  - `result` (object)

  - `result.data` (array)
    The domains for which the function enabled or disabled secure redirects.
    Example: ["main.example","addon.example","addon.main.example"]

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    - 1 - Success
- 0 - Failed: Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


