MisarMisar Docs
MisarMailMisarBlogMisarReachMisarPostMisarDevMisarCoderMisarSEOMisar PlatformMisar SSO
Contacts

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-export

Authentication

Either mode works:

SSO bearer (own contacts)
Authorization: Bearer <sso_access_token>
Service key (any user)
x-audience-service-key: <AUDIENCE_SERVICE_KEY>

With a service key you must also pass ?user_id=<uuid>.

GET/io/contacts/contacts/file-export

Query parameters

formatstringquerydefault: csv

One of csv, xlsx, or xls. Anything else returns 400.

user_idstringquery

Required with a service key; ignored with an SSO bearer. Must be a valid UUID.

Response

The body is the file itself, not JSON.

formatContent-TypeFilename
csvtext/csv; charset=utf-8contacts-export-YYYY-MM-DD.csv
xlsxapplication/octet-streamcontacts-export-YYYY-MM-DD.xlsx
xlsapplication/octet-streamcontacts-export-YYYY-MM-DD.xls

Every response carries Content-Disposition: attachment and Cache-Control: no-store.

Request — CSV
curl -OJ "https://api.misar.io/io/contacts/contacts/file-export?format=csv" \
  -H "Authorization: Bearer $SSO_ACCESS_TOKEN"
Request — Excel, service key
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"
400 — Bad format
{ "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

CodeMeaning
200File returned.
400format is not one of csv, xlsx, xls, or user_id is not a valid UUID.
401Neither 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.