How it works
POST /public/v1/ticket-exportscreates the export and returns it right away with statusqueued.- The export runs in the background, so it can cover as many tickets as you choose, up to 50,000.
GET /public/v1/ticket-exports/{exportId}returns the status. When it iscompleted, the response also holds adownload_url.- You download the file from
download_url.
tickets:export scope. Create a key in Settings → API. An agent-linked key can only export saved views that agent can see in the inbox, as for GET /views. A key without a linked agent can export any view in the organization.
Nightly sync
Export the tickets of a saved view, with their messages, once a night.1
Find the view
Call
GET /public/v1/views and keep the id of the view that holds the tickets you sync. See Filtering and saved views.2
Create the export
202 and the export in status queued.3
Poll until it is ready
status is completed or failed.4
Download the file
Download
data.download_url and unzip it. Each status call on a completed export returns a fresh link, so request the status again if a link has expired.Backfill
Export every ticket created in a date range. Dates areYYYY-MM-DD in UTC, both days are included, and they filter on the ticket creation date.
EXPORT_TOO_LARGE. Split the date range into smaller ranges and create one export for each.
Request fields
Choose exactly one of the three selection modes. Unknown fields are rejected with400 VALIDATION_ERROR.
Default columns:
ticket_number, subject, contact_first_name, contact_last_name, contact_email, contact_phone, status, assigned_agent_name, created_at, updated_at.
Optional columns: priority, channel, channel_name, tags, last_message_at, message_count, ticket_url, csat_score, csat_comment, csat_survey_sent, csat_submitted_at, created_date, created_time, language, social_thread_type, social_post_type, team_name, first_resolved_at, resolved_at.
Read the export
The file
Wheninclude_messages is true, the download is a ZIP with tickets.csv and messages.csv. Otherwise the download is a single tickets.csv. Files are UTF-8 without a byte order mark. A selection that matches no tickets still completes, with files that contain only the header row.
Tickets are ordered by creation date, oldest first. Messages are ordered by ticket, then by creation date, oldest first. Internal notes and deleted messages are not included.
messages.csv has these columns:
All timestamps in both files are ISO-8601 in UTC. There is no timezone option.
Limits
See Rate limits.
Differences from the legacy export
POST /public/tickets/export stays available. If you move to the v1 export, these things change.
Not supported in v1:
excel, eml, order, timezone, and include_ticket_fields. Column names in tickets.csv and messages.csv are the same as in the legacy export.
Errors
See Errors for the error format. Match on
code, not on message.