Skip to content

Create document

POST
/v2/document

Create a new document

X-API-Key
string

API Key

X-API-Secret
string

API Secret

object
refId

Provide a reference Id if you need to query this document by an external identifier linked to a consuming API or system. This property has been deprecated with the release of the Metadata service which can be used to store additional information about the document.

string
b7e6a1c2-3f4d-4e2a-9c1a-2b3c4d5e6f7a
docExt
required

The MIME type of the document (e.g., application/pdf, image/jpeg)

string
application/pdf
docName
required

The Document Name for display purposes

string
Invoice Q1 2024
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
uploadBatchId

Unique identifier to identify the batch process for a group of documents.

string
77a0049c-7683-45ff-956f-656f257048f7
isPublic

It sets the visibility of the document and its data so unauthenticated users can view it

boolean
source
required

Origin of the document upload, used to identify which system or service the document was uploaded from

string
PAYMENTS
templateId

The template id from your template library (see your templates in /document/template)

string
d2c3b4a1-4e2a-9c1a-2b3c-4d5e6f7a8b9c
groupId

The group id to add the document to (see your groups in /document/group)

string
e3f4d5c6-7a8b-4e2a-9c1a-2b3c4d5e6f7a
prompts

A prompt array of strings

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
[
{
"id": "77a0049c-7683-45ff-956f-656f257048f7",
"name": "Total",
"fieldType": "number",
"format": "currency",
"description": "The total amount of the document"
}
]
bulkDocumentId

This is deprecated, due to the change from bulk upload processing to asynchronous processing.

string
c1a2b3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
ocrProvider

The Ocr Provider used to extract data from the document

string
default: GOOGLE_DOCUMENT_AI
Allowed values: TEXTRACT REKOGNITION GOOGLE_DOCUMENT_AI
GOOGLE_DOCUMENT_AI
providerModelId

The LLM model used to extract data from the document, this will replace the default model from the template

string
77a0049c-7683-45ff-956f-656f257048f7

Document created successfully.

object
id
required

A document Id

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

A reference Id

string
b7e6a1c2-3f4d-4e2a-9c1a-2b3c4d5e6f7a
docExt
required

A document extension

string
application/pdf
docName
required

A document name

string
Invoice.pdf
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
downloadUrl
required

The download url of the document

string
https://fsco.io/document/download/123
uploadBatchId

An upload batch Id, this is used for group conversation

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

Set the visibility of the document and its data

boolean
source

The origin of the document upload

string
groupId

The group id to add the document to

string
e3f4d5c6-7a8b-4e2a-9c1a-2b3c4d5e6f7a
prompts

A prompt array

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
[
{
"id": "1",
"name": "Total",
"fieldType": "string",
"itemType": "currency",
"format": "keep the currency symbol if present",
"description": "The total amount of the document"
}
]
providerModelId
required

The provider model id

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

This is deprecated, the webhook id to send the document to

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

The Ocr Provider used to extract data from the document

string
default: GOOGLE_DOCUMENT_AI
Allowed values: TEXTRACT REKOGNITION GOOGLE_DOCUMENT_AI
GOOGLE_DOCUMENT_AI
status

The status of the document

string
created
bulkDocumentId

This is deprecated, the bulk document id to add the document to

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

OCR data extracted from the document

object

Bad Request

Unauthorized

Forbidden

Not Found

Internal Server Error