POST
/
v1
/
call-analysis
import Roark from '@roarkanalytics/sdk';

const client = new Roark({
  bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});

async function main() {
  const callAnalysis = await client.callAnalysis.create({
    callDirection: 'INBOUND',
    interfaceType: 'PHONE',
    participants: [{ role: 'AGENT' }, { role: 'AGENT' }],
    recordingUrl: 'https://example.com/recording.wav',
    startedAt: '2025-03-29T11:13:51.025Z',
  });

  console.log(callAnalysis.data);
}

main();
{
  "data": {
    "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "PENDING",
    "call": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "IN_PROGRESS",
      "summary": "<string>",
      "callDirection": "INBOUND",
      "startedAt": "<string>",
      "endedAt": "<string>",
      "durationMs": 123,
      "endedReason": "<string>",
      "isTest": false,
      "participants": [
        {
          "name": "<string>",
          "phoneNumber": "<string>",
          "role": "AGENT",
          "spokeFirst": true,
          "isSimulated": true
        }
      ],
      "properties": {}
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Call analysis creation payload

recordingUrl
string
required

URL of source recording (must be an accessible WAV or MP3 file). Can be a signed URL.

startedAt
string
required

When the call started (ISO 8601 format)

interfaceType
enum<string>
required

Interface type of the call (PHONE or WEB)

Available options:
PHONE,
WEB
callDirection
enum<string>
required

Direction of the call (INBOUND or OUTBOUND)

Available options:
INBOUND,
OUTBOUND
participants
object[]
required

Exactly two participants in the call

stereoRecordingUrl
string

URL of source stereo recording in WAV format. Must be accessible. Can be a signed URL. While optional it allows for a richer audio player

endedReason
string

Reason why the call ended (optional)

toolInvocations
object[]

List of tool invocations made during the call

isTest
boolean

Whether this is a test call

vapiCallId
string

Vapi call ID if call is being imported from Vapi

retellCallId
string

Retell call ID if call is being imported from Retell

properties
object

Custom properties to include with the call. These can be used for filtering and will show in the call details page

Response

200 - application/json
Created call analysis job
data
object
required

Analysis job with associated call context