Skip to main content

Endpoint

POST https://api.documind.cloud/api/v1/upload

Authentication

Requires extractions:write scope.

Request

Headers

HeaderValueRequired
X-API-KeyYour API keyYes

Body

Form data with file uploads:
FieldTypeRequiredDescription
filesfileYesOne or more files to upload (can repeat for multiple files)

Extraction-Compatible File Types

The upload endpoint stores files and returns document IDs. Schema generation and extraction currently process:
  • PDF: .pdf
  • Images: .jpg, .jpeg, .png, .tiff, .bmp
Other file types may upload successfully, but schema generation and extraction can fail if the backend cannot convert the file.

Request Limits

The backend does not enforce a documented per-file or per-request count limit in application code. Infrastructure may still reject oversized requests. For reliability, keep batches small and retry failed upload requests.

Response

Success Response (200)

Returns an array of document IDs:
[
  "123e4567-e89b-12d3-a456-426614174000",
  "223e4567-e89b-12d3-a456-426614174001"
]

Examples

import requests

API_KEY = "your_api_key_here"
headers = {"X-API-Key": API_KEY}

# Upload single file
with open("invoice.pdf", "rb") as f:
    files = {"files": f}
    response = requests.post(
        "https://api.documind.cloud/api/v1/upload",
        headers=headers,
        files=files
    )

document_ids = response.json()
print(f"Uploaded document: {document_ids[0]}")

# Upload multiple files
files = [
    ("files", open("invoice1.pdf", "rb")),
    ("files", open("invoice2.pdf", "rb")),
    ("files", open("invoice3.pdf", "rb"))
]

response = requests.post(
    "https://api.documind.cloud/api/v1/upload",
    headers=headers,
    files=files
)

document_ids = response.json()
print(f"Uploaded {len(document_ids)} documents")

# Close files
for _, f in files:
    f.close()

Error Responses

400 Bad Request

Malformed multipart request:
{
  "detail": "There was an error parsing the body"
}

401 Unauthorized

Missing or invalid API key:
{
  "detail": "Invalid or missing API key"
}

413 Payload Too Large

Infrastructure may reject oversized requests before they reach the backend:
{
  "detail": "Request Entity Too Large"
}

500 Internal Server Error

Server error during upload:
{
  "detail": "Failed to upload documents. Please try again later."
}

Best Practices

Upload multiple files in a single request instead of making multiple requests. This is faster and more efficient.
Validate file sizes client-side to avoid failed uploads and improve user experience.
Implement retry logic with exponential backoff for failed uploads, especially for large files.
Save the returned document IDs; they are required for schema generation and extraction requests.

Rate Limits

Upload endpoint is subject to rate limits based on your subscription tier. Contact support for higher limits.

Notes

  • Each upload receives a new document ID
  • Upload stores the file only; OCR/layout processing runs during schema generation or extraction

Next Steps

Extract Data

Extract structured data from uploaded documents

Generate Schema

Auto-generate extraction schema from document

List Documents

View documents with extraction records

Upload Guide

Detailed upload workflow guide