Skip to main content
POST
/
api
/
v2
/
documents
/
generate-csv
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.generate_csv(
    file_name="fileName",
    rows=[{
        "foo": "string"
    }],
)
print(response.document)
{
  "document": {
    "id": "<string>",
    "fileName": "<string>"
  }
}

Body

application/json
rows
object[]
required

Array of objects, where each object represents a row with column headers as keys.

fileName
string
required

The desired file name for the generated CSV (e.g., 'report.csv').

options
object

Response

CSV document generated successfully.

CSV document generated successfully.

document
object
required

Metadata of the newly generated CSV document.