Skip to Content
API keys are issued to organizations with a signed BAA. Request API access →
GuidesExport conversation history

Export conversation history

Exports package a conversation’s messages into a downloadable file. Use them to archive texting history with the patient’s chart or to meet a records request.

You’ll need: an app user with exports:write and exports:read that participates in the conversations you export.

Start the export

Request
curl -X POST https://api.bloomtext.com/v1/conversations/e5c3b7b8-8f08-4d5a-9af1-0d11b0f4b7a0/exports \ -H "Authorization: Bearer $BLOOMTEXT_API_KEY" \ -H "Idempotency-Key: export:e5c3b7b8:2026-09" \ -H "Content-Type: application/json" \ -d '{"projection": "messages", "from": "2026-09-01T00:00:00Z", "to": "2026-09-30T23:59:59Z"}'

The response is 202 Accepted with an Export object in queued status.

Wait for it to finish

Either listen for the export.ready webhook, or poll Retrieve an export every 15 seconds until status is ready.

wait-for-export.mjs
async function waitForExport(exportId) { for (;;) { const exp = await fetch(`https://api.bloomtext.com/v1/exports/${exportId}`, { headers: { Authorization: `Bearer ${process.env.BLOOMTEXT_API_KEY}` }, }).then((r) => r.json()) if (exp.status === 'ready') return exp.download_url if (exp.status === 'failed') throw new Error(`Export ${exportId} failed`) await new Promise((r) => setTimeout(r, 15_000)) } }

Download and file it

The download_url is short-lived. Download it right away and upload the file to your EMR’s document store with the patient’s record.

Exports contain PHI. Store downloaded files in the same protected systems as the rest of your patient records, and delete temporary copies.

Last updated on