Submit an asynchronous query
Public beta
Conversation Insights, including the APIs, is currently available as a public beta release and the information contained in this document is subject to change. Some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Conversation Insights is not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
POST/v3/InsightsDomains/Conversations/QueryJobs
Base url: https://insights.twilio.com (base url)
Submit a long-running semantic query against the Conversations domain. Returns 202 Accepted with an operationId and a Location header pointing to the QueryJobs status endpoint for polling.
A client-generated UUIDv7 key that ensures idempotent behavior. Submitting the same key with an identical request returns the same operation without re-execution. Scoped to Account + Region. Retained for 24 hours.
01890a5d-aa0f-7c80-b8e6-0242ac140004application/jsonStructured query definition that specifies what data to retrieve and how to filter, group, and order it
Async query accepted
The unique identifier for the asynchronous query operation, in TTID format.
proc_job_01h9d8r0vte3hz8tykdj329t7rThe valid status values for long-running operations.
PENDINGRUNNINGCANCELLEDCOMPLETEDFAILEDThe URI to poll for operation status.
https://insights.twilio.com/v3/InsightsDomains/Conversations/QueryJobs/proc_job_01h9d8r0vte3hz8tykdj329t7rThe time when the operation was accepted, in RFC 3339 UTC format.
2026-05-25T14:30:00Z1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createQueryJob() {11const queryJob = await client.insights.v3.queryJobs.create({12query: {13measures: ["measures"],14dimensions: ["dimensions"],15filters: [16{17op: "AND",18expressions: [19{20op: "IN",21field: "field",22values: ["values"],23},24],25},26],27orderBy: [28{29field: "field",30direction: "DESC",31},32],33},34});3536console.log(queryJob.operationId);37}3839createQueryJob();
Response
1{2"operationId": "proc_job_01h9d8r0vte3hz8tykdj329t7r",3"status": "PENDING",4"statusUrl": "https://insights.twilio.com/v3/InsightsDomains/Conversations/QueryJobs/proc_job_01h9d8r0vte3hz8tykdj329t7r",5"createdAt": "2026-05-25T14:30:00Z"6}