Sessions

Export Sessions to CSV

get/session/export

Query parameters

idstring

This is the unique identifier for the session to filter by.

namestring

This is the name of the session to filter by.

assistantIdstring

This is the ID of the assistant to filter sessions by.

assistantIdAnystring
Example:assistant-1,assistant-2,assistant-3

Filter by multiple assistant IDs. Provide as comma-separated values.

squadIdstring

This is the ID of the squad to filter sessions by.

workflowIdstring

This is the ID of the workflow to filter sessions by.

numberE164CheckEnabledboolean

This is the flag to toggle the E164 check for the number field. This is an advanced property which should be used if you know your use case requires it.

Use cases:

  • false: To allow non-E164 numbers like +001234567890, 1234, or abc. This is useful for dialing out to non-E164 numbers on your SIP trunks.
  • true (default): To allow only E164 numbers like +14155551234. This is standard for PSTN calls.

If false, the number is still required to only contain alphanumeric characters (regex: /^\+?[a-zA-Z0-9]+$/).

@default true (E164 check is enabled)

extensionstring

This is the extension that will be dialed after the call is answered.

{"stackTrail":"paths:/session/export:get:parameters:8:schema","oasType":"schema","type":"unknown"}

These are the overrides for the assistant's settings and template variables specific to this customer. This allows customization of the assistant's behavior for individual customers in batch calls.

numberstring

This is the number of the customer.

sipUristring

This is the SIP URI of the customer.

namestring

This is the name of the customer. This is just for your own reference.

For SIP inbound calls, this is extracted from the From SIP header with format "Display Name" <sip:username@domain>.

emailstring

This is the email of the customer.

externalIdstring

This is the external ID of the customer.

customerNumberAnystring
Example:+1234567890,+0987654321

Filter by any of the specified customer phone numbers (comma-separated).

columns'id' | 'name' | 'status' | 'assistantId' | 'squadId' | 'customerName' | 'customerNumber' | 'phoneNumberId' | 'cost' | 'messages' | 'createdAt' | 'updatedAt'

Columns to include in the CSV export

emailstring

This is the email address to send the export to. Required if userId is not available in the request context.

format'csv' | 'json'

This is the format of the export.

@default csv

phoneNumberIdstring

This will return sessions with the specified phoneNumberId.

phoneNumberIdAnystring[]

This will return sessions with any of the specified phoneNumberIds.

pagenumber

This is the page number to return. Defaults to 1.

sortOrder'ASC' | 'DESC'

This is the sort order for pagination. Defaults to 'DESC'.

limitnumber

This is the maximum number of items to return. Defaults to 100.

createdAtGtstring date-time

This will return items where the createdAt is greater than the specified value.

createdAtLtstring date-time

This will return items where the createdAt is less than the specified value.

createdAtGestring date-time

This will return items where the createdAt is greater than or equal to the specified value.

createdAtLestring date-time

This will return items where the createdAt is less than or equal to the specified value.

updatedAtGtstring date-time

This will return items where the updatedAt is greater than the specified value.

updatedAtLtstring date-time

This will return items where the updatedAt is less than the specified value.

updatedAtGestring date-time

This will return items where the updatedAt is greater than or equal to the specified value.

updatedAtLestring date-time

This will return items where the updatedAt is less than or equal to the specified value.

Changes