Get started
Errors
The gateway returns a small JSON envelope for errors it generates. Upstream errors are forwarded as-is.
Gateway envelope
Errors produced by the gateway always look like this:
json
{
"status": "error",
"message": "Invalid authentication token"
}Status codes
| Status | When | Typical message |
|---|---|---|
400 | Invalid or missing fields (usually upstream) | Validation details from the service |
401 | Missing or invalid Bearer token | Invalid authentication token |
403 | Authenticated, but not a company admin/user | API gateway is restricted to company admin and user roles |
404 | Unknown path — the gateway does not invent extra routes | Laravel not-found JSON |
502 | Upstream is unreachable | Upstream API is unreachable |
503 | Service disabled or URL not configured | Upstream API is disabled |
Upstream errors
Successful responses and most 4xx validation errors come straight from the target service: same status, same body, including binary downloads. The gateway does not rewrite those payloads.
Build clients that read status + message when present, and fall back to the raw JSON body for upstream-specific fields.