Dump results of the sql query

$dump-sql operation takes the sql query and responds with the Chunked Encoded stream in CSV format or in NDJSON format. Useful to export data for analytics.

POST [base]/$dump-sql

Headers

ParameterRequired?TypeDescription
content-typetrueStringContent-type of the query body

Query parameters

ParameterRequired?TypeDescription
_formatfalseString
  • json/ndjson: return output as NDJSON
  • otherwise: return output as TSV

Body parameters

ParameterRequired?TypeDescription
querytrueStringSql query to execute

Example

Get id and name of each patient

REST Console

POST /$dump-sql
Content-Type: text/yaml
 
query: select id, resource#>>'{name,0,given,0}' from patient

Curl

curl -u bulk-client:secret $AIDBOX_BASE_URL/\$dump-sql \
    -H 'Content-Type: text/yaml' -d@- <<EOF
query: select id, resource#>>'{name,0,given,0}' from patient
EOF

Last updated 2025-07-10T12:42:13Z