Validate JSON rows

Validate a JSON array of records with template column keys and values. Errors and corresponding OneSchema error codes are returned in the response as JSON.

For example, given the following example Contacts template:

Column keyDate typeValidations
first_nameAlphabeticalMust be mapped
last_nameAlphabeticalMust be mapped
date_of_birthDate MM/DD/YYYY
idNumberUnique

The following request would result in the provided response:

// Example request
{
  "template_key": "contacts",
  "rows": [
        { "id": 1, "last_name": "Smith" },
        { "id": 2, "first_name": "Charlie", "last_name": "Johnson9", "date_of_birth": "May 10th" },
        { "id": 3, "first_name": "Mary", "last_name": "Goel" },
        { "id": 3, "first_name": "Audrey", "last_name": "Goel" },
        { "id": 4, "first_name": "Tom", "last_name": "Jackson", "phone_number": "555-555-5555" }
    ]
}

// Example 200 response
{
    "error_rows": [
        {
            "index": 0,
            "errors": {
                "first_name": {
                    "code": 8000,
                    "message": "Template column must be mapped"
                }
            }
        },
        {
            "index": 1,
            "errors": {
                "last_name": {
                    "code": 37,
                    "message": "Must be only letters"
                },
                "date_of_birth": {
                    "code": 3,
                    "message": "Must match MM/DD/YYYY date format"
                }
            }
        },
        {
            "index": 2,
            "errors": {
                "id": {
                    "code": 1000,
                    "message": "Data is duplicate in unique column"
                }
            }
        },
        {
            "index": 3,
            "errors": {
                "id": {
                    "code": 1000,
                    "message": "Data is duplicate in unique column"
                }
            }
        },
        {
            "index": 4,
            "errors": {
                "phone_number": {
                    "code": 8001,
                    "message": "Invalid template column"
                }
            }
        }
    ]
}
Language
Credentials
Header
Click Try It! to start a request and see the response here!