API documentation Web hosting accessible to everyone Visit LWS

Renew a hosting and its domain

Deferred Paid action

POST https://api.lws.net/v1/hosting/{hosting}/renew

operationIdpostHostingRenew

Renew the hosting and domain for another period. Will only renew the hosting if the domain has not been bought at LWS. Make sure to use the GET /hosting/{hosting}/pricerenew endpoint to get the price of the renewal.

This request is processed in the background: it answers immediately while the work continues. Follow it with the task or request endpoints.

This is a paid action. Your prepaid account will be debited.

Path parameters

hosting string required

The domain name you want to renew

Example: example.com

Responses

200

Renewal request received

{
  "code": 200,
  "info": "Your domain/hosting renewal request has been taken into account",
  "data": {
    "price": 4.99
  }
}
Response fields 3
  • code integer

    Example: 200

  • info string

    Example: Your domain/hosting renewal request has been taken into account

  • data object

    Price of the renewal

    Example: {"price":4.99}

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 hosting provided",
  "data": []
}
Response fields 3
  • code integer

    Example: 400

  • info string

    Example: No hosting provided

  • 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
POST /hosting/{hosting}/renew
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X POST \  "https://api.lws.net/v1/hosting/example.com/renew" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS"
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting/example.com/renew");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,]);$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.post(    "https://api.lws.net/v1/hosting/example.com/renew",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting/example.com/renew", {  method: "POST",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,  },});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"req, _ := http.NewRequest("POST",    "https://api.lws.net/v1/hosting/example.com/renew", nil)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)resp, err := http.DefaultClient.Do(req)