Documents

Get Document

Fetch a document's details.

Args: document_id: Document ID (path parameter)

Raises: - 404: If the document is not found or doesn't belong to the user

get/api/v3/documents/{document_id}

Request

  • Base URL
    https://api.nugen.in
  • Auth
    HTTP bearer

Path parameters

document_idstring required

ID of the document, returned when it was uploaded

Response

Returns the document's full record: document_id, name, filename, type, size, status, categories, uploader, and timestamps.

document_idstring required

Unique identifier for the document

document_namestring nullable

Display name of the document. Defaults to the document id if not set at upload.

filenamestring required

Original filename of the uploaded document

typestring required

MIME type of the document

sizeinteger required

File size in bytes

status'QUEUED' | 'PROCESSING' | 'READY' | 'FAILED' | 'STOPPED' required

Lifecycle status of a resource that runs asynchronously. Stored as is and returned as is, with no translation in between.

  • QUEUED: accepted and waiting for its workflow to start
  • PROCESSING: running
  • READY: finished successfully
  • FAILED: failed at any stage
  • STOPPED: stopped by the user before completion
categoriesstring[] required

List of category tags assigned to the document for organization and retrieval

uploaderstring required

Email/username of the user who uploaded the document

created_atstring nullable

Timestamp when the document was created

completed_atstring nullable

Timestamp when processing completed; null while still running

updated_atstring nullable

Timestamp of the last status change

progressnumber nullable

Completion progress, 0.0 to 100.0. Not wired up yet, always null.

eta_secondsinteger nullable

Estimated time remaining in seconds. Not wired up yet, always null.

Example response

{
  "categories": [
    "customer_support",
    "documentation"
  ],
  "completed_at": "2024-01-15T10:31:00Z",
  "created_at": "2024-01-15T10:30:00Z",
  "document_id": "document_01k4x9m2p7q3r5s8",
  "document_name": "Master Services Agmt",
  "filename": "customer_support_guide.txt",
  "size": 2548736,
  "status": "READY",
  "type": "text/plain",
  "updated_at": "2024-01-15T10:31:00Z",
  "uploader": "user@example.com"
}

Changes

No recorded changes to this operation across all 1 revision of this API.