JavaScript
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.liveReport.getDocument('9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b', {
reportId: '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
});
console.log(response.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
response = client.live_report.get_document(
"9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b",
report_id="5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
)
print(response.data)curl --request GET \
--url https://api.roark.ai/v1/live-report/{reportId}/document/{documentId} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"liveReportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodStart": "<string>",
"periodEnd": "<string>",
"timezone": "<string>",
"cadence": "DAILY",
"trigger": "SCHEDULED",
"definition": {
"name": "<string>",
"description": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentName": "<string>",
"filters": [
{
"type": "METRIC_PROPERTY",
"property": "<string>",
"operator": "EQUALS",
"value": "<string>"
}
],
"targets": [
{
"metric": "<string>",
"value": 123,
"aggregation": "PASS_RATE",
"percentile": 50,
"passOperator": "EQUALS",
"passValue": "<string>",
"comparator": "AT_LEAST",
"label": "<string>"
}
],
"dashboardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeTranscriptExcerpts": true
},
"status": "PENDING",
"document": {
"version": 1,
"generatedAtIso": "<string>",
"model": "<string>",
"liveReportId": "<string>",
"headline": {
"reportName": "<string>",
"periodLabel": "<string>",
"periodStartIso": "<string>",
"periodEndIso": "<string>",
"timezone": "<string>",
"cadence": "DAILY",
"agentName": "<string>",
"verdict": "ON_TARGET",
"verdictProse": "<string>",
"statTiles": [
{
"label": "<string>",
"value": "<string>",
"sub": "<string>",
"deltaDirection": "POSITIVE"
}
]
},
"executiveSummary": {
"paragraphs": [
"<string>"
],
"keyFindings": [
{
"title": "<string>",
"body": "<string>",
"calls": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": null
}
]
}
],
"sections": [
{
"heading": "<string>",
"body": "<string>"
}
]
},
"targets": [
{
"key": "<string>",
"label": "<string>",
"metricName": "<string>",
"metricSlug": "<string>",
"metricDefinitionId": "<string>",
"aggregation": "PASS_RATE",
"percentile": 123,
"comparator": "AT_LEAST",
"unit": "PERCENT",
"targetValue": 123,
"targetLabel": "<string>",
"actual": 123,
"actualLabel": "<string>",
"previous": 123,
"previousLabel": "<string>",
"deltaLabel": "<string>",
"deltaDirection": "POSITIVE",
"sampleSize": 123,
"status": "MET",
"lifecycle": "NEW_MISS",
"failingConversationCount": 123,
"series": [
{
"date": "<string>",
"value": 123,
"sampleSize": 123
}
],
"error": "<string>"
}
],
"checks": [
{
"metricDefinitionId": "<string>",
"metricSlug": "<string>",
"checkName": "<string>",
"passRatePct": 123,
"previousPassRatePct": 123,
"deltaPts": 123,
"evaluatedCount": 123,
"failedCount": 123,
"comparable": true,
"isTarget": true
}
],
"volume": {
"conversationCount": 123,
"previousConversationCount": 123,
"deltaPct": 123,
"series": [
{
"date": "<string>",
"value": 123,
"sampleSize": 123
}
],
"endings": [
{
"value": "<string>",
"label": "<string>",
"count": 123,
"sharePct": 123
}
]
},
"agents": [
{
"agentId": "<string>",
"agentName": "<string>",
"conversationCount": 123,
"sharePct": 123,
"targets": [
{
"key": "<string>",
"actual": 123,
"actualLabel": "<string>",
"status": "MET"
}
]
}
],
"themes": [
{
"slug": "<string>",
"title": "<string>",
"severity": "HIGH",
"impact": null,
"impactReason": null,
"prevalence": null,
"flaggedForImpact": false,
"lifecycle": "NEW",
"affectedConversationCount": 123,
"totalConversationCount": 123,
"checkNames": [
"<string>"
],
"metricDefinitionIds": [
"<string>"
],
"rootCauseChannel": "PROMPT",
"analysis": "<string>",
"memberConversationIds": [
"<string>"
],
"excerpts": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"scenarioName": "<string>",
"caption": "<string>",
"turns": [
{
"role": "AGENT",
"offsetMs": 123,
"text": "<string>",
"flagged": true,
"flagNote": "<string>"
}
]
}
],
"collectorQuote": {
"conversationId": "<string>",
"metricName": "<string>",
"quote": "<string>"
},
"estimatedAffectedConversationCount": 123,
"issue": {
"id": "<string>",
"title": "<string>",
"status": "<string>",
"firstSeenAtIso": "<string>"
},
"memberCalls": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": null
}
]
}
],
"recommendations": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"source": "PROMPT_OPTIMIZER",
"channel": "PROMPT",
"severity": "HIGH",
"promptOptimizationFindingId": "<string>",
"beforeText": "<string>",
"afterText": "<string>",
"themeSlugs": [
"<string>"
]
}
],
"charts": [
{
"name": "<string>",
"description": "<string>",
"display": "LINE",
"interval": "HOUR",
"series": [
{
"measureIndex": 123,
"type": "METRIC",
"metric": "<string>",
"aggregation": "COUNT",
"breakdownValue": "<string>",
"comparisonGroup": "<string>",
"value": 123,
"sampleSize": 123,
"comparisonValue": 123,
"percentageOfBaseline": 123,
"buckets": [
{
"date": "<string>",
"value": 123,
"passed": 123,
"sampleSize": 123,
"comparisonDate": "<string>",
"comparisonValue": 123,
"percentageOfBaseline": 123
}
]
}
],
"omittedSeries": 123,
"blocked": true,
"error": "<string>"
}
],
"evidence": {
"failingConversationCount": 123,
"readConversationCount": 123,
"sampled": true,
"failingCountIsLowerBound": false
},
"appendix": {
"methodology": "<string>",
"notes": [
"<string>"
]
}
},
"errorMessage": "<string>",
"announcedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>"
}
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "not_found",
"code": "resource_not_found",
"message": "The requested resource could not be found"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}Live Report
Get a report document
Returns one written report. document is null until status is READY. Theme excerpts and grader quotes (call transcript text) are included only for keys with transcript:read.
GET
/
v1
/
live-report
/
{reportId}
/
document
/
{documentId}
JavaScript
import Roark from '@roarkanalytics/sdk';
const client = new Roark({
bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});
const response = await client.liveReport.getDocument('9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b', {
reportId: '5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f',
});
console.log(response.data);import os
from roark_analytics import Roark
client = Roark(
bearer_token=os.environ.get("ROARK_API_BEARER_TOKEN"), # This is the default and can be omitted
)
response = client.live_report.get_document(
"9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b",
report_id="5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f",
)
print(response.data)curl --request GET \
--url https://api.roark.ai/v1/live-report/{reportId}/document/{documentId} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/live-report/{reportId}/document/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"liveReportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"periodStart": "<string>",
"periodEnd": "<string>",
"timezone": "<string>",
"cadence": "DAILY",
"trigger": "SCHEDULED",
"definition": {
"name": "<string>",
"description": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentName": "<string>",
"filters": [
{
"type": "METRIC_PROPERTY",
"property": "<string>",
"operator": "EQUALS",
"value": "<string>"
}
],
"targets": [
{
"metric": "<string>",
"value": 123,
"aggregation": "PASS_RATE",
"percentile": 50,
"passOperator": "EQUALS",
"passValue": "<string>",
"comparator": "AT_LEAST",
"label": "<string>"
}
],
"dashboardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"includeTranscriptExcerpts": true
},
"status": "PENDING",
"document": {
"version": 1,
"generatedAtIso": "<string>",
"model": "<string>",
"liveReportId": "<string>",
"headline": {
"reportName": "<string>",
"periodLabel": "<string>",
"periodStartIso": "<string>",
"periodEndIso": "<string>",
"timezone": "<string>",
"cadence": "DAILY",
"agentName": "<string>",
"verdict": "ON_TARGET",
"verdictProse": "<string>",
"statTiles": [
{
"label": "<string>",
"value": "<string>",
"sub": "<string>",
"deltaDirection": "POSITIVE"
}
]
},
"executiveSummary": {
"paragraphs": [
"<string>"
],
"keyFindings": [
{
"title": "<string>",
"body": "<string>",
"calls": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": null
}
]
}
],
"sections": [
{
"heading": "<string>",
"body": "<string>"
}
]
},
"targets": [
{
"key": "<string>",
"label": "<string>",
"metricName": "<string>",
"metricSlug": "<string>",
"metricDefinitionId": "<string>",
"aggregation": "PASS_RATE",
"percentile": 123,
"comparator": "AT_LEAST",
"unit": "PERCENT",
"targetValue": 123,
"targetLabel": "<string>",
"actual": 123,
"actualLabel": "<string>",
"previous": 123,
"previousLabel": "<string>",
"deltaLabel": "<string>",
"deltaDirection": "POSITIVE",
"sampleSize": 123,
"status": "MET",
"lifecycle": "NEW_MISS",
"failingConversationCount": 123,
"series": [
{
"date": "<string>",
"value": 123,
"sampleSize": 123
}
],
"error": "<string>"
}
],
"checks": [
{
"metricDefinitionId": "<string>",
"metricSlug": "<string>",
"checkName": "<string>",
"passRatePct": 123,
"previousPassRatePct": 123,
"deltaPts": 123,
"evaluatedCount": 123,
"failedCount": 123,
"comparable": true,
"isTarget": true
}
],
"volume": {
"conversationCount": 123,
"previousConversationCount": 123,
"deltaPct": 123,
"series": [
{
"date": "<string>",
"value": 123,
"sampleSize": 123
}
],
"endings": [
{
"value": "<string>",
"label": "<string>",
"count": 123,
"sharePct": 123
}
]
},
"agents": [
{
"agentId": "<string>",
"agentName": "<string>",
"conversationCount": 123,
"sharePct": 123,
"targets": [
{
"key": "<string>",
"actual": 123,
"actualLabel": "<string>",
"status": "MET"
}
]
}
],
"themes": [
{
"slug": "<string>",
"title": "<string>",
"severity": "HIGH",
"impact": null,
"impactReason": null,
"prevalence": null,
"flaggedForImpact": false,
"lifecycle": "NEW",
"affectedConversationCount": 123,
"totalConversationCount": 123,
"checkNames": [
"<string>"
],
"metricDefinitionIds": [
"<string>"
],
"rootCauseChannel": "PROMPT",
"analysis": "<string>",
"memberConversationIds": [
"<string>"
],
"excerpts": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"scenarioName": "<string>",
"caption": "<string>",
"turns": [
{
"role": "AGENT",
"offsetMs": 123,
"text": "<string>",
"flagged": true,
"flagNote": "<string>"
}
]
}
],
"collectorQuote": {
"conversationId": "<string>",
"metricName": "<string>",
"quote": "<string>"
},
"estimatedAffectedConversationCount": 123,
"issue": {
"id": "<string>",
"title": "<string>",
"status": "<string>",
"firstSeenAtIso": "<string>"
},
"memberCalls": [
{
"conversationId": "<string>",
"callId": "<string>",
"personaName": "<string>",
"cueMs": null
}
]
}
],
"recommendations": [
{
"order": 123,
"title": "<string>",
"body": "<string>",
"source": "PROMPT_OPTIMIZER",
"channel": "PROMPT",
"severity": "HIGH",
"promptOptimizationFindingId": "<string>",
"beforeText": "<string>",
"afterText": "<string>",
"themeSlugs": [
"<string>"
]
}
],
"charts": [
{
"name": "<string>",
"description": "<string>",
"display": "LINE",
"interval": "HOUR",
"series": [
{
"measureIndex": 123,
"type": "METRIC",
"metric": "<string>",
"aggregation": "COUNT",
"breakdownValue": "<string>",
"comparisonGroup": "<string>",
"value": 123,
"sampleSize": 123,
"comparisonValue": 123,
"percentageOfBaseline": 123,
"buckets": [
{
"date": "<string>",
"value": 123,
"passed": 123,
"sampleSize": 123,
"comparisonDate": "<string>",
"comparisonValue": 123,
"percentageOfBaseline": 123
}
]
}
],
"omittedSeries": 123,
"blocked": true,
"error": "<string>"
}
],
"evidence": {
"failingConversationCount": 123,
"readConversationCount": 123,
"sampled": true,
"failingCountIsLowerBound": false
},
"appendix": {
"methodology": "<string>",
"notes": [
"<string>"
]
}
},
"errorMessage": "<string>",
"announcedAt": "<string>",
"completedAt": "<string>",
"createdAt": "<string>"
}
}{
"type": "authentication",
"code": "unauthorized",
"message": "Authentication required"
}{
"type": "forbidden",
"code": "permission_denied",
"message": "You do not have permission to access this resource"
}{
"type": "not_found",
"code": "resource_not_found",
"message": "The requested resource could not be found"
}{
"type": "rate_limit",
"code": "too_many_requests",
"message": "Rate limit exceeded"
}{
"type": "internal",
"code": "internal_error",
"message": "Internal server error"
}