Skip to main content

What is a schema?

A schema in Documind defines the structure of data to be extracted from a document. Think of it as a blueprint or template that guides the extraction process to retrieve the correct information in the desired format.

What can a schema do?

Schemas are used to:
  • Define the fields to extract.
  • Specify the type of data for each field (e.g., string, number, array, enum, boolean).
  • Set the relationships between fields (e.g., nested arrays or objects).

Defining a Schema

In Documind, a schema is defined as an array of objects, each representing a field to be extracted. Each field object includes the following properties:
name
string
required
A unique identifier for the field.
description
string
required
A brief explanation of what the field represents.
type
enum
required
The type of data. Options are: string, number, array, object, enum, boolean.
values
string[]
Used when the field type is enum, to specify available options.
children
object[]
Nested fields for array or object types.

Example Schema

Here’s an example schema for a bank statement:
Bank statement schema