Export HubSpot tickets list
Ticket Management
Export HubSpot Tickets
Exports HubSpot tickets based on selected filters, columns, and department. The response returns a downloadable file (Excel, CSV, or JSON) depending on the requested format.
- Requires authentication - If no format is specified, defaults to
xlsx.
POST
Export HubSpot tickets list
Exports HubSpot tickets based on selected filters, columns, and department. The response returns a downloadable file (Excel, CSV, or JSON) depending on the requested format. Requires authentication. If no format is specified, defaults to xlsx.
Body: Binary file content (Excel, CSV, or JSON format)
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
| Content-Type | string | Yes | application/json |
Request Body
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
| format | string | Yes | Output file format (xlsx, csv, json) |
| columns | array | Yes | List of ticket fields to include |
| departmentCode | string | No | Department code to filter tickets |
Field Details
format (enum)xlsx- Microsoft Excel formatcsv- Comma-separated values formatjson- JSON array format
- Available columns include:
ticketId,subject,content,feedbackCategory,agentInvolved,status,priority,createdAt,updatedAt,closedAt,departmentCode,passenger_name,passenger_email,passenger_phone,chauffeur_name,chauffeur_id,reservation_id,pickup_location,dropoff_location,scheduled_time,actual_time,delay_minutes,resolution_notes,tags
- Must be valid department code in system
- Filters exported tickets to specific department
- Optional - if omitted, exports all departments
Response
200 OK - Successfully generated export file
Headers:400 Bad Request
401 Unauthorized
500 Internal Server Error
Examples
Export to Excel with all columns
Export to CSV with specific columns
Export to JSON format
Implementation Examples
React Export Component
Vue.js Export Function
File Format Details
Excel (.xlsx)
- Structure: Worksheet with headers in first row
- Data Types: Dates formatted as Excel dates, numbers as numbers
- Features: Auto-sized columns, formatted headers
- Size: Typically smallest for large datasets
CSV (.csv)
- Structure: Comma-separated values with headers
- Encoding: UTF-8 with BOM for Excel compatibility
- Data Types: All values as strings
- Compatibility: Works with Excel, Google Sheets, etc.
JSON (.json)
- Structure: Array of ticket objects
- Data Types: Preserves original data types
- Format: Pretty-printed for readability
- Use Case: Programmatic processing and APIs
Best Practices
- Column Selection: Limit columns to reduce file size
- Department Filtering: Use department filter for targeted exports
- Format Choice: Choose format based on use case (Excel for analysis, CSV for data transfer, JSON for development)
- Error Handling: Handle export failures gracefully
- File Naming: Use descriptive filenames with timestamps
Performance Considerations
- Data Volume: Large exports may take significant time
- Memory Usage: Server memory usage scales with data size
- Network: File download time depends on file size
- Timeouts: Very large exports may hit timeout limits
Related Endpoints
- Use
/hubspot/tickets/listto preview data before export - Use
/hubspot/tickets/list/filtersto understand available data - Use
/hubspot/ticket-details/{ticketId}for detailed ticket information
Notes
- Export includes all tickets matching department filter
- File is generated dynamically on request
- Export processing time depends on data volume
- Files are not stored permanently on server
- Maximum export size may be limited by server configuration
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Output file format. Must be one of: - xlsx for Excel - csv for CSV - json for JSON
Available options:
xlsx, csv, json Example:
"xlsx"
List of ticket fields to include in the export.
Example:
[
"ticketId",
"subject",
"feedbackCategory",
"agentInvolved",
"createdAt"
]
Optional department code to filter exported tickets. Must be a valid department code.
Example:
"OPS"
Response
Successfully generated export file
Downloadable export file (Excel, CSV, or JSON)