Skip to main content
POST
/
api
/
v2
/
documents
/
templates
/
generate-document
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.templates.generate_document_async(
    slug="slug",
    type="document",
)
print(response.async_result_id)
{
  "asyncResultId": "<string>"
}

Body

application/json

The request body, discriminated by the 'type' field ('document' or 'pdf').

The request body, discriminated by the 'type' field ('document' or 'pdf').

type
enum<string>
required
Available options:
document
slug
string
required

The slug of the template to use.

documentBody
any

The body of the document.

fileName
string

The name of the file to save.

Response

Default Response

asyncResultId
string
required

The ID to track the asynchronous document generation task.