The Human Feedback API allows you to provide feedback to the extractions from Eagle Doc. This feedback is used to improve the accuracy of the extractions in the future.

Server

We currently operate one server in Frankfurt, Germany. This server is supported by a load balancer, allowing it to scale smoothly based on the workload. If you require a dedicated server or specific location, please get in touch with us.

alternative



Any Document Feedback API with user provided instructions - version 1 (v1)

This feedback allows the user to give extraction instructions of how specific fields. With this endpoint, the user has the direct control of extracted results. No additional fees apply when calling this endpoint.

Click the following box to see the detailed description of this API if the box is not expanded.

Parameters
Name Description
api-key (header) API key which you will receive with your subscription here
corrected (form-data) Corrected json file of the extraction. With Eagle Doc OCR APIs, you get your extractions in structured format of JSON. If something goes wrong, you can make corrections on the json file and sent back to Eagle Doc through this API as parameter 'corrected'.
instructions (query parameter) String to indicate the instructions how a field can be extracted from the original text. Such as "from text 'This invoice should be paid by Feb 02, 2025', get InvoiceDueDate: '2025-02-02'". You can concatenate multiple instructions into a single string using semicolons (';') as separators.
overwrite (query parameter) Boolean to indicate whether to overwrite old learnings of this document.
Responses
Code Description
200 OK is returned to indicate that the document was processed successfully.

The response contains a list of page segments. Each page segment is an array of two digits, from which the first one indicate the start page of the segment and the second one the end page of the segment.

The result contains a message from Eagle Doc to indicate the status of the operation.

An example result can look like this:

                                
                                {
                                    "message": "The learning has been updated successfully."
                                }
                                
403 BadCredentialException is used to indicate that for example the API key is not valid.
404 FileNotFoundException is used to indicate that there is no file found.
405 MethodNotAllowedException: Access to the API not allowed. There are multiple reasons possible: you reached the agreed quota, your contract expired or another internal error. Please contact us if the error persists.
500 InternalServerErrorException is used to indicate that something went wrong. Reason is not known.
Examples
Example Curl Request
                        
                        curl --location 'https://de.eagle-doc.com/api/docu/learning/instructions?instructions=from%20text%20%27This%20invoice%20should%20be%20paid%20by%20Feb%2002%2C%202025%27%2C%20get%20InvoiceDueDate%3A%20%272025-02-02%27' \
                        --header 'api-key: ••••••' \
                        --form 'corrected=@"/path/to/corrected.json"'
                        
                    
Example Postman Request
instant learning through human feedback instructions instant learning through human feedback instructions
Example of how to give instructions
- example 1:

from text 'This invoice should be paid by Feb 02, 2025', get InvoiceDueDate: '2025-02-02'

- example 2:

from text '2x 1,35 dmBio 7 Früchte Frucht 2,70 2', get ProductName:'dmBio 7 Früchte Frucht', ProductUnitPrice:1.35, ProductQuantity: 2, ProductPrice: 2.7




Any Document Feedback API - version 1 (v1)

This feedback allows the user to give feedback on the extractions of any document, so that the future extractions get better. With this endpoint, Eagle Doc automatically learns from the modifications made by the user. Please note that calling this endpoint incurs the same per-page cost as document extraction.

Click the following box to see the detailed description of this API if the box is not expanded.

Parameters
Name Description
api-key (header) API key which you will receive with your subscription here
file (form-data) File of the receipts or invoices. To be sent in the body as form-data with the key 'file'. If the document has multiple pages, you can attach them all as separate image files (supported image formats include: png, jpg, tif) or as a PDF.
original (form-data) Original json file of the extraction. With Eagle Doc OCR APIs, you get your extractions in structured format of JSON. Please send us this original json in json file format as parameter 'original'. This will be compared with the "corrected" json, so that the wrong extractions can be found automatically.
corrected (form-data) Corrected json file of the extraction. With Eagle Doc OCR APIs, you get your extractions in structured format of JSON. If something goes wrong, you can make corrections on the json file and sent back to Eagle Doc through this API as parameter 'corrected'.
Responses
Code Description
200 OK is returned to indicate that the document was processed successfully.

The response contains a list of page segments. Each page segment is an array of two digits, from which the first one indicate the start page of the segment and the second one the end page of the segment.

The result contains a message from Eagle Doc to indicate the status of the operation.

An example result can look like this:

                                
                                {
                                    "message": "The learning has been updated successfully."
                                }
                                
403 BadCredentialException is used to indicate that for example the API key is not valid.
404 FileNotFoundException is used to indicate that there is no file found.
405 MethodNotAllowedException: Access to the API not allowed. There are multiple reasons possible: you reached the agreed quota, your contract expired or another internal error. Please contact us if the error persists.
500 InternalServerErrorException is used to indicate that something went wrong. Reason is not known.
Examples
Example Curl Request
                        
                        curl --location 'https://de.eagle-doc.com/api/docu/learning' \
                                --header 'api-key: ••••••' \
                                --form 'file=@"/path/test.pdf"' \
                                --form 'corrected=@"/path/corrected.json"' \
                                --form 'original=@"/path/original.json"'
                        
                    
Example Postman Request
instant learning through human feedback
Example of how to update the json files
Part of original JSON
                                
                                    "InvoiceDate": {
                                        "value": "2023-01-30",
                                        "page": 1,
                                        "confidence": 1.0
                                    },
                                    "InvoiceNumber": {
                                        "value": "RWE_1200",
                                        "page": 1,
                                        "confidence": 1.0
                                    },
                                    "Category": {
                                        "value": "Communication",
                                        "confidence": 1.0
                                    },
                                
                            
Part of corrected json
                                
                                    "InvoiceDate": {
                                        "value": "2023-01-30",
                                        "page": 1,
                                        "confidence": 1.0
                                    },
                                    "InvoiceNumber": {
                                        "value": "200",
                                        "page": 1,
                                        "confidence": 1.0
                                    },
                                    "Category": {
                                        "value": "Other",
                                        "confidence": 0.93
                                    },