Skip to main content
POST
/
platform-api
/
v1
/
exports
/
tickets
Export tickets
curl --request POST \
  --url https://app.sagepilot.ai/platform-api/v1/exports/tickets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "format": "<string>"
}
'
Use the ticket export API to download raw ticket rows as a CSV file.

Required access

AuthenticationScopeDataset grant
API client v2tickets.exporttickets.raw

Body

format
string
default:"csv"
required
Export format. Currently only csv is supported.
columns
object[]
Optional list of columns to include. If omitted, Sagepilot exports the default ticket columns and appends workspace custom fields automatically.
columns[].key
string
Built-in column key, or any label you want for a custom-field integration column.
columns[].label
string
Optional CSV header label.
columns[].field_id
string
Sagepilot custom field ID. Include this when exporting a workspace custom field.
filters
object
Same filter object used by analytics queries.
filters.channel_ids
string[]
Channel UUIDs to include in the export. Find channel IDs in Settings > API Details > Channels. See Resource IDs.
filters.statuses
string[]
Ticket statuses to include. Current constraint: at most one status per export request.
sort
object[]
Optional sort instructions.
sort[].field
string
Field to sort by, such as created_at.
sort[].direction
string
Sort direction. Use asc or desc.
timezone
string
default:"UTC"
Timezone used for formatted datetime columns.
limit
integer
default:"50000"
Maximum rows to export. The maximum supported value is 50000.
date_range
string
Optional date preset.
date_filter_field
string
Optional date field selector.
view
string
Optional saved-view identifier.

Built-in columns

Common built-in column keys include:
  • code
  • status
  • priority
  • created_at
  • updated_at
  • customer_name
  • customer_phone
  • customer_email
  • channel_id
  • tags
  • closed_at
  • agent_name
  • pilot_name

Response

The response is a streamed CSV attachment.

Notes

  • Use ticket export when you need row-level CSV data for spreadsheets, warehouse jobs, or offline analysis.
  • Use the analytics API when you need aggregates, ratios, trends, or grouped summaries.