Skip to contentSkip to navigationSkip to topbar

Retrieve asynchronous query status and results


(new)

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(link takes you to an external page). If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.

GET/v3/InsightsDomains/Conversations/QueryJobs/{operationId}

Base url: https://insights.twilio.com (base url)

Poll the operation status. When status is COMPLETED, the response includes query results inline. When FAILED, the response includes error details conforming to the OperationError schema.


Request

fetch-query-job-status-request page anchor

Authentication

authentication page anchor
Property nameTypeRequiredPIIDescription
operationIdstring<Proc_JobTtid>
required
Not PII

The unique identifier for the asynchronous query operation, in TTID format.

Example: proc_job_01h9d8r0vte3hz8tykdj329t7r

200404429500

Operation status (may include results if COMPLETED)

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
operationIdstring<Proc_JobTtid>

Optional

The unique identifier for the asynchronous query operation, in TTID format.

Example: proc_job_01h9d8r0vte3hz8tykdj329t7r

statusenum<string>

Optional

The valid status values for long-running operations.

Possible values:
PENDINGRUNNINGCANCELLEDCOMPLETEDFAILED

statusUrlstring<uri>

Optional

Example: https://insights.twilio.com/v3/InsightsDomains/Conversations/QueryJobs/proc_job_01h9d8r0vte3hz8tykdj329t7r

createdAtstring<date-time>

Optional

Example: 2026-05-25T14:30:00Z

completedAtstring<date-time>

Optional

The time when the operation reached a terminal state (CANCELLED, COMPLETED, or FAILED), in RFC 3339 UTC format. Null while the operation is still PENDING or RUNNING.

Example: 2026-05-25T14:32:17Z

errorobject

Optional

The error details, present only when status is FAILED.


resultUrlstring<uri>

Optional

The URL to retrieve query results, present only when status is COMPLETED. Supports pagination via the pageSize and pageToken query parameters.

Example: https://insights.twilio.com/v3/InsightsDomains/Conversations/QueryJobs/proc_job_01h9d8r0vte3hz8tykdj329t7r/Results

resultIdstring

Optional

The identifier of the results resource, present only when status is COMPLETED. Equal to operationId, since results are keyed by the operation ID.

Example: proc_job_01h9d8r0vte3hz8tykdj329t7r

resultRetentionPeriodstring<duration>

Optional

The duration for how long results are retained, in ISO 8601 format.

Example: P7D
Retrieve asynchronous query status and resultsLink to code sample: Retrieve asynchronous query status and results
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchQueryJobStatus() {
11
const queryJob = await client.insights.v3.queryJobs("operationId").fetch();
12
13
console.log(queryJob.operationId);
14
}
15
16
fetchQueryJobStatus();

Response

Note about this response
1
{
2
"operationId": "proc_job_01h9d8r0vte3hz8tykdj329t7r",
3
"status": "RUNNING",
4
"createdAt": "2026-05-25T14:30:00Z",
5
"statusUrl": "https://insights.twilio.com/v3/InsightsDomains/Conversations/QueryJobs/proc_job_01h9d8r0vte3hz8tykdj329t7r"
6
}