Skip to main content
POST
/
api
/
v1
/
callresults
/
search
Search call results
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": {}
  }
}

Search Capabilities

  • Date range filtering: Filter by creation or completion time
  • Status filtering: Filter by call status (Completed, Failed, etc.)
  • Agent filtering: Search calls for specific agents
  • Full-text search: Search across call transcripts and metadata
  • Nested JSON queries: Query custom fields in call additional data
  • Aggregations: Get statistics grouped by custom fields
  • Sorting: Sort by any field with ascending/descending order

Search Examples

{
  "page": 0,
  "size": 20,
  "fromDate": "2024-01-01T00:00:00Z",
  "toDate": "2024-01-31T23:59:59Z",
  "callStatuses": ["Completed", "Failed"],
  "includeAggregations": true
}

Use Cases

  • Analytics dashboards: Aggregate call data by custom metrics
  • Quality assurance: Search calls by sentiment or specific keywords
  • Compliance auditing: Filter calls by date range and status
  • Custom reporting: Query nested JSON fields from post-call analysis

Body

Search criteria and options

Search parameters for querying completed call results with flexible filtering, pagination, and aggregation options. Enables searching call history by various criteria including agent, status, date range, and custom data fields for analytics and reporting.

page
integer<int32>

Page number for pagination, using 0-based indexing where 0 is the first page. Defaults to 0 to return the first page of results.

size
integer<int32>

Number of call results to return per page. Defaults to 20, allowing you to balance between fewer requests and manageable response sizes.

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

Filter results to calls handled by specific agents. When specified, only returns calls from the listed agents. Useful for analyzing individual agent performance or filtering to specific use cases.

callStatuses
enum<string>[] | null

Filter results by call completion status. When specified, only returns calls with matching statuses (Completed, Failed, Canceled, etc.). Useful for analyzing success rates or investigating failed calls.

Current status of a call in its lifecycle. Tracks the call's progress from creation through completion or failure.

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

Start of date range for filtering call results by completion time. Only returns calls completed on or after this timestamp. Combine with ToDate for specific time period analysis.

toDate
string<date-time> | null

End of date range for filtering call results by completion time. Only returns calls completed on or before this timestamp. Combine with FromDate for specific time period analysis.

searchText
string | null

Free-text search query that searches across multiple call fields including transcriptions, additional data, endpoints, and other text content. Uses full-text search capabilities for natural language queries.

callIds
string[] | null

Filter results to specific call IDs. When specified, only returns calls with matching identifiers. Useful for retrieving exact calls or investigating specific customer interactions.

endpoint
string | null

Filter results by the called endpoint (phone number or SIP address). Only returns calls to the specified destination. Useful for analyzing calls to specific numbers or SIP endpoints.

additionalDataFilters
object

Filter results by values in the call's additional data fields. Allows querying custom business data passed to calls, enabling searches like finding all calls with specific customer IDs, order numbers, or campaign tags.

sortField
string | null

Field name to sort results by. Common values include "completedTime" (when the call ended), "createdTime" (when the call was queued), "durationSeconds" (call length). Defaults to "completedTime" to show most recent calls first when using descending order.

sortDirection
enum<string>

Direction to sort results. Use Descending (default) to show newest or highest values first, or Ascending to show oldest or lowest values first.

Available options:
Ascending,
Descending
includeAggregations
boolean

Whether to include aggregated statistics in the response. When true, the response includes counts by status, agent, endpoint, and time periods. Useful for dashboards and analytics without requiring separate aggregation queries.

aggregationFields
string[] | null

Custom fields to aggregate on in addition to standard aggregations. Allows creating custom breakdowns of call data by specific additional data fields or other call properties.

Response

Returns search results successfully

Search results for completed calls including pagination metadata, optional aggregations, and performance metrics. Contains all matching call records plus statistics for navigating large result sets and analyzing call patterns.

results
object[]
required

Call results in the current page. Each result includes call details, status, duration, transcription, recording links, and custom data. Results are ordered according to the search request's sort parameters.

totalCount
integer<int64>
required

Total number of calls matching the search criteria across all pages. Use this to calculate pagination metrics (total pages, progress indicators) and understand overall result volume.

page
integer<int32>
required

Current page number using 0-based indexing. Matches the Page parameter from the search request.

size
integer<int32>
required

Number of results per page. Matches the Size parameter from the search request.

totalPages
integer<int32>
required

Total number of pages available based on TotalCount and Size. Useful for building pagination controls and determining if more pages exist.

executionTimeMs
integer<int64>
required

Search execution time in milliseconds. Indicates query performance and can help identify slow searches that may benefit from more specific filters or indexing optimizations.

aggregations
object

Aggregated statistics about the search results including counts by status, agent, endpoint, and time periods. Only present when IncludeAggregations was true in the search request. Useful for dashboards and analytics without additional queries.