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
idof 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.typequery parameter controls the output shape:
type | Result |
|---|---|
json (default) | Structured JSON |
raw_text | CSV content as plain text |
download_file | Direct .csv file download |
Reference: Export answers to CSV file.
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 key | Label | Notes |
|---|---|---|
customer_public_id | Customer ID | Patient's public identifier |
customer_elation_id | Customer Elation ID | Present when the team has an Elation EHR integration |
customer_first_name | Customer First Name | |
customer_last_name | Customer Last Name | |
customer_email | Customer Email | |
sent_at | Sent at | |
completed_at | Completed at | |
archived | Archived |
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 OKwith CSV text (or a downloaded.csvfile, or JSON) containing one row per submission and one column per question, ready to feed into your EHR's own import tooling.
Exports contain the same Patient answer data as the underlying Responses. Handle and store exported files as PHI.
Next
- Fetch completed form responses, for per-submission JSON instead of a bulk export.
- Common EHR integration patterns