API Schema
Welcome to Typless API reference!
Extract data from a document synchronously. The fields in the response are based on the document type.
The name of the file to be uploaded.
example_file.pdf
Base64 encoded file content.
JVBERi0xLjQKJcfs... (truncated for brevity)
The name of the document type based on which the extraction is performed. Result of the extraction will have fields defined in the document type.
my-document-type
Customer for which the extraction is performed. This can be used for billing purposes.
my-customer-id
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/extract-data HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 153
{
"file_name": "example_file.pdf",
"file": "JVBERi0xLjQKJcfs... (truncated for brevity)",
"document_type_name": "my-document-type",
"customer": "my-customer-id"
}
{
"object_id": "0d3d1054c2768f8360b934ebf6f9b41605e28734",
"file_name": "invoice.pdf",
"customer": null,
"adjusted_s3_url": "https://adjusted_s3_url.com/invoice_adjusted.pdf",
"extracted_fields": [
{
"name": "invoice_number",
"data_type": "STRING",
"values": [
{
"x": 358,
"y": 737,
"width": 557,
"height": 33,
"page_number": 0,
"value": "123-123",
"confidence_score": 0.95
}
],
"multiple_values": false
},
{
"name": "invoice_date",
"data_type": "DATE",
"values": [
{
"x": 2899,
"y": 737,
"width": 420,
"height": 33,
"page_number": 0,
"value": "2021-03-27",
"confidence_score": 0.92
}
],
"multiple_values": false
},
{
"name": "total_amount",
"data_type": "NUMBER",
"values": [
{
"x": 3000,
"y": 1500,
"width": 200,
"height": 30,
"page_number": 0,
"value": "1210.00",
"confidence_score": 0.99
}
],
"multiple_values": false
}
],
"line_items": [
[
{
"name": "line_item_description",
"data_type": "STRING",
"values": [
{
"x": 100,
"y": 1000,
"width": 500,
"height": 25,
"page_number": 0,
"value": "Product A",
"confidence_score": 0.88
}
]
},
{
"name": "line_item_total",
"data_type": "NUMBER",
"values": [
{
"x": 800,
"y": 1000,
"width": 100,
"height": 25,
"page_number": 0,
"value": "200.00",
"confidence_score": 0.96
}
]
}
],
[
{
"name": "line_item_description",
"data_type": "STRING",
"values": [
{
"x": 100,
"y": 1030,
"width": 500,
"height": 25,
"page_number": 0,
"value": "Service B",
"confidence_score": 0.85
}
]
},
{
"name": "line_item_total",
"data_type": "NUMBER",
"values": [
{
"x": 800,
"y": 1030,
"width": 100,
"height": 25,
"page_number": 0,
"value": "1010.00",
"confidence_score": 0.98
}
]
}
]
],
"vat_rates": [
[
{
"name": "vat_rate_percentage",
"data_type": "NUMBER",
"values": [
{
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1,
"value": "20.0",
"confidence_score": 0.9
}
]
},
{
"name": "vat_rate_net",
"data_type": "NUMBER",
"values": [
{
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1,
"value": "1000.00",
"confidence_score": 0.9
}
]
}
]
]
}
Extract data from a document asynchronously.
The name of the file to be uploaded.
example_file.pdf
Base64 encoded file content.
JVBERi0xLjQKJcfs... (truncated for brevity)
The name of the document type based on which the extraction is performed. Result of the extraction will have fields defined in the document type.
my-document-type
If true, the text blocks will be parsed and returned in the result.
false
Customer for which the extraction is performed. This can be used for billing purposes.
my-customer-id
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/extract-data-async HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 179
{
"file_name": "example_file.pdf",
"file": "JVBERi0xLjQKJcfs... (truncated for brevity)",
"document_type_name": "my-document-type",
"parse_text_blocks": false,
"customer": "my-customer-id"
}
{
"extraction_id": "1458b05b6b429f569c7c1512712d50b6e465595e"
}
Extract data from document asynchronously using a specific pretrained model.
The name of the file to be uploaded.
example_file.pdf
Base64 encoded file content. If not given, then file_url needs to be given.
JVBERi0xLjQKJcfs... (truncated for brevity)
URL of the file. Needs to be publicly accessible. If not given, then file needs to be given.
https://url-of-some-file.example.com/file.pdf
Customer for which the extraction is performed. This can be used for billing purposes.
my-customer-id
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/pretrained-models/{model_name} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 176
{
"file_name": "example_file.pdf",
"file": "JVBERi0xLjQKJcfs... (truncated for brevity)",
"file_url": "https://url-of-some-file.example.com/file.pdf",
"for_customer": "my-customer-id"
}
{
"extraction_id": "1458b05b6b429f569c7c1512712d50b6e465595e"
}
Get all documents that have been processed but haven't been polled yet.
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
GET /api/v1/awaiting-poll HTTP/1.1
Host:
Accept: */*
{
"extraction_ids": [
"1458b05b6b429f569c7c1512712d50b6e465595e"
]
}
Get extraction data for a document with the given extraction ID, if the extraction has finished.
Extraction ID of the document that was returned in the response of the async POST request.
1458b05b6b429f569c7c1512712d50b6e465595e
Whether to include text blocks in the response.
false
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
GET /api/v1/get-extraction-data?extraction_id=text HTTP/1.1
Host:
Accept: */*
{
"status": "IN_PROGRESS",
"error": null,
"result": null
}
Train all document type models with the given name.
The name of the document type for which the training should be started.
my-document-type
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/start-training HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 41
{
"document_type_name": "my-document-type"
}
{
"message": "Training started.",
"details": [
"Training started for Supplier A",
"Training started for Supplier B"
]
}
Add new document to dataset. Useful for setting up new document types with existing data.
The name of the file to be uploaded.
example_file.pdf
Base64 encoded file content.
JVBERi0xLjQKJcfs... (truncated for brevity)
The name of the document type based on which the extraction is performed. Result of the extraction will have fields defined in the document type.
my-document-type
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/add-document-async HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 499
{
"file_name": "example_file.pdf",
"file": "JVBERi0xLjQKJcfs... (truncated for brevity)",
"document_type_name": "my-document-type",
"learning_fields": [
{
"name": "invoice_number",
"value": [
{
"value": "INV-1",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": 1
}
]
}
],
"line_items": [
[
{
"name": "invoice_number",
"value": [
{
"value": "INV-1",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": 1
}
]
}
]
],
"vat_rates": [
[
{
"name": "invoice_number",
"value": [
{
"value": "INV-1",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": 1
}
]
}
]
]
}
{
"message": "Document added successfully.",
"details": "14a58b05b6b429f569c7c1512712d50b6e465595e"
}
Add output values for selected data set element for which the extraction was performed earlier.
The name of the document type to which the dataset element is added.
my-document-type
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/add-document-feedback HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 413
{
"document_type_name": "my-document-type",
"learning_fields": [
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
],
"line_items": [
[
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
]
],
"vat_rates": [
[
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
]
],
"document_object_id": "text"
}
{
"message": "Values added successfully.",
"details": "1458b05b6b429f569c7c1512712d50b6e465595e"
}
Add new document to dataset synchronously. Useful for filling up new document types with existing data.
The name of the document type to which the dataset element is added.
my-document-type
The name of the file to be uploaded.
example_file.pdf
Base64 encoded file content.
JVBERi0xLjQKJcfs... (truncated for brevity)
Successful Response
Bad request response. Check your input data.
Unauthorized. Check the URL and your authentication token.
Forbidden. Check the URL and your authentication token.
Validation Error
Internal server error
POST /api/v1/add-document HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 469
{
"document_type_name": "my-document-type",
"learning_fields": [
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
],
"line_items": [
[
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
]
],
"vat_rates": [
[
{
"name": "text",
"value": [
{
"value": "text",
"x": -1,
"y": -1,
"width": -1,
"height": -1,
"page_number": -1
}
]
}
]
],
"file_name": "example_file.pdf",
"file": "JVBERi0xLjQKJcfs... (truncated for brevity)"
}
{
"message": "Document added successfully.",
"details": "1458b05b6b429f569c7c1512712d50b6e465595e"
}
Last updated