API documentation Web hosting accessible to everyone Visit LWS

Delete a record from the DNS zone

DELETE https://api.lws.net/v1/domain/{domain}/zdns

operationIddeleteDomainZdns

Delete a specific DNS record from the domain's DNS zone

Path parameters

domain string required

Domain name to delete DNS record for

Request body

  • id integer

    ID of the DNS record to delete (can be found using GET /domain/{domain}/zdns)

    Example: 234851

    required
Example request
{
  "id": 234851
}

Responses

200

DNS record deleted successfully

{
  "code": 200,
  "info": "Success: Removed record in the DNS Zone",
  "data": 234851
}
Response fields 3 Extends ApiEnvelope
  • code integer

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 200

  • info string

    Human-readable message describing the result of the request

    Example: Success: Removed record in the DNS Zone

  • data integer

    ID of the deleted record

    Example: 234851

201

DNS Record already deleted / not found

{
  "code": 201,
  "info": "The record 234851 does not exist or has already been deleted",
  "data": 234851
}
Response fields 3 Extends ApiEnvelope
  • code integer

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 201

  • info string

    Human-readable message describing the result of the request

    Example: The record 234851 does not exist or has already been deleted

  • data integer

    Example: 234851

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 Extends ApiEnvelope
  • code integer

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 314

  • info string

    Human-readable message describing the result of the request

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

400

Bad request - invalid input

{
  "code": 400,
  "info": "Invalid input: No ID provided. Example: 234851"
}
Response fields 2 Extends ApiEnvelope
  • code integer

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 400

  • info string

    Human-readable message describing the result of the request

    Example: Invalid input: No ID provided. Example: 234851

404

DNS record not found

{
  "code": 404,
  "info": "Could not remove record from the DNS Zone",
  "data": 234851
}
Response fields 3 Extends ApiEnvelope
  • code integer

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 404

  • info string

    Human-readable message describing the result of the request

    Example: Could not remove record from the DNS Zone

  • data integer

    Example: 234851

500

Internal Server Error

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

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 500

  • info string

    Human-readable message describing the result of the request

    Example: Internal Server Error

  • data string

    Error message

502

Bad Gateway

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

    Application-level status/error code (not always equal to the HTTP status code)

    Example: 502

  • info string

    Human-readable message describing the result of the request

    Example: Invalid response from upstream server

  • data object

    Invalid response returned by the server

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.

Show the code examples and the test console
DELETE /domain/{domain}/zdns
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X DELETE \  "https://api.lws.net/v1/domain/{domain}/zdns" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"id":234851}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/domain/{domain}/zdns");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");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, '{"id":234851}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.delete(    "https://api.lws.net/v1/domain/{domain}/zdns",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"id": 234851},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/domain/{domain}/zdns", {  method: "DELETE",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"id":234851}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"id":234851}`)req, _ := http.NewRequest("DELETE",    "https://api.lws.net/v1/domain/{domain}/zdns", 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)