Free plan

Validate Data

Check a data file against rules and list what is wrong
POST
/v1/data/validate

About this tool

This tool checks every row of a table against a set of rules, written as a JSON Schema (a standard way to describe what valid data looks like). It lists the problems: which row, which field and which rule failed. Your file is never changed. It does not fetch anything from the internet.
For example, you check a spreadsheet for empty required fields before importing it into a system.

How to use it

  1. Choose this tool.
  2. Add your data file with Upload or drag and drop.
  3. Paste your rules (the schema) into the rules box.
  4. Choose whether to check each row or the whole file, then press Generate.
  5. Read or download the list of problems.

What you get back

You get a list of every problem found, with its row, field and rule. Download it.
GOOD TO KNOW
Answers 200 with valid=false when the data does not match; 400 only when the request itself is wrong.
TEST IT LIVE

Try Validate Data in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Data
Plan
Free
Method
POST
Endpoint
/v1/data/validate
Tool ID
data.validate
Authentication
API key
Accepts
XLSX, ODS, MD, HTML, XLS, CSV +9 more
Background jobs
Yes
Usage group
Data
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/data/validate" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'schema=example' \
  -F 'target=auto' \
  -F 'sheet=example'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.validate({
    "file": 'document.pdf',
    "schema": "example",
    "target": "auto",
    "sheet": "example"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->validate([
    'file' => 'document.pdf',
    'schema' => 'example',
    'target' => 'auto',
    'sheet' => 'example',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Check every row of a table (or the whole document) against a JSON Schema and list what is wrong: which row, which field, which rule. The file is never changed. Only local $ref references are followed; nothing is fetched.

Validate Data accepts XLSX, ODS, MD, HTML, XLS, CSV, JSON, XML, TSV, NDJSON, YAML, TOML and 3 more. You can send several files in one request.

Validate Data is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/data/validate with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.