message.comDevelopers

Export conversation data

Download conversations and messages for warehousing, compliance audits, or external analytics. Three flavours: a full workspace export, a per-conversation export, or a programmatic pull with pagination over the conversations API.

Full workspace export

The reports export endpoint streams CSV or JSON for the date range you ask for.

bash
curl -X GET 'https://app.message.com/api/v1/reports/export?range=90d&type=conversations&format=csv' \
  -H 'Authorization: Bearer YOUR_WORKSPACE_JWT' \
  -o conversations-90d.csv

Query params:

  • range. 7d | 30d | 90d | custom (with from and to).
  • type. conversations | messages | visitors.
  • format. csv or json.

Exports are streamed, not buffered. The endpoint can return multi-GB files without timing out. curl -o writes to disk as bytes arrive.

Export messages

bash
curl -X GET 'https://app.message.com/api/v1/reports/export?range=90d&type=messages&format=json' \
  -H 'Authorization: Bearer YOUR_WORKSPACE_JWT' \
  -o messages-90d.json

JSON output is newline-delimited (NDJSON) for large exports. Each line is one message object. Parseable with jq, pandas.read_json(lines=True), or DuckDB.

Export a single conversation

For per-ticket exports (compliance request, customer asks for their data):

bash
curl -X POST 'https://app.message.com/api/v1/tickets/<id>/export' \
  -H 'Authorization: Bearer YOUR_WORKSPACE_JWT' \
  -o ticket-12345.csv

Includes the full timeline: visitor messages, agent replies, internal notes, status changes, transfers.

Programmatic pull

If you want incremental fetches into a warehouse, paginate the conversations endpoint with cursor:

bash
# Initial page
curl 'https://app.message.com/api/v1/conversations?limit=200' -H 'Authorization: Bearer YOUR_WORKSPACE_JWT'

# Follow nextCursor on each response
curl 'https://app.message.com/api/v1/conversations?limit=200&cursor=2026-05-13T14:00:00Z|uuid' -H 'Authorization: Bearer YOUR_WORKSPACE_JWT'

Schedule

A few cron-job patterns:

  • Weekly archive. Sunday night, export the past week to S3 with the date in the filename.
  • Monthly compliance. First of the month, export the prior month, encrypt with GPG, store off-site.
  • Continuous to warehouse. Every 15 minutes, pull conversations modified since last cursor, upsert into Snowflake / BigQuery / Postgres.

Common pitfalls

  • JWT lifetime. Workspace JWTs expire in 7 days. For long-running cron jobs, refresh the token or wait for API keys (planned).
  • Large exports timeout client-side. Use streaming HTTP clients (curl, Python requests.get(stream=True), Node fetch with response body iteration). Loading the whole response in memory will OOM on 1GB+ exports.
  • PII handling. Exports include visitor emails, names, custom attributes. Store accordingly.
  • Time zone. All timestamps in exports are UTC ISO 8601. Convert at consumption time.

Next steps