Skip to main content
GET
Export segment contacts
Use this endpoint to export a segment’s contacts as an Excel file (.xlsx), including its call history when the segment has been dialed.

Endpoint

GET /segment/contacts/export Authentication: Required (workspace auth)

Query Parameters

Response

Returns an Excel file (.xlsx) with one or two sheets:

Notes

  • The response is a binary Excel file stream, not JSON — set your HTTP client to handle binary/file responses.
  • The download filename is the segment’s name, sanitized to safe filename characters, e.g. mumbai_premium.xlsx.
  • Segment Contacts rows come from the segment’s materialized contact mapping (segment_contacts), the same set used by List Segment Contacts — not a live re-evaluation of the filter.
  • Call History rows come from dial rows created from this segment (campaign_audience_details where SOURCE_TYPE = 2 and SOURCE_ID = the segment), across every campaign the segment has ever been attached to, joined to each call attempt in agent_executions.
  • Recording URLs are signed just before being written to the sheet (the underlying files are stored privately).
  • Both sheets mask mobile numbers when the workspace’s company has phone number masking enabled.

Error Cases

Example cURL

Headers

token
string
required

API token for authentication

Query Parameters

segment_id
integer
required

Segment identifier

Response

Excel file download

The response is of type file.