Developer Reference
API v1.0

Introduction

Graflows is a high-performance Document Intelligence API designed for the modern stack. It provides developers with the tools to convert unstructured PDFs and images into highly accurate, structured JSON data while preserving complex layout patterns and table structures.

Layout Aware

Maintains the spatial relationships of text and tables for precise extraction.

High Performance

Optimized for speed, from small receipts to thousand-page reports.

Authentication

All Graflows API requests require an API key to be sent in the header. Requests without a valid key will return a 401 Unauthorized response.

Authorization:
Bearer <YOUR_API_KEY>

Where to find your API key?

Log in to your developer dashboard to manage your API keys, monitor usage, and view analytics.

Extraction Modes

Synchronous ExtractionRecommended for UI

Best for real-time applications where immediate feedback is required. The connection stays open until the processing is complete.

Limit: 3 pages per document
Timeout: 60 seconds

Asynchronous JobsBatch Processing

Designed for processing large volumes of documents or long files. Upload the file, receive a job_id, and poll for results.

Limit: Up to 1,000 pages (Enterprise)
Webhook support coming soon

Schema Guide

Define exactly what you want to extract using a dynamic JSON schema. Graflows supports simple key-value pairs and complex nested structures.

Complex Invoice Example

JSON Schema
{
  "invoice_number": "Invoice ID string",
  "vendor_name": "Name of the issuer",
  "total_amount": "Total amount in numeric value",
  "line_items": {
    "_type": "list",
    "_description": "A list of individual charges",
    "description": "Item description",
    "quantity": "Number of units",
    "price": "Price per unit"
  }
}
i

Use the "_type": "list" convention to handle repeating structures like invoice line items or table rows.

API Reference

POST/parse/extract

Performs immediate extraction on documents under 3 pages.

Request (CURL)
curl -X POST http://api.graflows.com/api/v1/parse/extract \
  -H "Authorization: Bearer <API_KEY>" \
  -F "file=@invoice.pdf" \
  -F 'extraction_schema={"total": "Total amount"}'
POST/jobs/

Creates a background processing job for large documents.

curl -X POST http://api.graflows.com/api/v1/jobs/ \
  -H "Authorization: Bearer <API_KEY>" \
  -F "file=@large-report.pdf"
GET/jobs/{id}

Retrieve the status and results of an async job.

POST/parse/markdown

Utility endpoint to export document contents as clean Markdown.

curl -X POST http://api.graflows.com/api/v1/parse/markdown \
  -H "Authorization: Bearer <API_KEY>" \
  -F "file=@document.pdf"

Ready to start building?

Get your API key today and start extracting data from your documents with just a few lines of code.