Skip to main content

Export intake data to an EHR

Goal

Pull a Form's collected answers in bulk, as CSV or JSON, for import into an EHR or other downstream system, as an alternative to reading each Response individually.

Prerequisites

  • An API key pair, see Authentication.
  • The id of the Form whose answers you want to export.

Steps

1. Find the Form id

curl --request GET \
--url https://api.app.zentake.com/v2/forms \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--header 'X-API-SECRET: <your_api_secret>'

Reference: Get forms.

2. Generate the export

curl --request POST \
--url 'https://api.app.zentake.com/v2/export-csv?type=raw_text' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--header 'X-API-SECRET: <your_api_secret>' \
--data '{
"id": "<form_id>",
"from_date": "2025-01-01T00:00:00Z",
"to_date": "2025-06-01T00:00:00Z"
}'
  • id (required). The Form's uuid.
  • from_date / to_date (optional). Scope the export to a date range.
  • type query parameter controls the output shape:
typeResult
json (default)Structured JSON
raw_textCSV content as plain text
download_fileDirect .csv file download

Reference: Export answers to CSV file.

Unified flat format (v2.1)

Add the header X-API-VERSION: v2.1 to opt into the flat export format: it orders questions by page/section/row/question, exports table rows using a per-column-per-row header contract, joins repeated-block answers with ; , and renders checkbox confirmation questions as confirmed when checked (blank otherwise). Omit the header to keep the legacy response shape.

3. Map columns into your EHR's import format

A raw_text / download_file export returns one row per Patient submission, with a fixed set of leading columns followed by one column per question on the Form:

Column keyLabelNotes
customer_public_idCustomer IDPatient's public identifier
customer_elation_idCustomer Elation IDPresent when the team has an Elation EHR integration
customer_first_nameCustomer First Name
customer_last_nameCustomer Last Name
customer_emailCustomer Email
sent_atSent at
completed_atCompleted at
archivedArchived
`customer_*` keys are Patient fields

The export response reuses the API's legacy customer naming for these column keys and labels. They map to the same Patient resource. Per-question columns after these are keyed by the question's id.

Map these columns to your EHR's flat-file or CSV import fields.

4. Review past exports

curl --request GET \
--url https://api.app.zentake.com/v2/export-csv \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--header 'X-API-SECRET: <your_api_secret>'

Returns the exports your team has generated. Reference: Get all export answers.

What success looks like

  • 200 OK with CSV text (or a downloaded .csv file, or JSON) containing one row per submission and one column per question, ready to feed into your EHR's own import tooling.
Contains PHI

Exports contain the same Patient answer data as the underlying Responses. Handle and store exported files as PHI.

Next