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

Upload a document for processing

POST
/workspaces/{workspaceId}/documents
Last modified:2025-07-08 20:19:30
Uploads a single document file (e.g., PDF, image) to Docpier's IDP service for asynchronous processing.
The service will process the document, extract structured data, and make it available via the GET /workspaces/{workspaceId}/documents/{documentId} endpoint.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/workspaces//documents' \
--form 'file=@""'
Response Response Example
202 - Example 1
{
    "documentId": "f8b7e6d5-c4b3-2a1e-0d9c-8b7a6f5e4d3c",
    "processingInfo": {
        "fileSize": 0,
        "detectedPages": 1,
        "qualityScore": 0.85,
        "warnings": [
            "LOW_RESOLUTION_DETECTED: Image DPI is below recommended 300."
        ]
    }
}

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
Body Params multipart/form-data
file
file 
required
The document file to upload (PDF, JPG, PNG, TIFF)

Responses

🟢202Accepted
application/json
Document accepted for processing. A unique documentId is returned to track its status and retrieve results.
Body
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document (UUID format). Use this ID to track processing and retrieve results.
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}$
processingInfo
object 
optional
Initial information about the document and potential processing issues.
fileSize
integer 
optional
Size of the uploaded file in bytes.
detectedPages
integer 
optional
Number of pages detected in the document.
>= 1
Example:
1
qualityScore
number 
optional
An indicative score of the document's overall quality (e.g., readability, clarity, completeness), typically between 0.0 and 1.0. Higher is better.
>= 0<= 1
Example:
0.85
warnings
array[string]
optional
List of initial warnings related to the document's quality (e.g., low DPI, blurry image)."
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🔴500Server Error
Modified at 2025-07-08 20:19:30
Previous
General
Next
Retrieve structured data results for a processed document
Built with