Skip to main content
POST
/
v1
/
resources
/
crmEngagement
Create Engagement
const url = 'https://api.runmorph.dev/v1/resources/crmEngagement';
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: '{"type":"call","direction":"inbound","status":"planned","title":"<string>","description":"<string>","startedAt":"2023-11-07T05:31:56Z","endedAt":"2023-11-07T05:31:56Z","duration":1,"owner":{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"},"users":[{"id":"<string>","object":"resourceRef","model":"<string>","fields":"<any>","rawResource":"<any>","remote":{"id":"<string>"},"createdAt":"<string>","updatedAt":"<string>"}],"companies":[{"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>"}],"opportunities":[{"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

type
enum<string>
required

Type of engagement

Available options:
call,
meeting,
email,
task,
note
startedAt
string<date-time>
required

Start time in ISO 8601 format

direction
enum<string>

Direction of the engagement

Available options:
inbound,
outbound
status
enum<string>

Engagement status

Available options:
planned,
inProgress,
completed,
canceled
title
string

Subject or title of the engagement

description
string

Engagement content details

endedAt
string<date-time>

End time in ISO 8601 format

duration
integer

Duration in seconds

Required range: x >= 0
owner
object

Owner of the engagement

users
object[]

Related users

companies
object[]

Related companies

contacts
object[]

Related contacts

opportunities
object[]

Related opportunities

Response

Created

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