Skip to main content
The TraxServer v5 API uses two distinct error mechanisms depending on the nature of the failure.

HTTP Status Codes

Errors at the transport or authentication layer return a non-2xx HTTP status code:

HTTP Error Response

Non-2xx responses return a simple JSON object:

Business Logic Errors (HTTP 200)

Validation and business rule failures return HTTP 200 with a result of "FAILURE" in the response body. Always check the result field: a 200 does not guarantee success.

Response Schema

string
"SUCCESS" or "FAILURE"
number | null
The ID of the created or updated resource, if applicable
object | null
Additional data returned by the operation
object | null
Present when result is "FAILURE" (see below)

Error Object Schema

object
Map of field name to error. Each value has type and errorMessage.
array
List of errors not tied to a specific field. Each item has type and errorMessage.

Error Types

Example: Field Validation Failure

Example: Global Error

Recommendations

  • Always check the result field on 200 responses before treating an operation as successful.
  • Use fieldErrors to surface inline validation messages to users.
  • Use globalErrors for form-level or operation-level error banners.
  • Log the full error response for troubleshooting: type is machine-readable and suitable for programmatic handling.