Skip to main content
POST
/
v1
/
resources
/
telephonyCall
Create Call
const url = 'https://api.runmorph.dev/v1/resources/telephonyCall';
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<api-key>',
    'x-api-secret': '<api-key>',
    'x-connector-id': '<api-key>',
    'x-owner-id': '<api-key>',
    'x-session-token': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: '{"direction":"inbound","status":"planned","startedAt":"2023-11-07T05:31:56Z","answeredAt":"2023-11-07T05:31:56Z","endedAt":"2023-11-07T05:31:56Z","duration":1,"recordingUrl":"<string>","users":[{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"}],"contacts":[{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"}],"externalNumber":"<string>","internalNumber":"<string>","transcript":{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "object": "resourceRef",
  "model": "<string>",
  "id": "<string>",
  "remote": {
    "id": "<string>"
  }
}

Authorizations

x-api-key
string
header
required
x-api-secret
string
header
required
x-connector-id
string
header
required
x-owner-id
string
header
required
x-session-token
string
header
required

Query Parameters

returnResource
default:false

Body

direction
enum<string>
required

Direction of the call (inbound, outbound)

Available options:
inbound,
outbound
status
enum<string>
required

Call status (inProgress, completed, missed, voicemail)

Available options:
planned,
inProgress,
completed,
missed,
voicemail
startedAt
string<date-time>
required

Call start time

answeredAt
string<date-time>

Time when call was answered (if applicable)

endedAt
string<date-time>

Call end time

duration
integer

Duration of the call in seconds

Required range: x >= 0
recordingUrl
string

URL to call recording or voicemail if available

users
object[]

Internal participants in the call

contacts
object[]

External participants in the call

externalNumber
string

External number involved in the call (if applicable)

internalNumber
string

Internal number involved in the call (if applicable)

transcript
object

Transcript of the call if available

Response

Created

  • Option 1
  • Option 2
object
enum<string>
default:resource
required
Available options:
resourceRef
model
string
required
id
string
required
remote
object