Skip to main content
POST
/
conversations
/
search
/
dsl
/
stats
Get Conversation Stats
curl --request POST \
  --url https://crm.uservox.ai/api/v1/conversations/search/dsl/stats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filter": {},
  "searchText": "<string>",
  "analytics": [
    {}
  ],
  "timezoneOffsetMinutes": 123
}
'
import requests

url = "https://crm.uservox.ai/api/v1/conversations/search/dsl/stats"

payload = {
"filter": {},
"searchText": "<string>",
"analytics": [{}],
"timezoneOffsetMinutes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {},
searchText: '<string>',
analytics: [{}],
timezoneOffsetMinutes: 123
})
};

fetch('https://crm.uservox.ai/api/v1/conversations/search/dsl/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://crm.uservox.ai/api/v1/conversations/search/dsl/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [

],
'searchText' => '<string>',
'analytics' => [
[

]
],
'timezoneOffsetMinutes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://crm.uservox.ai/api/v1/conversations/search/dsl/stats"

payload := strings.NewReader("{\n \"filter\": {},\n \"searchText\": \"<string>\",\n \"analytics\": [\n {}\n ],\n \"timezoneOffsetMinutes\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://crm.uservox.ai/api/v1/conversations/search/dsl/stats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {},\n \"searchText\": \"<string>\",\n \"analytics\": [\n {}\n ],\n \"timezoneOffsetMinutes\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://crm.uservox.ai/api/v1/conversations/search/dsl/stats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {},\n \"searchText\": \"<string>\",\n \"analytics\": [\n {}\n ],\n \"timezoneOffsetMinutes\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "total": 123,
  "analytics": {
    "avgTurns": 123,
    "avgDuration": 123,
    "analyzedCount": 123,
    "[custom spec name]": [
      {}
    ]
  },
  "source": "<string>"
}
Runs a DSL filter against your project’s conversations and returns aggregate metrics — counts and custom breakdowns — without returning individual conversation records or transcript content.

Body Parameters

filter
object
DSL filter object. Combine with and/or/not combinators, or a single { field, op, value } clause using operators like eq, neq, contains, in, between, exists. The project scope is applied automatically.
searchText
string
Free-text search across lead ID, stream ID, call SID, disposition, tags, and transcript content. A 10-digit value matches by phone hash; a 24-char hex string matches lead/conversation ID; a 32-char hex string matches stream ID or call SID.
analytics
array
Additional aggregation specs to compute alongside the base stats. Each entry is { name, type, field, limit? }:
  • type: "group_by" — counts grouped by distinct values of field (e.g. group by disposition), sorted descending, capped at limit (default 100).
  • type: "timeseries" — daily counts bucketed by field (a date field), respecting timezoneOffsetMinutes.
timezoneOffsetMinutes
integer
default:"0"
Timezone offset applied to timeseries bucketing.

Response

success
boolean
total
integer
Total matching conversations
analytics
object
source
string
elasticsearch or mongo-fallback

Example

{
  "filter": { "field": "dispositionType", "op": "eq", "value": "SUCCESS" },
  "analytics": [
    { "name": "byDisposition", "type": "group_by", "field": "disposition", "limit": 20 }
  ]
}
{
  "success": true,
  "total": 1422,
  "analytics": {
    "byDisposition": [
      { "key": "Retail", "count": 765 },
      { "key": "Booking Request", "count": 657 }
    ],
    "avgTurns": 11.5,
    "avgDuration": 44.7,
    "analyzedCount": 72493
  },
  "source": "elasticsearch"
}

Error Responses

  • 400 Bad Request — missing project scope.
  • 500 Internal Server Error{ "success": false, "message": "Failed to aggregate conversations", "error": "..." }

See Also

  • Conversations — browse and search conversations from the dashboard