Skip to main content
POST
/
api
/
v2
/
documents
/
presigned-upload-url
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.presigned_upload_url(
    file_name="fileName",
    mime_type="application/zip",
)
print(response.id)
{
  "id": "<string>",
  "fileName": "<string>",
  "pdfPageCount": 1,
  "presignedUrl": "<string>",
  "size": 123
}

Body

application/json
mimeType
required

The MIME type of the file to be uploaded.

Available options:
application/zip,
application/x-zip-compressed,
multipart/x-zip,
application/x-compress
fileName
string
required

The name of the file to be uploaded.

Response

Successfully generated presigned URL and initial document metadata.

Successfully generated presigned URL and initial 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.