LeapOCRLeapOCR DocsAPI, SDKs, and integration guides

SDK API Reference

Interactive reference for the public SDK-facing endpoints generated from openapi.json.

SDK API Reference

This page renders the public SDK-facing operations directly from openapi.json. It only includes endpoints tagged SDK, so internal dashboard, analytics, and webhook management routes stay out of the reference.

Get OCR job result

GET/ocr/result/{job_id}
X-API-KEY<token>

Provide your LeapOCR API key via the X-API-KEY header. Example: X-API-KEY: YOUR_API_KEY

In: header

Path Parameters

job_id*string

OCR job ID

Formatuuid

Query Parameters

page?integer

Page number for result pagination

Default1
Range1 <= value
limit?integer

Number of items per page

Default100
Range1 <= value <= 1000

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api.leapocr.com/api/v1/ocr/result/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "completed_at": "string",
  "credits_used": 0,
  "file_name": "string",
  "job_id": "string",
  "model": "string",
  "pages": [
    {
      "bounding_boxes": [
        {
          "bounds": {
            "height": 0,
            "width": 0,
            "x": 0,
            "y": 0
          },
          "metadata": null,
          "text": "string",
          "type": "string"
        }
      ],
      "confidence": 0,
      "dimensions": {
        "height": 0,
        "width": 0
      },
      "has_bounding_boxes": true,
      "id": "string",
      "page_number": 0,
      "result": null
    }
  ],
  "pagination": {
    "limit": 0,
    "page": 0,
    "total": 0,
    "total_pages": 0
  },
  "processed_pages": 0,
  "result_format": "string",
  "status": "pending",
  "total_pages": 0
}
{
  "completed_at": "string",
  "error_message": "string",
  "job_id": "string",
  "processed_pages": 0,
  "result_format": "string",
  "status": "pending",
  "total_pages": 0
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}

Get OCR job status

GET/ocr/status/{job_id}
X-API-KEY<token>

Provide your LeapOCR API key via the X-API-KEY header. Example: X-API-KEY: YOUR_API_KEY

In: header

Path Parameters

job_id*string

OCR job ID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api.leapocr.com/api/v1/ocr/status/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "created_at": "string",
  "error_message": "string",
  "file_name": "string",
  "id": "string",
  "processed_pages": 0,
  "processing_time": 0,
  "result_format": "string",
  "status": "pending",
  "total_pages": 0
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}

Direct upload

POST/ocr/uploads/direct
X-API-KEY<token>

Provide your LeapOCR API key via the X-API-KEY header. Example: X-API-KEY: YOUR_API_KEY

In: header

Request Body

application/json

Upload initiation request

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api.leapocr.com/api/v1/ocr/uploads/direct" \  -H "Content-Type: application/json" \  -d '{}'
{
  "chunk_size": 5242880,
  "complete_url": "/api/v1/ocr/uploads/123e4567-e89b-12d3-a456-426614174000/complete",
  "expires_at": "2023-12-25T10:45:00Z",
  "job_id": "123e4567-e89b-12d3-a456-426614174000",
  "parts": [
    {
      "end_byte": 5242879,
      "part_number": 1,
      "start_byte": 0,
      "upload_url": "https://r2.example.com/bucket/file.pdf?partNumber=1&uploadId=abc123"
    }
  ],
  "total_chunks": 1,
  "upload_id": "550e8400-e29b-41d4-a716-446655440000",
  "upload_type": "multipart"
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}

Remote URL upload

POST/ocr/uploads/url
X-API-KEY<token>

Provide your LeapOCR API key via the X-API-KEY header. Example: X-API-KEY: YOUR_API_KEY

In: header

Request Body

application/json

Remote URL upload request

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api.leapocr.com/api/v1/ocr/uploads/url" \  -H "Content-Type: application/json" \  -d '{}'
{
  "created_at": "2023-12-25T10:30:00Z",
  "job_id": "123e4567-e89b-12d3-a456-426614174000",
  "source_url": "https://example.com/document.pdf",
  "status": "pending"
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}

Complete direct upload

POST/ocr/uploads/{job_id}/complete
X-API-KEY<token>

Provide your LeapOCR API key via the X-API-KEY header. Example: X-API-KEY: YOUR_API_KEY

In: header

Path Parameters

job_id*string

Job ID

Formatuuid

Request Body

application/json

Completion request with part ETags

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api.leapocr.com/api/v1/ocr/uploads/497f6eca-6276-4993-bfeb-53cbbbba6f08/complete" \  -H "Content-Type: application/json" \  -d '{}'
{
  "created_at": "2023-12-25T10:30:00Z",
  "job_id": "123e4567-e89b-12d3-a456-426614174000",
  "message": "Upload completed successfully, processing started",
  "status": "pending"
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": null,
  "error": {
    "message": "string"
  }
}