Skip to content

Test prompts with document

POST
/v2/document/{documentId}

Test prompts with a specific document

documentId
required
string

A document Id

Example
77a0049c-7683-45ff-956f-656f257048f7
X-API-Key
string

API Key

X-API-Secret
string

API Secret

object
documentId
required

The document id to prompt against

string format: uuid
77a0049c-7683-45ff-956f-656f257048f7
prompts
required

A group of prompts or properties to be extracted or analyzed from the document

Array<object>
object
id
required

Unique identifier for the prompt. Used internally for tracking and referencing specific prompts.

string format: uuid
a1b2c3d4-5678-4e2a-9c1a-2b3c4d5e6f7a
name
required

Human-readable name for the prompt. Used for display purposes and should be descriptive of what the prompt extracts.

string
Invoice Total
fieldType
required

The data type for storing the extracted value. This determines how the value will be validated and stored in the database (e.g., string, number, float, date, boolean).

string
Allowed values: string number float date boolean
string
format

Optional formatting instructions for the extracted value. Can include transformation rules like “add # sign before all responses” or “convert to uppercase”. Leave empty if no formatting is needed.

string
Add # sign before all responses
description
required

Clear, specific instructions for the AI model on what information to extract from the document. Should be detailed enough to guide accurate extraction.

string
What is the total amount of the invoice?
itemType
required

The input/display type that determines how the field should be presented and extracted. This affects UI rendering, validation rules, and extraction behavior (e.g., single line text, email, phone, address, table).

string
Allowed values: singleLine multiLine dateTime boolean name email phone address table list currency
singleLine
children
Array<object> recursive
docType
required

The Document Type to help with categorisation and search

string
Allowed values: account_statement airway_bill applications bill_of_lading business_general business_invoice certificate_of_origin contract financial health_certificate identification insurance invoice purchase_order receipt report_proposal other
invoice
docName
required

The document name

string
Invoice Q1 2024
llmProvider

The provider of the prompt

string
Allowed values: OPENAI FSCO BEDROCK
OPENAI
llmModel

The model of the prompt

string
Allowed values: GPT_4 GPT_4_TURBO GPT_4O GPT_4O_MINI O1 O1_MINI O3_MINI LLAMA_3 CLAUDE_OPUS CLAUDE_SONNET
GPT_4
tester
required

Set the prompt as a test

boolean
true

The resource has been successfully created.

object
queryId
required

The process ID. Since this is a synchronous request, it returns only the ID. You must wait for the webhook notification to receive the actual result.

string format: uuid
77a0049c-7683-45ff-956f-656f257048f7

Bad Request

Unauthorized

Forbidden

Not Found

Internal Server Error