Validation failures (418)
The Neo FX Hub provides different response status between an API request containing an invalid body structure (400
), for example, the wrong type specified for a property, and a request with a valid structure that can't be processed due to invalid data (418
), for example, missing a required value or referencing an item that can't be found.The short rule is that a 400
response means that the request needs to be reviewed technically and a 418
means that the data of the request may need adjusting.In addition, a 418
will always include a detailed response body of what needs adjusting, while a 400
may not, as it may not be possible to know why the body is invalid.Example#
If the API endpoint is documented to receive:{
"id": "string",
"count": "number",
"items": [ "string" ]
}
The following request will give a 400
response with no body:{
"id": "abcd1234",
"count": "some",
"items": "value"
}
While the next request will give a 418
with a body:{
"id": "abcd*",
"count": 9,
"items": [ ]
}
{
"id": [
{
"error": "bad_length",
"params": {
"len": 8
}
},
{
"error": "invalid"
}
],
"count": [
{
"error": "invalid",
"params": {
"len": 1
}
}
],
"items": [
{
"error": "invalid",
"params": {
"len": 1
}
}
]
}
Endpoints should specify the possible list of error codes per field and their specific meaning. Many codes (such as "invalid") are overloaded based on scenario. Modified at 2025-07-24 14:08:00