Analytics

Export messaging analytics data

Exports one record per outbound message accepted in the given date range as CSV or JSON and returns the file content inline.

POST
/v1/analytics/export

Exports one record per outbound message accepted in the given date range as CSV or JSON and returns the file content inline. CSV follows RFC 4180: fields containing a quote, comma, or line break are quoted with embedded quotes doubled, and records are separated by CRLF. At most 10,000 records are returned, newest first.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
after*string
before*string
format?|null
includeChannels?array<>|null

Response Body

Success

application/json
  1. response
content*string
mimeType*string
filename*string
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.analytics.exportData({  "after": "example",  "before": "example"});
Example Response
{  "content": "string",  "mimeType": "string",  "filename": "string"}

Related documentation