Stable v1.0Last updated recently
Get Started

Get a Single Document

Retrieve detailed information about a specific document using its unique identifier.

Get a Single Document

This endpoint allows you to retrieve detailed information about a single document by providing its unique document ID. The response includes the document metadata and its current processing status.

Endpoint

GET/api/v1/documents/get_document/{document_id}

Retrieve details of a specific document by its ID.

Request Authentication

All requests must be authenticated using an API key sent in thex-api-key header.

Authentication Header
x-api-key: YOUR_API_KEY_HERE

Path Parameters

Path Parameters

NameTypeDescription
document_idRequired
IntegerUnique identifier of the document to retrieve.

Example Request

cURL – Get Document by ID
curl -X GET "/api/v1/documents/get_document/101" \
  -H "x-api-key: YOUR_API_KEY_HERE"

Response

On success, the API returns the document metadata along with its current processing status.

200 OKDocument retrieved successfully
Response Body
{
  "status": 200,
  "message": "Document jobs fetched successfully.",
  "result": {
    "id": 27,
    "document_id": 27,
    "job_type": "full_processing",
    "status": "completed",
    "result_data": {
      "ocr_confidence": 100.0,
      "total_pages": 1,
      "raw_data": {
        "text": "## Page 1
        <img>Original Image</img>
        **STAGE 1 – SOUTH SIDE: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**
        **STAGE 2 – NORTH SIDE: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**
        **STAGE 3 – CENTER: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**
        **NOTES:**
        1. DELINEATORS ARE REQUIRED TO SEPARATE OPPOSING TRAFFIC DIRECTIONS.
        2. MINISTRY STANDARD PRECAST CONCRETE BARRIERS ARE REQUIRED TO SEPARATE WORK AREA FROM TRAFFIC LANES.
        <table>
          <thead>
            <tr>
              <th>Rev</th>
              <th>Date</th>
              <th>Description</th>
              <th>Init</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>0</td>
              <td>2023-08-15</td>
              <td>Initial Release</td>
              <td>AB</td>
            </tr>
          </tbody>
        </table>",
        "blocks": [
          "## Page 1",
          "&lt;img&gt;Original Image&lt;/img&gt;",
          "**STAGE 1 – SOUTH SIDE: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**",
          "**STAGE 2 – NORTH SIDE: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**",
          "**STAGE 3 – CENTER: JOINT DEMOLITION AND LINK SLAB CONSTRUCTION**",
          "**NOTES:**",
          "1. DELINEATORS ARE REQUIRED TO SEPARATE OPPOSING TRAFFIC DIRECTIONS.",
          "2. MINISTRY STANDARD PRECAST CONCRETE BARRIERS ARE REQUIRED TO SEPARATE WORK AREA FROM TRAFFIC LANES.",
          "<table>",
          "<thead>",
          "<tr>",
          "<th>Rev</th>",
          "<th>Date</th>",
          "<th>Description</th>",
          "<th>Init</th>",
          "</tr>"
        ]
      },
      "ai_summary": "The document outlines a construction project divided into three stages: South Side, North Side, and Center, focusing on joint demolition and link slab construction. It includes notes on traffic management and safety measures. A table intended for revision history is present but completely empty.",
      "key_insights": {
        "patterns": [
          "Three stages of construction work mentioned consistently focus on joint demolition and link slab construction."
        ],
        "anomalies": [
          "The revision history table is completely empty, with no entries across all columns."
        ],
        "recommendations": [
          "Fill the revision history table with appropriate data entries to track changes or updates to the document."
        ]
      },
      "images": [
        {
          "id": 1,
          "title": "Original Image",
          "page": 1,
          "evidence": "&lt;img&gt;Original Image&lt;/img&gt;"
        }
      ],
      "tables": [
        {
          "id": 1,
          "title": "Revision History",
          "page": 1,
          "rows": 0,
          "evidence": "Rev, Date, Description, Init"
        }
      ]
    },
    "error_message": null,
    "confidence_score": null,
    "created_at": "2026-01-06T16:30:06.557997+05:00",
    "started_at": null,
    "completed_at": "2026-01-06T11:33:29.747235+05:00",
    "original_filename": "schedule_t3_-_1_-_proposed_deck_construction_staging.pdf"
  }
}

Error Responses

401 UnauthorizedMissing or invalid API key
Response Body
{
    "status": 401,
    "message": "API key required for API access",
    "result": null
}
404 ErrorDocument not found
Response Body
{ 
    "status": 404, 
    "message": "Document not found.", 
    "result": null 
}