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-02-11T01:04:32.737Z',
  });

  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
        }
      ]
    }
  }
}

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 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)

isTest
boolean

Whether this is a test call

Response

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

Analysis job with associated call context