Skip to main content
POST
/
v1
/
call
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 call = await client.call.create({
  callDirection: 'INBOUND',
  interfaceType: 'PHONE',
  recordingUrl: 'https://example.com',
  startedAt: 'startedAt',
});

console.log(call.data);
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "projectId": "660e8400-e29b-41d4-a716-446655440001",
    "status": "RINGING",
    "callDirection": "INBOUND",
    "startedAt": "2024-01-15T10:00:00Z",
    "agents": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "endpoint": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "environment": "<string>",
          "phoneNumberE164": "<string>"
        }
      }
    ],
    "customers": [
      {
        "phoneNumberE164": "<string>",
        "label": "<string>"
      }
    ],
    "createdAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Call creation payload. Supports singular (agent/customer) or plural (agents/customers) formats.

recordingUrl
string<uri>
required

URL of source recording (must be an accessible WAV, MP3, or MP4 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
stereoRecordingUrl
string<uri>

URL of source stereo recording. Must be accessible. Can be a signed URL. Supported formats: WAV, MP3, MP4.

endedStatus
enum<string>

High-level call end status, indicating how the call terminated

Available options:
PARTICIPANTS_DID_NOT_SPEAK,
AGENT_DID_NOT_ANSWER,
AGENT_DID_NOT_SPEAK,
AGENT_STOPPED_SPEAKING,
AGENT_ENDED_CALL,
AGENT_TRANSFERRED_CALL,
AGENT_BUSY,
AGENT_ERROR,
CUSTOMER_ENDED_CALL,
VOICE_MAIL_REACHED,
SILENCE_TIME_OUT,
PHONE_CALL_PROVIDER_CONNECTION_ERROR,
CUSTOMER_DID_NOT_ANSWER,
CUSTOMER_DID_NOT_SPEAK,
CUSTOMER_STOPPED_SPEAKING,
CUSTOMER_BUSY,
DIAL_ERROR,
MAX_DURATION_REACHED,
UNKNOWN
transcript
object[]

List of transcript entries made during the call

toolInvocations
object[]

List of tool invocations made during the call

properties
object

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

agent
object

Single agent participating in the call. Use this for simpler API when you have only one agent.

agents
object[]

Agents participating in the call. Each agent requires identification and prompt information.

Agent participating in the call with their endpoint and prompt

customer
object

Single customer participating in the call. Use this for simpler API when you have only one customer.

customers
object[]

Customers participating in the call.

Response

Call created successfully

data
CallCreateResponse · object
required

Response after creating a call