v1

latestOpenAPI 3.0.1Apache 2.0raw.githubusercontent.com2026-05-063538.2 KB
TwilioInsights

Execute a semantic query

Execute a semantic query against the Conversations domain.

post/v3/InsightsDomains/Conversations/Query

Query parameters

pageSizeinteger
Example:20

Number of items per page

Request body

domainstring

The business domain to execute the query against

Example request

{
  "domain": "Conversations",
  "query": {
    "measures": [
      "OperatorResult.Count"
    ],
    "dimensions": [
      "DateCreated",
      "OperatorResults"
    ],
    "filters": [
      {
        "op": "AND",
        "expressions": [
          {
            "op": "IN",
            "field": "OperatorResult.Value",
            "values": [
              "positive",
              "negative"
            ]
          }
        ]
      }
    ],
    "orderBy": [
      {
        "field": "OperatorResults.CreatedDate",
        "direction": "DESC"
      }
    ]
  }
}

Response

Successful query response

domainstring

Indicates the business domain the query was executed against

itemsobject[]

Array of result objects containing the query results. Each object contains properties matching the requested measures and dimensions.

Example response

{
  "domain": "Insights",
  "items": [
    {
      "Id": "conv1",
      "Languages": [
        "en"
      ],
      "Channels": [
        "voice"
      ],
      "OperatorResult.Value": "positive"
    },
    {
      "Id": "conv2",
      "Languages": [
        "en",
        "es"
      ],
      "Channels": [
        "chat"
      ],
      "OperatorResult.Value": "negative"
    }
  ],
  "meta": {
    "key": "items",
    "pageSize": 20,
    "previousToken": "eyJwYWdlIjowLCJxdWVyeSI6ImJvb2tzIn0=",
    "nextToken": "eyJwYWdlIjoyLCJxdWVyeSI6ImJvb2tzIn0="
  }
}