HungerBridge uses a consistent JSON envelope for every response it sends — whether the request succeeded or failed. Understanding this shape makes it straightforward to handle errors programmatically: checkDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerBridge/llms.txt
Use this file to discover all available pages before exploring further.
ok, branch on error, and surface message to logs or end users as needed.
Response Envelope
Every response from HungerBridge is a JSON object. Successful responses always set"ok": true and include endpoint-specific fields alongside it. Error responses always set "ok": false and include an error code string and a human-readable message.
Success shape
Error shape
Error response fields
Always
false for error responses.A machine-readable error code string. One of:
unauthorized, method_not_allowed, bad_request, forbidden. Use this field for programmatic branching — the message field may change but error codes are stable.A human-readable description of what went wrong. Useful for logging and debugging. See each error section below for the exact strings the server returns.
Error Reference
403 — Forbidden
Returned when the targeted endpoint has been disabled inconfig.yaml. The disabled check runs first in every handler — before the method check and before the auth check. Authentication is never evaluated when an endpoint is disabled.
message field identifies which endpoint is disabled:
- v2 endpoints
- v1 endpoints
- Legacy endpoints
config.yaml under the relevant section (v2-endpoints, v1-endpoints, or legacy-endpoints) and restart the server.
All v2 endpoints are enabled by default. v1 and legacy endpoints are disabled by default and must be explicitly enabled in
config.yaml.405 — Method Not Allowed
Returned when the correct endpoint is called with the wrong HTTP method. Each endpoint accepts exactly one method —GET or POST. The message field tells you which method to use.
- Should be POST
- Should be GET
Returned by write endpoints (
/v2/run, /v2/log, /v1/run, /v1/log, /run, /log) when called with any method other than POST:401 — Unauthorized
Returned when theX-Auth-Key request header is missing or does not match the key in config.yaml. This check runs after the disabled check and the method check, but before any request body is processed.
X-Auth-Key header on every request. See Authentication for details.
GET /v1/status and GET /v1/version do not perform an auth check. Those two endpoints respond without a key as long as they are enabled.400 — Bad Request
Returned when the request body is malformed, empty when content is required, or is missing a required JSON field. Themessage field identifies the exact problem.
- Missing command
- Missing message
- Empty body (legacy)
Returned by
/v2/run and /v1/run when the JSON body is absent or does not contain a command field:Quick Reference
| HTTP Status | error field | Cause |
|---|---|---|
400 | bad_request | Missing or empty required request field |
401 | unauthorized | Missing or incorrect X-Auth-Key header |
403 | forbidden | Endpoint disabled in config.yaml |
405 | method_not_allowed | Wrong HTTP method (use GET or POST as indicated) |