API documentation Web hosting accessible to everyone Visit LWS

Enable or disable auto renewal

PUT https://api.lws.net/v1/hosting/{hosting}/autorenew

operationIdputHostingAutorenew

Enable or disable auto renewal for a hosting. This will affect both the hosting and domain (if applicable).

Path parameters

hosting string required

The domain name whose auto renewal settings you want to change

Example: example.com

Request body

  • enable boolean

    Whether to enable (true) or disable (false) auto renewal

    Example: true

    optional
Example request
{
  "enable": true
}

Responses

200

Auto renewal settings changed successfully

{
  "code": 200,
  "info": "Your hosting's auto-renewal settings has been changed",
  "data": true
}
Response fields 3
  • code integer

    Example: 200

  • info string

    Example: Your hosting's auto-renewal settings has been changed

  • data boolean

    New auto-renewal status. true = enabled, false = disabled

    Example: true

314

Domain not found on the account

314 is not a registered HTTP status code. It is specific to this API.

{
  "code": 314,
  "info": "Provided domain has not been found on your account. You must own this domain to manage it."
}
Response fields 2
  • code integer

    Example: 314

  • info string

    Example: Provided domain has not been found on your account. You must own this domain to manage it.

400

Invalid input

{
  "code": 400,
  "info": "No auto-renewal status provided. Example: true",
  "data": []
}
Response fields 3
  • code integer

    Example: 400

  • info string

    Example: No auto-renewal status provided. Example: true

  • data any[]
401

Unauthorized - Missing authentication headers

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Response fields 2
  • code integer

    Example: 401

  • info string

    Example: Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed.

429

Rate limit exceeded

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Response fields 2
  • code integer

    Example: 429

  • info string

    Example: Rate limit exceeded. Please try again later.

500

Internal Server Error

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Error message"
}
Response fields 3
  • code integer

    Example: 500

  • info string

    Example: Internal Server Error

  • data string

    Example: Error message

502

Bad Gateway

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Response fields 3
  • code integer

    Example: 502

  • info string

    Example: Invalid response from upstream server

  • data object
Show the code examples and the test console
PUT /hosting/{hosting}/autorenew
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X PUT \  "https://api.lws.net/v1/hosting/example.com/autorenew" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"enable":true}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting/example.com/autorenew");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,    "Content-Type: application/json",]);curl_setopt($ch, CURLOPT_POSTFIELDS, '{"enable":true}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.put(    "https://api.lws.net/v1/hosting/example.com/autorenew",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"enable": True},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting/example.com/autorenew", {  method: "PUT",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"enable":true}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"enable":true}`)req, _ := http.NewRequest("PUT",    "https://api.lws.net/v1/hosting/example.com/autorenew", body)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)req.Header.Set("Content-Type", "application/json")resp, err := http.DefaultClient.Do(req)