Skip to main content
POST
/
api
/
v1
/
callresults
/
search
Search CallResult data with advanced filtering and aggregations
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    page: 123,
    size: 50,
    agentIds: ['<string>'],
    callStatuses: ['Unknown'],
    fromDate: '2023-11-07T05:31:56Z',
    toDate: '2023-11-07T05:31:56Z',
    searchText: '<string>',
    callIds: ['<string>'],
    endpoint: '<string>',
    additionalDataFilters: {},
    sortField: '<string>',
    sortDirection: 'Ascending',
    includeAggregations: true,
    aggregationFields: ['<string>']
  })
};

fetch('https://blackbox.dasha.ai/api/v1/callresults/search', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "results": [
    {
      "callId": "<string>",
      "agentId": "<string>",
      "orgId": "<string>",
      "callAdditionalData": {},
      "callStatus": "Unknown",
      "callType": "Unknown",
      "completedTime": "2023-11-07T05:31:56Z",
      "createdTime": "2023-11-07T05:31:56Z",
      "durationSeconds": 123,
      "endpoint": "<string>",
      "sip": "<unknown>",
      "result": "<unknown>",
      "transcription": [
        "<unknown>"
      ],
      "serverJobId": "<string>",
      "errorMessage": "<string>",
      "inspectorUrl": "<string>",
      "recordingUrl": "<string>",
      "score": 123,
      "highlights": {}
    }
  ],
  "totalCount": 123,
  "page": 123,
  "size": 123,
  "totalPages": 123,
  "executionTimeMs": 123,
  "aggregations": {
    "statusCounts": {},
    "agentCounts": {},
    "endpointCounts": {},
    "dateHistogram": [
      {
        "date": "2023-11-07T05:31:56Z",
        "count": 123
      }
    ],
    "customAggregations": {}
  }
}

Body

Search request with filters, pagination, and aggregation options

DTO for CallResult search requests

page
integer<int32>

Page number (0-based)

size
integer<int32>

Page size (max 100)

Required range: 1 <= x <= 100
agentIds
string[] | null

Filter by specific agent IDs

callStatuses
enum<string>[] | null

Filter by call statuses

Available options:
Unknown,
Created,
Pending,
Queued,
Completed,
Failed,
Canceled,
Running
fromDate
string<date-time> | null

Filter by date range - start date

toDate
string<date-time> | null

Filter by date range - end date

searchText
string | null

Free text search across call data

callIds
string[] | null

Specific call IDs to search for

endpoint
string | null

Filter by endpoint

additionalDataFilters
object

Search within call additional data (JSON search)

sortField
string | null

Sort field

sortDirection
enum<string>

Sort direction

Available options:
Ascending,
Descending
includeAggregations
boolean

Include aggregations in response

aggregationFields
string[] | null

Custom aggregation fields to include

Response

Returns search results

DTO for CallResult search responses

results
object[]
required

Search results

totalCount
integer<int64>
required

Total number of results found

page
integer<int32>
required

Current page number (0-based)

size
integer<int32>
required

Page size

totalPages
integer<int32>
required

Total number of pages

executionTimeMs
integer<int64>
required

Search execution time in milliseconds

aggregations
object

Search aggregations (if requested)