Skip to content

API

Tokens#

Create tokens in Settings › API tokens. A token acts as you in one workspace, limited to the scopes you choose, and stops working if you leave the workspace. It is shown once; HostEdge stores only a hash. Send it as a bearer token:

curl -H "Authorization: Bearer $HOSTEDGE_TOKEN" https://hostedge.app/api/v1/me
ScopeAllows
projects:readList and read projects and deployments
projects:writeCreate and change projects
deployments:writeUpload files and create deployments
logs:readRead runtime logs
env:readPull environment variables
env:writeChange environment variables

Members, billing, tokens, webhooks and deleting things are never available to tokens. They need a signed-in person.

Endpoints#

The full description is at /api/v1/openapi.json (OpenAPI 3.1), for generating a client:

npx openapi-typescript https://hostedge.app/api/v1/openapi.json -o hostedge-api.d.ts
Method and pathPurpose
GET /api/v1/meThe person, workspace and scopes of the token
GET /api/v1/projectsProjects in the token's workspace
POST /api/v1/projectsCreate a project (name, settings)
GET /api/v1/projects/:id/deploymentsDeployments, newest first
POST /api/v1/uploadsWhich of these content hashes still need uploading (hashes)
PUT /api/v1/uploads/:hashUpload one file's bytes
POST /api/v1/uploads/batchUpload many small files at once (multipart, each field named by its hash)
POST /api/v1/deploymentsCreate a deployment from uploaded files (files, projectId or project)
GET /api/v1/deployments/:id/eventsBuild log and status as Server-Sent Events
GET /api/v1/deployments/:id/explainWhy a deployment failed, with fixes and a prompt for an AI assistant
GET /api/v1/projects/:id/logsRuntime logs (level, q, range, before)
GET /api/v1/projects/:id/envVariables for an environment (format=dotenv for a file)

Explaining a failed deployment#

GET /api/v1/deployments/:id/explain turns the failure reason and the last 300 lines of the build log into a diagnosis, without calling an AI model. It needs the projects:read scope and works for failed, canceled, held and rejected deployments; for a running or successful one it answers { "applicable": false, "reason": "in_progress" | "succeeded" }.

{
  "applicable": true,
  "deploymentId": "dep_…",
  "status": "failed",
  "reviewStatus": "none",
  "explanation": {
    "category": "missing-module",
    "ruleId": "module-not-found",
    "title": "Package “date-fns” couldn’t be found",
    "summary": "…",
    "likelyCause": "…",
    "fixes": ["Run `npm install date-fns` …"],
    "settingsToCheck": [{ "field": "Root directory", "suggestion": "…" }],
    "docsPath": "/docs/frameworks",
    "confidence": "high",
    "assistantPrompt": "A deployment of my project on HostEdge …"
  }
}

assistantPrompt is ready to paste into an AI assistant. It contains the framework, settings, diagnosis and at most 40 log lines, with tokens, bearer headers and KEY=value secrets removed. Explanations are rate limited to 120 requests a minute per workspace.

Errors are JSON: { "error": { "code": "forbidden", "message": "…" } }. Tokens are rate limited to 600 requests a minute.

View this page as MarkdownAll docs as one file