Skip to main content
The Fieldnode API returns failures as JSON with a stable shape across every endpoint. The HTTP status is set from the error code.

Error JSON format

Typical error response:
{
  "defined": false,
  "code": "NOT_FOUND",
  "status": 404,
  "message": "part not found"
}
When a procedure declares typed error data, the payload is included under data:
{
  "defined": true,
  "code": "PRECONDITION_FAILED",
  "status": 412,
  "message": "part is published",
  "data": { "partId": "01J..." }
}

Fields

  • code — Machine-readable error code in SCREAMING_SNAKE_CASE (see table below).
  • status — HTTP status code, also reflected on the response itself.
  • message — Human-readable description of the failure.
  • definedtrue when the error was declared on the procedure contract (so data is typed); false for generic/uncaught errors.
  • data — Optional, procedure-specific payload. Only present for defined: true errors that declare a data schema.

HTTP status and error code mapping

CodeHTTP statusDescription
BAD_REQUEST400Request is malformed or fails input validation.
UNAUTHORIZED401Request is missing valid authentication credentials (PAT).
FORBIDDEN403Caller is authenticated but not allowed to perform the operation.
NOT_FOUND404Requested resource was not found.
METHOD_NOT_SUPPORTED405HTTP method is not supported for this route.
NOT_ACCEPTABLE406Server cannot produce a response matching the Accept header.
TIMEOUT408The server timed out waiting for the request.
CONFLICT409Request conflicts with current resource state.
PRECONDITION_FAILED412Operation preconditions are not met.
PAYLOAD_TOO_LARGE413Request body exceeds the allowed size.
UNSUPPORTED_MEDIA_TYPE415Request Content-Type is not supported.
UNPROCESSABLE_CONTENT422Request is well-formed but semantically invalid.
TOO_MANY_REQUESTS429Rate limit or quota exceeded.
CLIENT_CLOSED_REQUEST499Client closed the connection before the response completed.
INTERNAL_SERVER_ERROR500Unexpected server error.
NOT_IMPLEMENTED501Operation is not implemented.
BAD_GATEWAY502An upstream dependency returned an invalid response.
SERVICE_UNAVAILABLE503Service is temporarily unavailable; retries may succeed.
GATEWAY_TIMEOUT504An upstream dependency timed out.

Notes

  • Use code for programmatic behavior (retry, prompt login, user messaging); the HTTP status mirrors it.
  • Treat message as informational — do not parse it for control flow.
  • Only inspect data when defined is true; for undeclared failures the field is absent.
  • Input validation failures (Zod) surface as BAD_REQUEST with details about the offending fields in data.
  • 499 (CLIENT_CLOSED_REQUEST) is not part of the standard HTTP status registry but is the conventional code for client-aborted requests.