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.simulationJob.lookup({ roarkPhoneNumber: 'roarkPhoneNumber' });
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.simulation_job.lookup(
roark_phone_number="roarkPhoneNumber",
)
print(response.data)curl --request GET \
--url https://api.roark.ai/v1/simulation/job/lookup \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/job/lookup",
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/simulation/job/lookup"
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/simulation/job/lookup")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/job/lookup")
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": {
"simulationJobId": "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",
"status": "COMPLETED",
"processingStatus": "PROCESSED",
"callId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"roarkPhoneNumber": "+15551234567",
"runPlan": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Billing Flow Test",
"variables": {
"promptToUse": "v1",
"accountTier": "premium"
}
},
"enrichment": {
"requested": true,
"outcome": "TIMED_OUT",
"waitStartedAt": "2025-01-15T14:28:32.789Z",
"waitEndedAt": "2025-01-15T14:43:32.789Z",
"metricsScoredOnSimulationInstead": 4,
"metricsNotCollected": 1
},
"invalidation": null,
"persona": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Sarah Johnson - Anxious Patient",
"displayName": "Anxious Patient",
"language": "EN",
"secondaryLanguage": null,
"understoodLanguages": [
"EN"
],
"accent": "US",
"age": "ADULT",
"gender": "FEMALE",
"backgroundNoise": "OFFICE",
"speechPace": "NORMAL",
"speechClarity": "CLEAR",
"hasDisfluencies": false,
"baseEmotion": "FRUSTRATED",
"intentClarity": "CLEAR",
"confirmationStyle": "EXPLICIT",
"memoryReliability": "HIGH",
"responseTiming": "NORMAL",
"backstoryPrompt": "A busy professional calling during lunch break",
"idleMessages": null,
"idleTimeoutSeconds": 10,
"idleMessageMaxSpokenCount": 3,
"idleMessageResetCountOnUserSpeechEnabled": true,
"properties": {
"age": "35",
"zipCode": "94105"
},
"createdAt": "2025-01-10T12:00:00.000Z",
"updatedAt": "2025-01-10T12:00:00.000Z"
},
"scenario": {
"id": "f8e7d6c5-b4a3-9281-7069-5f4e3d2c1b0a",
"description": "Patient calling to schedule an urgent dental appointment due to severe tooth pain"
},
"agentEndpoint": {
"id": "3c2b1a09-8f7e-6d5c-4b3a-291807060504",
"name": "PHONE",
"phoneNumber": "+15555551234",
"type": "PHONE"
},
"createdAt": "2025-01-15T14:23:45.123Z",
"startedAt": "2025-01-15T14:24:15.456Z",
"completedAt": "2025-01-15T14:28:32.789Z"
}
}{
"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"
}Simulation Job
Lookup by phone number
Find the matching simulation using the number used by the Roark simulation agent.
GET
/
v1
/
simulation
/
job
/
lookup
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.simulationJob.lookup({ roarkPhoneNumber: 'roarkPhoneNumber' });
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.simulation_job.lookup(
roark_phone_number="roarkPhoneNumber",
)
print(response.data)curl --request GET \
--url https://api.roark.ai/v1/simulation/job/lookup \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roark.ai/v1/simulation/job/lookup",
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/simulation/job/lookup"
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/simulation/job/lookup")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roark.ai/v1/simulation/job/lookup")
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": {
"simulationJobId": "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f",
"status": "COMPLETED",
"processingStatus": "PROCESSED",
"callId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"roarkPhoneNumber": "+15551234567",
"runPlan": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Billing Flow Test",
"variables": {
"promptToUse": "v1",
"accountTier": "premium"
}
},
"enrichment": {
"requested": true,
"outcome": "TIMED_OUT",
"waitStartedAt": "2025-01-15T14:28:32.789Z",
"waitEndedAt": "2025-01-15T14:43:32.789Z",
"metricsScoredOnSimulationInstead": 4,
"metricsNotCollected": 1
},
"invalidation": null,
"persona": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Sarah Johnson - Anxious Patient",
"displayName": "Anxious Patient",
"language": "EN",
"secondaryLanguage": null,
"understoodLanguages": [
"EN"
],
"accent": "US",
"age": "ADULT",
"gender": "FEMALE",
"backgroundNoise": "OFFICE",
"speechPace": "NORMAL",
"speechClarity": "CLEAR",
"hasDisfluencies": false,
"baseEmotion": "FRUSTRATED",
"intentClarity": "CLEAR",
"confirmationStyle": "EXPLICIT",
"memoryReliability": "HIGH",
"responseTiming": "NORMAL",
"backstoryPrompt": "A busy professional calling during lunch break",
"idleMessages": null,
"idleTimeoutSeconds": 10,
"idleMessageMaxSpokenCount": 3,
"idleMessageResetCountOnUserSpeechEnabled": true,
"properties": {
"age": "35",
"zipCode": "94105"
},
"createdAt": "2025-01-10T12:00:00.000Z",
"updatedAt": "2025-01-10T12:00:00.000Z"
},
"scenario": {
"id": "f8e7d6c5-b4a3-9281-7069-5f4e3d2c1b0a",
"description": "Patient calling to schedule an urgent dental appointment due to severe tooth pain"
},
"agentEndpoint": {
"id": "3c2b1a09-8f7e-6d5c-4b3a-291807060504",
"name": "PHONE",
"phoneNumber": "+15555551234",
"type": "PHONE"
},
"createdAt": "2025-01-15T14:23:45.123Z",
"startedAt": "2025-01-15T14:24:15.456Z",
"completedAt": "2025-01-15T14:28:32.789Z"
}
}{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Phone number provisioned by Roark for the simulation job in E.164 format. In the case of an inbound simulation, this is the number that calls your agent; in the case of an outbound simulation, this is the number you call from your agent.
ISO 8601 timestamp of when the call was received. Alternatively, any time between the start and end of the call is valid. Defaults to the current time, which fetches any jobs that are currently ongoing.
Response
Successfully found simulation job
Simulation job with related entities
Show child attributes
Show child attributes
Example:
{ "simulationJobId": "7f3e4d2c-8a91-4b5c-9e6f-1a2b3c4d5e6f", "status": "COMPLETED", "processingStatus": "PROCESSED", "callId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "roarkPhoneNumber": "+15551234567", "runPlan": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "name": "Billing Flow Test", "variables": { "promptToUse": "v1", "accountTier": "premium" } }, "enrichment": { "requested": true, "outcome": "TIMED_OUT", "waitStartedAt": "2025-01-15T14:28:32.789Z", "waitEndedAt": "2025-01-15T14:43:32.789Z", "metricsScoredOnSimulationInstead": 4, "metricsNotCollected": 1 }, "invalidation": null, "persona": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Sarah Johnson - Anxious Patient", "displayName": "Anxious Patient", "language": "EN", "secondaryLanguage": null, "understoodLanguages": ["EN"], "accent": "US", "age": "ADULT", "gender": "FEMALE", "backgroundNoise": "OFFICE", "speechPace": "NORMAL", "speechClarity": "CLEAR", "hasDisfluencies": false, "baseEmotion": "FRUSTRATED", "intentClarity": "CLEAR", "confirmationStyle": "EXPLICIT", "memoryReliability": "HIGH", "responseTiming": "NORMAL", "backstoryPrompt": "A busy professional calling during lunch break", "idleMessages": null, "idleTimeoutSeconds": 10, "idleMessageMaxSpokenCount": 3, "idleMessageResetCountOnUserSpeechEnabled": true, "properties": { "age": "35", "zipCode": "94105" }, "createdAt": "2025-01-10T12:00:00.000Z", "updatedAt": "2025-01-10T12:00:00.000Z" }, "scenario": { "id": "f8e7d6c5-b4a3-9281-7069-5f4e3d2c1b0a", "description": "Patient calling to schedule an urgent dental appointment due to severe tooth pain" }, "agentEndpoint": { "id": "3c2b1a09-8f7e-6d5c-4b3a-291807060504", "name": "PHONE", "phoneNumber": "+15555551234", "type": "PHONE" }, "createdAt": "2025-01-15T14:23:45.123Z", "startedAt": "2025-01-15T14:24:15.456Z", "completedAt": "2025-01-15T14:28:32.789Z" }