Skip to main content
GET
/
api
/
v2
/
documents
/
{documentId}
/
metadata
Python
import os
from samplehc import SampleHealthcare

client = SampleHealthcare(
    api_key=os.environ.get("SAMPLEHC_API_KEY"),  # This is the default and can be omitted
)
response = client.v2.documents.retrieve_metadata(
    document_id="documentId",
)
print(response.id)
{
  "id": "<string>",
  "fileName": "<string>",
  "pdfPageCount": 1,
  "presignedUrl": "<string>",
  "size": 123
}

Path Parameters

documentId
string
required

The unique identifier of the document.

Query Parameters

includeSize
string

Whether to include file size from S3 (in bytes). Adds a small latency overhead.

Response

Successfully retrieved document metadata.

Successfully retrieved document metadata.

id
string
required
fileName
string
required
pdfPageCount
integer | null
required

The number of pages in the PDF, or null for non-PDFs and PDFs that have not been counted yet.

Required range: x >= 0
presignedUrl
string<uri>
required
size
number | null

The size of the file in bytes.