Skip to content

Validation Errors

If a request contains errors in user-provided data, a 422 response will be provided with additional information about the validation errors. These errors can be used directly in the UI to provide feedback to the user.

Here is the format of the response:

{
    "correlationUUID": "<correlation-uuid>",
    "validationErrors": {
        "key": "<validation-error-description>"
    }
}

In the validationErrors field, each key represents a field of the provided data that is invalid. For example, if this was the provided data:

{
    "surveyUUID": "abc123",
    "patientDOB": "1/13/2020"
}

The month of '13' is not valid, and so, an example of the response could look like this:

{
    "correlationUUID": "...some uuid",
    "validationErrors": {
        "patientDOB": "The specified date of birth is invalid"
    }
}