Export to File
GET /io/contacts/contacts/file-export — download every contact as a CSV or Excel file.
Streams all of the caller's contacts as a downloadable file. There is no pagination and no filtering — the response is the complete list. For a paginated JSON view, use GET /contacts instead.
GET https://api.misar.io/io/contacts/contacts/file-exportAuthentication
Either mode works:
Authorization: Bearer <sso_access_token>x-audience-service-key: <AUDIENCE_SERVICE_KEY>With a service key you must also pass ?user_id=<uuid>.
/io/contacts/contacts/file-exportQuery parameters
formatstringquerydefault: csvOne of csv, xlsx, or xls. Anything else returns 400.
user_idstringqueryRequired with a service key; ignored with an SSO bearer. Must be a valid UUID.
Response
The body is the file itself, not JSON.
format | Content-Type | Filename |
|---|---|---|
csv | text/csv; charset=utf-8 | contacts-export-YYYY-MM-DD.csv |
xlsx | application/octet-stream | contacts-export-YYYY-MM-DD.xlsx |
xls | application/octet-stream | contacts-export-YYYY-MM-DD.xls |
Every response carries Content-Disposition: attachment and Cache-Control: no-store.
curl -OJ "https://api.misar.io/io/contacts/contacts/file-export?format=csv" \
-H "Authorization: Bearer $SSO_ACCESS_TOKEN"curl -OJ "https://api.misar.io/io/contacts/contacts/file-export?format=xlsx&user_id=3f1a2b4c-5d6e-4f70-8a91-b2c3d4e5f607" \
-H "x-audience-service-key: $AUDIENCE_SERVICE_KEY"{ "error": "format must be csv, xlsx, or xls" }`xls` is served as modern Excel
Requests for xls receive OOXML (.xlsx) bytes under an .xls filename — the legacy BIFF binary format is not emitted. Spreadsheet applications open the file without complaint. Prefer xlsx in new integrations.
Exported columns
Every column on the contact record is exported, including read-only engagement fields:
id · user_id · workspace_id · email · first_name · last_name · phone · company · job_title · social_profiles · status · custom_fields · source · total_opens · total_clicks · engagement_tier · last_engagement_at · lead_score · created_at · updated_at
Rows are ordered by created_at descending and read in batches of 1,000 until the list is exhausted.
Status codes
| Code | Meaning |
|---|---|
200 | File returned. |
400 | format is not one of csv, xlsx, xls, or user_id is not a valid UUID. |
401 | Neither a valid SSO bearer nor a valid x-audience-service-key was supplied. |
Round-tripping
The export column set is a superset of what POST /contacts/file-import reads, so an exported file can be edited and re-imported. On re-import, contacts are matched on (user_id, email) and lead_score is reset to 0.