API Documentation
Integrate DocuChat AI into your applications.

Our API allows developers to programmatically access DocuChat AI's powerful PDF data extraction capabilities. API access is available on our Business and Enterprise plans.

Getting Started

To get started with the API, you'll need an API key, which can be found in your account dashboard if you are on an eligible plan.

All API requests should be authenticated using your API key, typically passed in the `Authorization` header as a Bearer token.

Base URL

https://api.docuchat.ai/v1

Endpoints

POST /extract

This endpoint allows you to submit a PDF and extraction instructions to perform data extraction.

Request Body (multipart/form-data):

  • pdf_file (file, required): The PDF document to process.
  • instructions (string, required): Text-based instructions for the AI on what data to extract and how to format it.
  • output_format (string, optional, default: `text`): Desired output format. Supported values: `text`, `json`. (Note: For JSON, ensure instructions guide AI to produce JSON-compatible string).

Example Request (cURL):

curl -X POST \
  https://api.docuchat.ai/v1/extract \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "pdf_file=@/path/to/your/document.pdf" \
  -F "instructions=Extract all names and invoice amounts."

Example Response (JSON):

{
  "status": "success",
  "data": {
    "extracted_text": "...", // Extracted data based on instructions
    "original_filename": "document.pdf"
  },
  "credits_used": 1 
}

Rate Limiting

API requests are rate-limited based on your subscription plan. Check your plan details for specific limits. Exceeding the rate limit will result in a `429 Too Many Requests` error.

Error Handling

The API uses standard HTTP status codes to indicate success or failure. Errors will be returned in a JSON format:

{
  "status": "error",
  "message": "Descriptive error message"
}

This documentation is a brief overview. For more detailed information, client libraries, and examples, please refer to our full API portal (coming soon) or contact support if you are an Enterprise customer.

API Coming Soon for General Availability

Currently in Beta for select customers.