Public API
  1. Endpoints
Public API
  • General
  • Endpoints
    • Upload a document for processing
      POST
    • Retrieve structured data results for a processed document
      GET
    • Provide feedback on document extraction results
      PATCH
  1. Endpoints

Provide feedback on document extraction results

PATCH
/workspaces/{workspaceId}/documents/{documentId}/feedback
Last modified:2025-07-08 20:19:51
Allows clients to send feedback (e.g., corrections, accuracy ratings) for a specific document processing result.
This feedback loop helps Docpier's machine learning models improve accuracy and extraction quality.
Clients can submit an overall rating, general comments, and specific field-level corrections.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PATCH '/workspaces//documents//feedback' \
--header 'Content-Type: application/json' \
--data-raw '{
    "overallRating": 4,
    "comments": "The VAT amount was incorrectly extracted. It should be 7.70, not 7.07.",
    "fieldCorrections": {
        "documentType": "INVOICE",
        "externalDocumentId": "INV-2025-00123",
        "items": [
            {
                "correctedFields": {
                    "vatAmount": 7.7,
                    "description": "Corrected Service Description for Q2"
                }
            }
        ],
        "sender": {
            "correctedFields": {
                "emails": [
                    "corrected.info@docpier.com"
                ]
            }
        }
    }
}'
Response Response Example
400 - Example 1
{
    "code": "INVALID_FILE",
    "message": "The uploaded file is not a valid PDF."
}

Request

Authorization
OAuth 2.0
Authorization Code
Client Credentials
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.docpier.com/oauth/authorize
Token URL: https://auth.docpier.com/oauth/token
or
Path Params
workspaceId
string 
required
Unique identifier for the workspace
documentId
string 
required
The unique ID of the document to provide feedback for.
Example:
f8b7e6d5-c4b3-2a1e-0d9c-8b7a6f5e4d3c
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Body Params application/json
overallRating
integer 
optional
Overall accuracy rating for the extracted document(s) (e.g., 1=Poor, 5=Excellent). Minimum value 1, maximum 5.
>= 1<= 5
Example:
4
comments
string 
optional
Free-form text comments about the extraction quality or specific issues/praise. Maximum 500 characters.
<= 500 characters
Example:
The VAT amount was incorrectly extracted. It should be 7.70, not 7.07.
fieldCorrections
object 
optional
A JSON object containing specific field corrections. The structure should mirror the extracted document's schema,
allowing clients to send corrected values for specific paths (e.g., invoice.items[0].description).
This provides granular feedback and helps retrain models.
Example:
{"documentType":"INVOICE","externalDocumentId":"INV-2025-00123","items":[{"correctedFields":{"vatAmount":7.7,"description":"Corrected Service Description for Q2"}}],"sender":{"correctedFields":{"emails":["corrected.info@docpier.com"]}}}
Examples

Responses

🟢200OK
Feedback successfully received. Thank you for your input!
This response does not have a body.
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Modified at 2025-07-08 20:19:51
Previous
Retrieve structured data results for a processed document
Built with