How to upload documents or batches to the Parashift Platform via API, which attributes to set to influence processing and skip workflow steps.
Introduction
Uploading Documents or Batches to the Parashift Platform is super easy and can be done with one simple POST. Next to the files to be processed you can also set different attributes in the body that influence how a document is processed like turning on/off human validation, outsourcing validation work or skipping workflow steps like Separation, Classification or Extraction.
Simple Upload
All you need to upload a document or batch is an API Key, your file encoded in base64 and the following POST:
curl --location --request POST 'https://api.parashift.io/v2/documents' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer SuperSecretKeySearchTheDocumentationForApiToFindOutHow' \
--data-raw '{
"data": {
"type": "documents",
"attributes": {
"files": [
{
"base64_file": "JVBERi0Q0MDINCiUlRU9G...ThisIsUsuallyALotLongerOfCourse"
}
]
}
}
}'
API Documentation: Create a document
Alternatively, you can also upload a batch by just changing the endpoint to https://api.parashift.io/v2/batches and the type inside the body to "type": "batches"
Attributes Body
The only attribute that is absolutely required is the files as base64 string, everything else is optional and can be set depending on use case.
attribute | endpoints | default | description |
name(string) |
batch document |
null | Used for identification and displayed in the App at various spots |
custom_fields{hash} |
batch document |
null | Provide some meta information to your docs that we drag through the workflow |
external_id(string) |
batch document |
null | Used for identification, can be queried very easily |
classification_scope[] |
batch document |
null | used to skip Classification (see below) |
validation_required(boolean) |
batch document |
true | Used to disable manual validation steps (see below) |
uplaod_configuration(string) |
batch document |
client | In the upload configuration, you can define Separation configuration, workflow rules, SLA times and much more. (read more) |
not_for_training(boolean) | document | false | Used to disable training on this document, very useful option for test documents |
files[ {file_name(string), base64_file(string)}] |
batch document |
null | An array of your files as base64 string. You can upload different file types (pdf, jpg, png) in the same POST and also multiple pages that we will merge for you on processing. |
Skip Workflow Steps
Skip nothing
If you want your documents to run through all workflow steps (read up on our workflow), then create a batch that will run through Separation, which creates documents which, in turn, run through Classification and Extraction.
API Documentation: Create a batch
Skip Separation
If the documents you are about to upload are already properly separated then you can also skip Separation and directly create a document.
API Documentation: Create a document
Skip/Filter Classification
If you already know the document type of the document you are about to upload, then you can fix a classification scope with one entry, which will lead to Classification getting skipped.
"classification_scope": [
"pp-correspondence"
],
Alternatively, if you have many document types active in your tenant but know that the document you are about to upload can only be of a certain range of document types you can fix a classification scope also with multiple entries which will lead to Classification getting filtered down on the provided document types.
"classification_scope": [
"pp-correspondence",
"pp-invoice"
],
Skip Extraction
If you are not interested in extracting any data from the document besides the document type you can also configure the platform to not extract any fields.
Limits and prerequisites
There are some limitations to the files uploaded to the API.
- The base64 encoded file must be a pdf, jpg, png or tiff for automated processing (Other mime types can be uploaded and processed manually, this has to be configured)
- The minimum file size is 100 bytes (otherwise the Platform assumes something went wrong if a file is this small)
- The maximum file size is 20 MB (if you need this limit extended reach out)
- The maximum number of pages a document can have is 500 pages.