← All docs

Start

Quickstart

Send one document and read typed JSON back. You need a key, a file and a schema.

Tolva has one endpoint. You send a file and a JSON Schema that names the fields you want; you get the values back, typed to that schema, with a confidence on each one.

1. Keep the key out of your code

Create a key in the dashboard and store it in an environment variable. Every example on this site reads it from $TOLVA_KEY.

2. Describe the fields

Write a JSON Schema for the document. Types are kept: a number comes back as a number, a date as an ISO 8601 string, an enum as one of its values.

3. Send the file

POST the file and the schema to /v1/extract. A document up to 20 pages is answered in the same call.

Request · curl

curl https://api.tolva.example/v1/extract \
  -H "Authorization: Bearer $TOLVA_KEY" \
  -F file=@invoice-0412.pdf \
  -F schema=@invoice.schema.json \
  -F threshold=0.9