Przejdź do treści
Convor
Convor Docs
Funkcje

Data Export

Export conversations, analytics summaries, and visitor data as CSV or JSON files for backup and reporting.

Convor provides several export endpoints for pulling data out of the system. Exports return files directly as downloads with proper content types and attachment headers. All export actions are rate-limited and logged in the audit trail.

Overview

Four export types are available:

  • Conversations: export all conversations with their messages
  • Analytics: export a summary of metrics for a time period
  • Visitors: export the full visitor list
  • Bulk conversations: export with advanced filtering by status, operator, or tags

All export endpoints are rate-limited to 5 requests per minute. Each export creates an audit log entry recording the format, record count, and the user who triggered it.

Exporting Conversations

Export all conversations within the organization, including their messages. Available in CSV and JSON formats:

GET /api/export/conversations?format=csv&date_from=2025-01-01T00:00:00Z&date_to=2025-03-01T00:00:00Z

Query Parameters

ParameterTypeDescription
formatstringcsv or json (default: json)
date_fromdatetimeISO 8601 start date filter
date_todatetimeISO 8601 end date filter

The response includes conversation metadata (ID, status, visitor, operator) and all messages flattened into a single text field. Each message is prefixed with its sender type.

CSV columns: id, status, visitorId, assignedOperatorId, createdAt, updatedAt, messageCount, messages

Message Format

In CSV exports, messages are joined with newlines. Each message appears as [operator] message text or [visitor] message text. The CSV escaping handles commas, quotes, and newlines within message content correctly.

Exporting Analytics

Export an analytics summary as a CSV file. This produces a metric table rather than raw records:

GET /api/export/analytics?format=csv&date_from=2025-01-01T00:00:00Z&date_to=2025-03-01T00:00:00Z

Query Parameters

ParameterTypeDescription
formatstringOnly csv is supported
date_fromdatetimeISO 8601 start date (defaults to 30 days ago)
date_todatetimeISO 8601 end date (defaults to now)

The export produces rows for each metric:

MetricDescription
Total ConversationsAll conversations in the period
Conversations (open)Open conversations count
Conversations (closed)Closed conversations count
Conversations (pending)Pending conversations count
Average CSAT RatingMean satisfaction survey rating
Total SurveysNumber of survey responses
Unique VisitorsDistinct visitors in the period

CSV columns: metric, value, period_start, period_end

Exporting Visitors

Export the full visitor list as a CSV file:

GET /api/export/visitors?format=csv

Exported Fields

FieldDescription
idVisitor UUID
identifierVisitor identifier string
fingerprintBrowser fingerprint hash
firstSeenAtFirst activity timestamp
lastSeenAtMost recent activity timestamp
totalSessionsNumber of sessions
geoCountryCountry from geo-lookup
geoCityCity from geo-lookup

Results are ordered by lastSeenAt descending.

Bulk Export with Filters

For more targeted exports, the bulk endpoint accepts a POST body with advanced filtering:

POST /api/export/conversations/bulk
{
  "format": "csv",
  "dateFrom": "2025-01-01T00:00:00Z",
  "dateTo": "2025-03-01T00:00:00Z",
  "status": "closed",
  "operatorId": "op-uuid",
  "tags": ["refund", "priority"]
}

Request Body

FieldTypeDescription
formatstringcsv or json (default: csv)
dateFromdatetimeISO 8601 start date filter
dateTodatetimeISO 8601 end date filter
statusstringFilter by open, closed, or pending
operatorIdUUIDFilter by assigned operator
tagsstring[]Filter by conversation tags

The bulk export includes an additional operatorName column that resolves the operator UUID to a human-readable display name.

Response Format

All export endpoints set the Content-Disposition header to trigger a file download:

Content-Disposition: attachment; filename="conversations-export.csv"
Content-Type: text/csv; charset=utf-8

For JSON exports:

Content-Disposition: attachment; filename="conversations-export.json"
Content-Type: application/json; charset=utf-8

Large Exports

Exports are generated synchronously. For organizations with thousands of conversations, consider using date range filters to limit the result set. Rate limiting (5 requests per minute) prevents accidental runaway exports.

API Reference

MethodEndpointDescription
GET/api/export/conversationsExport conversations with messages
GET/api/export/analyticsExport analytics summary as CSV
GET/api/export/visitorsExport visitor list as CSV
POST/api/export/conversations/bulkBulk export with advanced filters

All endpoints require authentication and are rate-limited to 5 requests per minute.

Czy ta strona była pomocna?

On this page