Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.envless.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Envelope

Every response — success or error — uses the same shape:
{
    "success": false,
    "code": 404,
    "message": "Project not found",
    "data": null
}
FieldMeaning
successtrue for 2xx, false otherwise.
codeMirrors the HTTP status code.
messageHuman-readable description — safe to log, not always safe to show to end users.
dataResource payload on success, null on error.

The HTTP status and the envelope code always agree. Branch on either.

Status codes

StatusMeaningWhen you’ll see it
200OKSuccessful read.
400Bad RequestInvalid query parameters (e.g. limit=99999).
401UnauthorizedMissing, malformed, or revoked API key.
404Not FoundResource doesn’t exist, or your key can’t see it.
500Internal Server ErrorUnexpected — retry with backoff, then check status.envless.cloud.

404 vs 403

The API returns 404 — not 403 — when a resource exists but your key can’t see it. This avoids leaking the existence of projects, environments, or variables across workspaces.

If you’re sure the resource exists and your key should reach it, double-check the workspace association in the dashboard.

Handling errors

const res = await fetch('https://api.envless.cloud/projects/my-app', {
    headers: { Authorization: `Bearer ${token}` },
});
const body = await res.json();

if (!body.success) {
    switch (body.code) {
        case 401: throw new Error('Bad key — rotate it.');
        case 404: throw new Error('Project not found.');
        default:  throw new Error(`Envless: ${body.message}`);
    }
}

Request IDs

Every response includes a _req field with the request ID and server-side timing:

{
    "success": true,
    "code": 200,
    "data": { /* ... */ },
    "_req": { "reqId": "req_8h2k...", "resTime": 14 }
}

Include reqId when you contact support — it points us at the exact request in our logs.