The Death Legion API.
Automate your infrastructure: list services, read usage, watch status, and pull invoices over an authenticated REST API.
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.
https://deathlegion.host/api/v1Sandbox 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: Bearer dlh_live_9f2k41mQ7xWqZtP4vN8sJhRdRate 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.
{
"ok": false,
"error": "Rate limit exceeded. 60 requests per minute per API key."
}Endpoints
/api/v1/servicesLists every service on your account, VPS, Node.js apps, game servers, websites, and databases, with status, plan, location, and the next renewal date.
curl -H "Authorization: Bearer dlh_live_…" \
https://deathlegion.host/api/v1/services{
"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"
}
]
}/api/v1/services/{id}Returns a single service in full detail, including live resource usage. Use the id from the services list.
curl -H "Authorization: Bearer dlh_live_…" \
https://deathlegion.host/api/v1/services/svc_9f2k{
"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
}
}
}/api/v1/statusPublic 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.
curl https://deathlegion.host/api/v1/status{
"ok": true,
"data": {
"locations": [
{ "slug": "sgp", "city": "Singapore",
"country": "Singapore", "status": "active" }
],
"nodes": [
{ "name": "dlg-sgp-01",
"location": "Singapore, Singapore",
"purpose": "mixed", "status": "active" }
]
}
}/api/v1/billing/invoicesLists your invoices with status, totals, and dates. Amounts are returned in your account currency.
curl -H "Authorization: Bearer dlh_live_…" \
https://deathlegion.host/api/v1/billing/invoices{
"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.
{
"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"
}
}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.
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key, check your Bearer token. |
| 403 | The key lacks the required permission scope for this endpoint. |
| 404 | Resource not found, verify the service or invoice identifier. |
| 429 | Rate limit exceeded, 60 requests per minute per key. Retry after the delay. |
| 500 | Unexpected server error, safe to retry. Contact support if it persists. |