Death LegionHosting
      Home
    • PricingLocationsStatusSupport
    LoginClient area

    The Death Legion API.

    Automate your infrastructure: list services, read usage, watch status, and pull invoices over an authenticated REST API.

    On this page

    • Overview
    • Authentication
    • Rate limits
    • List services
    • Service detail
    • Infrastructure status
    • Invoices
    • Webhooks
    • Error codes

    Overview

    The Death Legion Hosting API is a REST-style JSON API. Every endpoint described here is live on our platform and used by our own dashboard, no vaporware endpoints.

    Base URLtext
    https://deathlegion.host/api/v1

    Sandbox note

    In this sandbox preview the public site is served through a gateway, so call the API with relative paths from your own tooling (for example /api/v1/status) once your application is hosted with us. In production, prefix the paths with the base URL above.

    Authentication

    API requests are authenticated with Bearer keys. Create a key from Dashboard, Settings, API Keys. Keys are prefixed with dlh_, shown once at creation, and can be revoked at any time. Permission scopes are assigned per key.

    Authorization headerhttp
    Authorization: Bearer dlh_live_9f2k41mQ7xWqZtP4vN8sJhRd

    Rate limits

    Each API key may issue 60 requests per minute. When you exceed the limit, the API responds with HTTP 429 and a Retry-After header in seconds. Back off and retry, repeated hammering can get a key temporarily blocked.

    429 responsejson
    {
      "ok": false,
      "error": "Rate limit exceeded. 60 requests per minute per API key."
    }

    Endpoints

    Four GET routes cover services, usage, status, and invoices.
    GET/api/v1/services

    Lists every service on your account, VPS, Node.js apps, game servers, websites, and databases, with status, plan, location, and the next renewal date.

    Requestbash
    curl -H "Authorization: Bearer dlh_live_…" \
      https://deathlegion.host/api/v1/services
    200 Responsejson
    {
      "ok": true,
      "data": [
        {
          "id": "svc_9f2k",
          "type": "vps",
          "label": "Developer VPS — dilshan-dev",
          "status": "active",
          "plan": "Developer VPS",
          "location": "sgp",
          "primaryIp": "139.99.71.5",
          "nextRenewalAt": "2026-12-18T00:00:00.000Z"
        }
      ]
    }
    GET/api/v1/services/{id}

    Returns a single service in full detail, including live resource usage. Use the id from the services list.

    Requestbash
    curl -H "Authorization: Bearer dlh_live_…" \
      https://deathlegion.host/api/v1/services/svc_9f2k
    200 Responsejson
    {
      "ok": true,
      "data": {
        "id": "svc_9f2k",
        "type": "nodejs",
        "label": "Node.js — pixelforge-api",
        "status": "active",
        "plan": "App Pro",
        "location": "sgp",
        "usage": {
          "cpuPct": 18,
          "ramUsedMb": 742,
          "ramTotalMb": 2048,
          "diskUsedMb": 3120,
          "diskTotalMb": 20480,
          "bandwidthUsedGb": 142
        }
      }
    }
    GET/api/v1/status

    Public infrastructure status: active locations and every registered server node with its current state. This endpoint needs no authentication, so you can wire it into your own status boards. The public status page renders the same data.

    Requestbash
    curl https://deathlegion.host/api/v1/status
    200 Responsejson
    {
      "ok": true,
      "data": {
        "locations": [
          { "slug": "sgp", "city": "Singapore",
            "country": "Singapore", "status": "active" }
        ],
        "nodes": [
          { "name": "dlg-sgp-01",
            "location": "Singapore, Singapore",
            "purpose": "mixed", "status": "active" }
        ]
      }
    }
    GET/api/v1/billing/invoices

    Lists your invoices with status, totals, and dates. Amounts are returned in your account currency.

    Requestbash
    curl -H "Authorization: Bearer dlh_live_…" \
      https://deathlegion.host/api/v1/billing/invoices
    200 Responsejson
    {
      "ok": true,
      "data": [
        {
          "invoiceNumber": "INV-202611-4821",
          "status": "paid",
          "total": 1290,
          "currency": "LKR",
          "dueDate": "2026-11-21",
          "paidAt": "2026-11-19"
        }
      ]
    }

    Webhooks

    We can call your webhook URL when service-level events happen, for example when a service is provisioned or suspended. Configure endpoint URLs from Dashboard, Settings, Webhooks.

    Every delivery is signed with an HMAC-SHA256 signature in the X-DLH-Signature header, computed over the raw request body with your webhook secret. Verify the signature before trusting a payload.

    Payload, service.provisionedjson
    {
      "id": "evt_7a41c9",
      "type": "service.provisioned",
      "createdAt": "2026-11-24T10:14:02.000Z",
      "data": {
        "serviceId": "svc_9f2k",
        "type": "vps",
        "label": "Developer VPS — dilshan-dev",
        "plan": "Developer VPS",
        "location": "sgp"
      }
    }
    Verify the signature (Node.js)js
    import { createHmac, timingSafeEqual } from "node:crypto";
    
    const expected = createHmac("sha256", process.env.DLH_WEBHOOK_SECRET)
      .update(rawBody)
      .digest("hex");
    
    const ok = timingSafeEqual(
      Buffer.from(expected),
      Buffer.from(req.headers["x-dlh-signature"])
    );

    Error codes

    Errors always return ok: false with a human-readable error message.

    CodeMeaning
    401Missing or invalid API key, check your Bearer token.
    403The key lacks the required permission scope for this endpoint.
    404Resource not found, verify the service or invoice identifier.
    429Rate limit exceeded, 60 requests per minute per key. Retry after the delay.
    500Unexpected server error, safe to retry. Contact support if it persists.

    Ready to automate?

    Create an API key from your dashboard settings and start with the status endpoint, it is public and needs no key.

    Death LegionHosting

    Power Your Project. Host Without Limits. Hosting priced in rupees, run on hardware we own and rack ourselves.

    support@deathlegion.host

    +94 11 234 5678

    WhatsApp +94 76 055 0199

    Colombo, Sri Lanka

    Products

    • VPS hosting
    • Node.js hosting
    • Game hosting
    • Web hosting
    • Dedicated servers
    • Database hosting

    Resources

    • Documentation
    • Knowledge base
    • Guides
    • API reference
    • Server status
    • Locations

    Support

    • Open a ticket
    • My tickets
    • Contact us
    • Free migration
    • Why Death Legion
    • Affiliates
    • About us
    • Create account

    Legal

    • Terms of service
    • Privacy policy
    • Refund policy
    • Acceptable use

    © 2026 Death Legion Hosting (Pvt) Ltd, Colombo

    Infrastructure on company-owned hardware, racked and operated by our own team

    WhatsApp +94 76 055 0199