Product Events

Events that occur in the Freshsales product, such as creating a contact, updating a deal, creating a task, and so on are termed as product events. You can enable product events to trigger apps. To do this, configure event listeners in the manifest.json file. When a product event occurs, the corresponding event listener invokes a callback method defined in server.js. The app logic in the callback method runs with the help of the event-specific payload passed to the callback method.

Configure Events

To register a product event and the corresponding callback:

  1. From your app’s root directory, navigate to the manifest.json file.
  2. Include the events attribute, specifying the product event and the corresponding callback methods as follows:
    Copied Copy
    1
    2
    3
    4
    5
    "events": { "<eventName>": { "handler": "<eventCallbackMethod>" } }
    Note: Include only one callback method for an event. Multiple events can access the same callback method.
  3. Navigate to the server.js file.
  4. In the exports block, enter the callback function definition as follows:
    Copied Copy
    1
    2
    3
    4
    5
    6
    7
    exports = { // args is a JSON block containing the payload information // args["iparam"] will contain the installation parameter values //eventCallbackMethod is the call-back function name specified in manifest.json eventCallbackMethod: function(args) { console.log("Logging arguments from the event: " + JSON.stringify(payload)); }};
    EXPAND ↓

Payload Attributes

When a product event occurs, an event-specific payload is passed to the callback method.

Copied Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ "account_id" : "value", "domain" : "value", "event" : "value", "region" : "value", "timestamp" : "value", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data" : { //Contains the list of objects related to the event. }, "iparams" : { "Param1" : "value", "Param2" : "value" } }
EXPAND ↓

The payload is a JSON object with the following attributes.

Attribute Type Description
account_id string Identifier of the Freshsales Suite account, auto-generated when the account is configured for a business.
domain string Domain name for the Freshsales Suite account.
event string Identifier of the product event.
region string Region where the app is installed.
Possible values: US, EU, EUC, AUS, and IND
timestamp number Timestamp of when the product event occurs, specified in the epoch format.
productContext object Product context of the product for which the app is installed.
Attributes:
  • url (string): Complete web-address (protocol, sub-domain name, domain name, and relative path) of the product instance.
    Possible values:
    https://<sub-domain>.myfreshworks.com/crm,
    https://<sub-domain>.freshworks.com/crm
  • name (string): Name of the product.
    Possible values: freshworks_crm
iparams object Installation parameters specified as a JSON object of <parameter name>: <parameter value> pairs.
data object Event-specific Freshsales data, specified as a JSON object of key:value pairs.
onContactCreate

When a contact is created, the onContactCreate event is invoked and the registered callback method is executed.
Register the onContactCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onContactCreate": { "handler": "onContactCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onContactCreateCallback: function(payload) { console.log("Logging arguments from onContactCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
{ "timestamp": 1593015490.2012472, "account_id": "1967183444532229946", "domain": "sample.myfreshworks.com", "event": "onContactCreate", "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "id": 1437, "name": "John Doe", "email": "sample@xyz.com", "job_title": null, "work_number": null, "mobile_number": null, "language": "en", "time_zone": "UTC", "is_active": true, "deal_pipeline_id": 154, "is_forgotten": false, "created_at": "2020-06-09T12:21:48Z", "updated_at": "2020-06-09T12:21:48Z", "uuid": "190440313184929466", "type": "user" }, "contact": { "first_name": { "label": "First name", "type": "text", "value": "fff" }, "last_name": { "label": "Last name", "type": "text", "value": null }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 1437 }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "job_title": { "label": "Job title", "type": "text", "value": null }, "emails": { "label": "Emails", "type": "group_field", "value": [] }, "work_number": { "label": "Work", "type": "phone_number", "value": null }, "mobile_number": { "label": "Mobile", "type": "phone_number", "value": "9876543223456789" }, "contact_status_id": { "label": "Status", "type": "dropdown", "value": null }, "country": { "label": "Country", "type": "text", "value": null }, "time_zone": { "label": "Time zone", "type": "dropdown", "value": null }, "address": { "label": "Address", "type": "text", "value": null }, "city": { "label": "City", "type": "text", "value": null }, "state": { "label": "State", "type": "text", "value": null }, "zipcode": { "label": "Zipcode", "type": "text", "value": null }, "do_not_disturb": false, "linkedin": { "label": "LinkedIn", "type": "text", "value": null }, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "lead_source_id": { "label": "Source", "type": "dropdown", "value": null }, "facebook": { "label": "Facebook", "type": "text", "value": null }, "twitter": { "label": "Twitter", "type": "text", "value": null }, "campaign_id": { "label": "Campaign", "type": "dropdown", "value": null }, "medium": { "label": "Medium", "type": "text", "value": null }, "keyword": { "label": "Keyword", "type": "text", "value": null }, "last_contacted": { "label": "Last contacted time", "type": "date_time", "value": null }, "web_form_ids": { "label": "Web forms", "type": "multi_select_dropdown", "value": [] }, "last_contacted_mode": { "label": "Last contacted mode", "type": "dropdown", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-09T15:21:39Z" }, "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "lead_score": { "label": "Score", "type": "number", "value": 0 }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "last_seen": { "label": "Last seen", "type": "date_time", "value": null }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": 1437 }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-09T15:21:39Z" }, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-09T15:21:40Z" }, "external_id": { "label": "External ID", "type": "text", "value": null }, "work_email": { "label": "Work email", "type": "email", "value": null }, "subscription_status": { "label": "Subscription status", "type": "dropdown", "value": 1 }, "subscription_types": { "label": "Subscription types", "type": "multi_select_dropdown", "value": [ { "id": "1", "value": "Non-marketing emails from our company" } ] }, "id": 5510, "is_deleted": false, "open_deals_amount": { "label": "Open deals amount", "dom_type": "decimal", "value": "0.0" }, "name": { "label": "Name", "dom_type": "text", "value": "fff" }, "merged_to": 0, "status": "Active", "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-09T15:21:40Z" }, "first_contacted": { "label": "First contacted", "dom_type": "date_time", "value": null }, "won_deals_amount": { "label": "Won deals amount", "dom_type": "decimal", "value": "0.0" }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "sales_account_ids": [], "import_id": null, "avatar": null, "team_user_ids": [], "email_status": { "label": "Email status", "dom_type": "text", "value": null }, "mcr_id": 1270375514142703600, "list_ids": [], "creator_id": { "label": "Created by", "type": "dropdown", "value": 1437 }, "custom_fields": [], "source_additional_info": {} }, "associations": { "owner": { "id": 1437, "name": "John Doe", "type": "user", "email": "sample@xyz.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "UTC", "created_at": "2020-06-09T12:21:48Z", "updated_at": "2020-06-09T12:21:48Z", "deal_pipeline_id": 154, "job_title": null, "uuid": "190440313184929466" }, "source": null, "contact_status": null, "campaign": null, "territory": null, "updater": { "id": 1437, "name": "John Doe", "type": "user", "email": "sample@xyz.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "UTC", "created_at": "2020-06-09T12:21:48Z", "updated_at": "2020-06-09T12:21:48Z", "deal_pipeline_id": 154, "job_title": null, "uuid": "190440313184929466" }, "team_users": [], "sales_accounts": [], "lists": [], "creator": { "id": 1437, "name": "John Doe", "type": "user", "email": "sample@xyz.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "UTC", "created_at": "2020-06-09T12:21:48Z", "updated_at": "2020-06-09T12:21:48Z", "deal_pipeline_id": 154, "job_title": null, "uuid": "190440313184929466" } } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onContactCreate event.
contact contact object Details of the contact object created when the onContactCreate event is triggered.
associations associations object Associated objects related to the contact object.

Attributes of the actor object

ATTRIBUTE DATA TYPE DESCRIPTION
id number Identifier associated with the actor.
name string Name of the actor.
email string Email address of the actor.
job_title string Designation of the actor.
work_number number Official phone number of the actor.
mobile_number number Phone number of the actor.
language string Language of the actor; by default, language is 'en'.
time_zone string Time zone of the actor, specified in the UTC format.
is_active boolean Set to 'true' if the actor is verified.
deal_pipeline_id number ID of deal pipelines that this actor is part of.
is_forgotten boolean If this attribute is ‘true’, specified data is permanently deleted.
created_at string Creation timestamp specified in the UTC format.
updated_at string Updation timestamp, specified in the UTC format. For onContactCreate, this value is the same as created_at.
uuid string Unique user identifier, this value is auto-generated.
type string Helps categorize a user.

Attributes of the contact object

ATTRIBUTE DATA TYPE DESCRIPTION
open_deals_amount number Sum of all the open deals associated with the contact.
source_additional_info object Meta information specified as a custom JSON object.
first_name object First name of the contact.
last_name object Last name of the contact.
city object City where the contact resides.
zipcode object Postal code of the region where the contact resides.
name object First and last name of the contact.
custom_fields array of strings Key value pairs containing the names and values of custom fields.
first_assigned_at object First assigned timestamp.
avatar string Avatar URL.
last_contacted_mode object Last mode of contact.
Possible value:
Email Incoming, Email Outgoing, Call Incoming, Call Outgoing, Email Opened, Chat, and Sales Activity
state object State where the contact resides.
lead_source_id number Identifier of the source of the deal.
job_title object Job title of the contact.
tags object Tags associated with this contact.
linkedin object Linkedin address of the contact.
import_csv_id object Reference of all imports that this contact was part of.
creator_id object Identifier of the user who created the contact.
won_deals_amount object Sum of all won deals associated with the contact.
active_sales_sequences object Active sales campaigns that this contact was part of.
owner_id object User who owns the record.
contact_status_id object Identifier of the contact status.
is_deleted boolean Specifies whether a contact is deleted. This value is set to ‘true’ if the contact is deleted.
last_assigned_at object Last assigned timestamp.
country object Country of the contact.
medium object Medium tracked in UTM.
keyword object Keyword tracked in UTM.
id number Identifier of the contact.
territory_id object Identifier of the territory.
team_user_ids array Identifiers of the collaborators associated with the contact.
facebook object Facebook ID.
last_contacted object Last contacted timestamp.
work_email object Official email address of the contact.
last_contacted_via_sales_activity object Last contacted timestamp (through sales activity).
status string Status of the contact.
Possible values:
active, merged, or deleted
mcr_id number Identifier of the master customer record to which the contact information belongs. This value is auto-generated.
external_id object Identifier of the external references from which the contact information is fetched.
address object Address of the contact.
created_at object Contact creation timestamp.
do_not_disturb boolean Set to 'true' if contact is not to be disturbed.
import_id string ID of the equivalent record in the external system from which it was imported.
sales_account_ids array of numbers IDs of the sales account associated with this contact.
twitter object Twitter handle of the contact.
recent_note object Recently added note against the contact.
merged_to number Reference of secondary contacts merged to the primary contact.
emails object Primary and secondary emails associated with this contact.
updated_at object Updated timestamp.
work_number object Telephone number of the contact.
first_contacted object First contacted timestamp.
list_ids array of numbers Identifiers of the marketing lists associated with the contact.
subscription_types object Subscription types available.
Possible values:
Promotional, Newsletter, Product updates, Conferences & Events, Non-marketing emails from our company
lead_score object Score to qualify a contact.
last_contacted_sales_activity_mode string Last mode of sales activity rendered to the contact.
completed_sales_sequences object Completed sales sequences that this contact was part of.
campaign_id object Identifier of the UTM campaign.
last_seen object Last seen timestamp.
time_zone object Time zone of the contact.
updater_id object Identifier of the user who updated the contact.
web_form_ids object Forms through which this record was captured.
mobile_number object Mobile number of the contact.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
lists array Marketing lists associated with the contact.
source string Source details of this contact.
campaign string UTM campaign.
creator user object Details of contact creator.
territory string Territory of the contact.
contact_status string Qualification status of the contact.
owner user object Details of the contact owner.
updater user object Details of the contact updater. For onContactCreate, this value is null.
team_users array Collaborators associated with the contact.
sales_accounts array of numbers Sales accounts of the contact.

Attributes of the user object.

ATTRIBUTE DATA TYPE DESCRIPTION
id integer Identifier of the user.
created_at string Timestamp of when the user is created in the Freshsales Suite system, specified in the UTC format.
updated_at string Timestamp of when the user is last updated in the Freshsales Suite system, specified in the UTC format.
name string Name of the user.
type string Identifier of the person involved in creating, owning, or updating the product.
Possible value: user
email string Email address of the user.
is_active boolean Specifies whether the user is currently active in the Freshsales Suite system.
Possible value: true, false
work_number string Official phone number of the user.
mobile_number string Contact number of the user.
time_zone string Time zone of the user configured in the Freshsales Suite system.
deal_pipeline_id integer Pipeline helps define different stages a deal progresses through, which enables a unique sales process for each deal.
Identifier of the pipeline associated with the deal.
job_title string Designation of the user in the Freshsales Suite system.
uuid
Valid only for onContactCreate, onContactUpdate, onDealCreate, onDealUpdate, onSalesAccountCreate, onSalesAccountUpdate, onCustomModuleCreate, onCustomModuleUpdate, onAppointmentCreate, onAppointmentUpdate, onTaskCreate, onTaskUpdate.
string Unique user identifier, this value is auto-generated.
onContactUpdate

When a contact is updated, the onContactUpdate event is invoked and the registered callback method is executed.
Register the onContactUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onContactUpdate": { "handler": "onContactUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onContactUpdateCallback: function(payload) { console.log("Logging arguments from onContactUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "contact": { "open_deals_amount": { "label": "Open deals amount", "dom_type": "decimal", "value": "0.0" }, "source_additional_info": {}, "first_name": { "label": "First name", "type": "text", "value": "Test" }, "city": { "label": "City", "type": "text", "value": null }, "zipcode": { "label": "Zipcode", "type": "text", "value": null }, "name": { "label": "Name", "dom_type": "text", "value": "Test owner Update" }, "custom_fields": [], "subscription_status": { "label": "Subscription status", "type": "dropdown", "value": 0 }, "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-24T18:23:28Z" }, "avatar": null, "last_contacted_mode": { "label": "Last contacted mode", "type": "dropdown", "value": null }, "state": { "label": "State", "type": "text", "value": null }, "lead_source_id": { "label": "Source", "type": "dropdown", "value": null }, "job_title": { "label": "Job title", "type": "text", "value": null }, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "linkedin": { "label": "LinkedIn", "type": "text", "value": null }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "creator_id": { "label": "Created by", "type": "dropdown", "value": 39897 }, "won_deals_amount": { "label": "Won deals amount", "dom_type": "decimal", "value": "0.0" }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 39897 }, "contact_status_id": { "label": "Status", "type": "dropdown", "value": null }, "is_deleted": false, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-24T18:23:28Z" }, "country": { "label": "Country", "type": "text", "value": null }, "medium": { "label": "Medium", "type": "text", "value": null }, "keyword": { "label": "Keyword", "type": "text", "value": null }, "team_user_ids": [], "id": 1399554, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "email_status": { "label": "Email status", "dom_type": "text", "value": null }, "facebook": { "label": "Facebook", "type": "text", "value": null }, "last_contacted": { "label": "Last contacted time", "type": "date_time", "value": null }, "last_name": { "label": "Last name", "type": "text", "value": "owner Update" }, "work_email": { "label": "Work email", "type": "email", "value": null }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "status": "Active", "mcr_id": 1275857082467778600, "phone_numbers": { "label": "Other phone numbers", "type": "group_field", "value": [] }, "external_id": { "label": "External ID", "type": "text", "value": null }, "address": { "label": "Address", "type": "text", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T18:23:27Z" }, "do_not_disturb": true, "import_id": null, "sales_account_ids": [], "twitter": { "label": "Twitter", "type": "text", "value": null }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "merged_to": 0, "emails": { "label": "Emails", "type": "group_field", "value": [] }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T18:27:01Z" }, "work_number": { "label": "Work", "type": "phone_number", "value": null }, "first_contacted": { "label": "First contacted", "dom_type": "date_time", "value": null }, "list_ids": [], "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "subscription_types": { "label": "Subscription types", "type": "multi_select_dropdown", "value": [] }, "lead_score": { "label": "Score", "type": "number", "value": 0 }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "campaign_id": { "label": "Campaign", "type": "dropdown", "value": null }, "last_seen": { "label": "Last seen", "type": "date_time", "value": null }, "time_zone": { "label": "Time zone", "type": "dropdown", "value": null }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": 39897 }, "web_form_ids": { "label": "Web forms", "type": "multi_select_dropdown", "value": [] }, "mobile_number": { "label": "Mobile", "type": "phone_number", "value": "1231231230" } }, "associations": { "lists": [], "source": null, "campaign": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@freshworks.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "territory": null, "contact_status": null, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "team_users": [], "sales_accounts": [] }, "changes": { "model_changes": { "last_name": [ "owner", "owner Update" ], "created_at": [ "2020-06-24T18:23:27Z", "2020-06-24T18:23:27Z" ], "updater_id": [ null, 39897 ], "updated_at": [ "2020-06-24T18:23:27Z", "2020-06-24T18:27:01Z" ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onContactUpdate", "timestamp": 1593023221.9586976, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When a contact is deleted, the is_deleted field is set to true.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onContactUpdate event.
contact contact object Details of the contact object.
associations associations object Associated objects related to the contact object.
changes object Updated field values.

onDealCreate

When a deal is created, the onDealCreate event is invoked and the registered callback method is executed.
Register the onDealCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onDealCreate": { "handler": "onDealCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onDealCreateCallback: function(payload) { console.log("Logging arguments from onDealCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "deal": { "deal_pipeline_id": { "label": "Deal pipeline", "type": "dropdown", "value": 27149 }, "source_additional_info": {}, "deal_product_id": { "label": "Product", "type": "dropdown", "value": null }, "name": { "label": "Name", "type": "text", "value": "Deal with owner" }, "custom_fields": [], "upcoming_activities_time": { "label": "Upcoming activities", "type": "date_time", "value": null }, "deal_type_id": { "label": "Type", "type": "dropdown", "value": null }, "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-24T18:30:55Z" }, "web_form_id": { "label": "Web form", "type": "dropdown", "value": null }, "contact_ids": [], "lead_source_id": { "label": "Source", "type": "dropdown", "value": null }, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "creator_id": { "label": "Created by", "type": "dropdown", "value": 39897 }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 39897 }, "is_deleted": false, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-24T18:30:55Z" }, "expected_close": { "label": "Expected close date", "type": "date", "value": null }, "won_from": null, "age": { "label": "Age (in days)", "type": "number", "value": 0 }, "amount": { "label": "Deal value", "type": "decimal", "value": "123.0" }, "product_ids": [], "deal_stage_id": { "label": "Deal stage", "type": "dropdown", "value": 178962 }, "base_currency_amount": { "label": "Deal value in Base Currency", "type": "decimal", "value": "123.0" }, "team_user_ids": [], "id": 1357538, "deal_reason_id": { "label": "Lost reason", "type": "dropdown", "value": null }, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "sales_account_id": { "label": "Account name", "type": "auto_complete", "value": null }, "deal_payment_status_id": { "label": "Payment status", "type": "dropdown", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T18:30:54Z" }, "import_id": null, "expected_deal_value": { "label": "Expected deal value", "type": "decimal", "value": "123.0" }, "currency_id": { "label": "Currency", "type": "dropdown", "value": 6615 }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "stage_updated_time": { "label": "Deal stage updated at", "type": "date_time", "value": "2020-06-24T18:30:54Z" }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T18:30:54Z" }, "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "campaign_id": { "label": "Campaign", "type": "dropdown", "value": null }, "closed_date": { "label": "Closed date", "type": "date", "value": null }, "lost_from": null, "deal_prediction_tag": { "label": "Deal Prediction", "dom_type": "text", "value": null }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": null }, "probability": { "label": "Probability (%)", "type": "decimal", "value": 100 } }, "associations": { "source": null, "deal_payment_status": null, "campaign": null, "deal_pipeline": { "id": 27149, "name": "Default Pipeline", "position": 1, "is_default": true }, "products": [], "contacts": [], "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "sales_account": null, "deal_stage": { "id": 178962, "name": "New", "position": 1, "forecast_type": "Open" }, "territory": null, "deal_product": null, "currency": { "id": 6615, "currency_code": "USD", "exchange_rate": "1.0" }, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": null, "deal_reason": null, "deal_type": null, "team_users": [] } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onDealCreate", "timestamp": 1593023454.5852625, "version": "2.0" }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onDealCreate event.
deal deal object Details of the deal object created when the onDealCreate event is triggered.
associations associations object Associated objects related to the deal object.

Attributes of the deal object

ATTRIBUTE DATA TYPE DESCRIPTION
deal_pipeline_id number Identifier of deal pipeline.
source_additional_info array Meta information specified as a custom JSON object.
deal_product_id object Identifier of the product that the deal is associated with.
name
Mandatory
object Name of the deal.
custom_fields array of strings Key value pairs containing the names and values of custom fields.
upcoming_activities_time object Timestamp for next scheduled activity.
deal_type_id object Identifier of the deal type.
first_assigned_at object First assigned timestamp of the deal.
web_form_id object Form through which this deal was captured.
contact_ids array Identifiers of contacts associated with this deal.
lead_source_id object Identifier of the source of the deal.
tags object Tags associated with this deal.
import_csv_id object Reference of all imports that this deal was part of.
creator_id object Identifier of the user who initiated the deal.
active_sales_sequences object Active sales campaigns that this deal was part of.
owner_id object User who owns the record.
is_deleted boolean Set to 'true' if deal is deleted.
last_assigned_at object Last assigned timestamp.
expected_close object Expected close date of the deal.
won_from object Stage from which deal was won.
job_title object Job title of the contact.
age object Time elapsed (in days) since the creation of the deal.
amount
Mandatory
object Value of the deal.
product_ids array Identifiers of products associated with this deal.
deal_stage_id object Identifier of the deal stage.
base_currency_amount
Mandatory
object Deal amount converted to base currency configured by admin.
team_user_ids array Identifiers of the collaborators who work on a task associated with the deal of the deal.
id number Identifier of the deal.
deal_reason_id object Identifier of the reason why the deal was lost.
territory_id object Identifier of the territory.
last_contacted_via_sales_activity object Last contacted timestamp (through sales activity).
sales_account_id object Identifier of sales account associated with this deal.
deal_payment_status_id object Identifier of deal payment status.
created_at object Created timestamp.
import_id string Identifier of the equivalent record in the external system from which it was imported.
expected_deal_value object Expected deal amount.
currency_id object Identifier of currency associated with the deal.
recent_note object Recently added note against the deal.
stage_updated_time object Timestamp when the deal stage was updated.
updated_at object Updated timestamp.
last_contacted_sales_activity_mode object Last mode of sales activity rendered for the deal.
completed_sales_sequences object Completed sales sequences that this deal was part of.
campaign_id object Identifier of the UTM campaign.
closed_date object Closed date of the deal.
lost_from string Stage where the deal was lost.
deal_prediction_tag object Identifier of the user who updated the deal.
updater_id object Identifier of the user who updated the deal.
probability number Probability of closing the deal.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
source string Source details of this deal.
deal_payment_status string Status of the deal payment.
campaign string UTM campaign.
deal_pipeline object Details of deal pipeline.
products array Products associated with this deal.
contacts array Contacts associated with this deal.
creator user object Details of the deal creator.
sales_accounts array of numbers Sales accounts of the contact.
deal_stage object Details of the deal stage.
territory string Location of the deal.
deal_product string Product that the deal is associated with.
currency object Details of the deal currency.
owner user object Details of the deal owner.
updater user object Details of the deal updater. For the onDealCreate event, this value is null.
deal_reason string Reason why the deal was lost.
deal_type string Type of deal.
team_users array Collaborators who worked on a task related to the deal.
onDealUpdate

When a deal is updated, the onDealUpdate event is invoked and the registered callback method is executed.
Register the onDealUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onDealUpdate": { "handler": "onDealUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onDealUpdateCallback: function(payload) { console.log("Logging arguments from onDealUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "deal": { "deal_pipeline_id": { "label": "Deal pipeline", "type": "dropdown", "value": 27149 }, "source_additional_info": {}, "deal_product_id": { "label": "Product", "type": "dropdown", "value": null }, "name": { "label": "Name", "type": "text", "value": "Deal update with owner" }, "custom_fields": [], "upcoming_activities_time": { "label": "Upcoming activities", "type": "date_time", "value": null }, "deal_type_id": { "label": "Type", "type": "dropdown", "value": null }, "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-24T18:30:55Z" }, "web_form_id": { "label": "Web form", "type": "dropdown", "value": null }, "contact_ids": [], "lead_source_id": { "label": "Source", "type": "dropdown", "value": null }, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "creator_id": { "label": "Created by", "type": "dropdown", "value": 39897 }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 39897 }, "is_deleted": false, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-24T18:30:55Z" }, "expected_close": { "label": "Expected close date", "type": "date", "value": null }, "won_from": null, "age": { "label": "Age (in days)", "type": "number", "value": 0 }, "amount": { "label": "Deal value", "type": "decimal", "value": "1234.0" }, "product_ids": [], "deal_stage_id": { "label": "Deal stage", "type": "dropdown", "value": 178962 }, "base_currency_amount": { "label": "Deal value in Base Currency", "type": "decimal", "value": "1234.0" }, "team_user_ids": [], "id": 1357538, "deal_reason_id": { "label": "Lost reason", "type": "dropdown", "value": null }, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "sales_account_id": { "label": "Account name", "type": "auto_complete", "value": null }, "deal_payment_status_id": { "label": "Payment status", "type": "dropdown", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T18:30:54Z" }, "import_id": null, "expected_deal_value": { "label": "Expected deal value", "type": "decimal", "value": "1234.0" }, "currency_id": { "label": "Currency", "type": "dropdown", "value": 6615 }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "stage_updated_time": { "label": "Deal stage updated at", "type": "date_time", "value": "2020-06-24T18:30:54Z" }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T18:31:09Z" }, "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "campaign_id": { "label": "Campaign", "type": "dropdown", "value": null }, "closed_date": { "label": "Closed date", "type": "date", "value": null }, "lost_from": null, "deal_prediction_tag": { "label": "Deal Prediction", "dom_type": "text", "value": null }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": 39897 }, "probability": { "label": "Probability (%)", "type": "decimal", "value": 100 } }, "associations": { "source": null, "deal_payment_status": null, "campaign": null, "deal_pipeline": { "id": 27149, "name": "Default Pipeline", "position": 1, "is_default": true }, "products": [], "contacts": [], "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "sales_account": null, "deal_stage": { "id": 178962, "name": "New", "position": 1, "forecast_type": "Open" }, "territory": null, "deal_product": null, "currency": { "id": 6615, "currency_code": "USD", "exchange_rate": "1.0" }, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "deal_reason": null, "deal_type": null, "team_users": [] }, "changes": { "model_changes": { "name": [ "Deal with owner", "Deal update with owner" ], "amount": [ 123, 1234 ], "base_currency_amount": [ 123, 1234 ], "expected_deal_value": [ 123, 1234 ], "updated_at": [ "2020-06-24T18:30:54Z", "2020-06-24T18:31:09Z" ], "updater_id": [ null, 39897 ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onDealUpdate", "timestamp": 1593023469.8293262, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When a deal is deleted, the is_deleted field is set to 'true'.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onDealUpdate event.
deal deal object Details of the deal object.
associations associations object Associated objects related to the deal object.
changes object Updated field values.
onSalesAccountCreate

When a sales account is created, the onSalesAccountCreate event is invoked and the registered callback method is executed.
Register the onSalesAccountCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onSalesAccountCreate": { "handler": "onSalesAccountCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onSalesAccountCreateCallback: function(payload) { console.log("Logging arguments from onSalesAccountCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "sales_account": { "open_deals_amount": { "label": "Open deals amount", "dom_type": "decimal", "value": "0.0" }, "business_type_id": { "label": "Business type", "type": "dropdown", "value": null }, "website": { "label": "Website", "type": "url", "value": null }, "city": { "label": "City", "type": "text", "value": null }, "zipcode": { "label": "Zipcode", "type": "text", "value": null }, "name": { "label": "Name", "type": "text", "value": "sales account with owner" }, "custom_fields": [], "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-24T18:31:38Z" }, "avatar": null, "last_contacted_mode": { "label": "Last contacted mode", "type": "dropdown", "value": null }, "state": { "label": "State", "type": "text", "value": null }, "parent_territory_id": null, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "linkedin": { "label": "LinkedIn", "type": "text", "value": null }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "creator_id": { "label": "Created by", "type": "dropdown", "value": 39897 }, "won_deals_amount": { "label": "Won deals amount", "dom_type": "decimal", "value": "0.0" }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 39897 }, "is_deleted": false, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-24T18:31:38Z" }, "annual_revenue": { "label": "Annual revenue", "type": "decimal", "value": null }, "country": { "label": "Country", "type": "text", "value": null }, "team_user_ids": [], "id": 1100844, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "facebook": { "label": "Facebook", "type": "text", "value": null }, "last_contacted": { "label": "Last contacted time", "type": "date_time", "value": null }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "status": "Active", "number_of_employees": { "label": "Number of employees", "type": "dropdown", "value": null }, "mcr_id": 1275859140088463400, "industry_type_id": { "label": "Industry type", "type": "dropdown", "value": null }, "address": { "label": "Address", "type": "text", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T18:31:37Z" }, "import_id": null, "twitter": { "label": "Twitter", "type": "text", "value": null }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "merged_to": 0, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T18:31:37Z" }, "first_contacted": { "label": "First contacted", "dom_type": "date_time", "value": null }, "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "phone": { "label": "Phone", "type": "phone_number", "value": null }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": null }, "parent_sales_account_id": { "label": "Parent account", "type": "auto_complete", "value": null }, "parent_owner_id": null }, "associations": { "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "territory": null, "business_type": null, "parent_sales_account": null, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": null, "industry_type": null, "team_users": [] } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onSalesAccountCreate", "timestamp": 1593023498.1006536, "version": "2.0" }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onSalesAccountCreate event.
sales_account sales_account object Details of the sales_account object created when the onSalesAccountCreate event is triggered.
associations associations object Associated objects related to the sales_account object.

Attributes of the actor object

ATTRIBUTE DATA TYPE DESCRIPTION
deal_pipeline_id number Identifier of deal pipelines that this actor is part of.
name
Mandatory
string Name of the actor.
is_active boolean Set to 'true' if the actor is verified.
email string Email address of the actor.
job_title string Designation of the actor.
uuid string Unique user identifier, this is auto-generated.
id number Identifier of the actor.
language string Language of the actor; by default, language is 'en'.
created_at string Creation timestamp, specified in the UTC format.
type string Helps categorize an actor.
updated_at string Updation timestamp, specified in the UTC format. For onSalesAccountCreate, this value is the same as created_at.
work_number number Official phone number of the actor.
time_zone string Time zone of the actor, specified in the UTC format.
is_forgotten boolean If this attribute is ‘true’, specified data is permanently deleted.
mobile_number string Mobile number of the user.

Attributes of the sales_account object

ATTRIBUTE DATA TYPE DESCRIPTION
open_deals_amount object Sum of all the open deals associated with the account.
business_type_id object Identifier of the business type that the account belongs to.
website object URL of the account website.
city object City where the account was created.
zipcode object Postal code of the region.
name object Name of the account.
custom_fields array Key value pairs containing the names and values of custom fields.
first_assigned_at object First assigned timestamp.
avatar object Avatar URL.
last_contacted_mode object Last mode of contact.
Possible values:
Email Incoming, Email Outgoing, Call Incoming, Call Outgoing, Email Opened, Chat, and Sales Activity
state object State where the account was created.
parent_territory_id number Identifier of the territory of the parent account.
tags array of strings Tags associated with this account.
linkedin object Linkedin address of the account owner.
import_csv_id object Reference of all imports that this account was part of.
creator_id object Identifier of the user who created the account.
won_deals_amount object Sum of all won deals associated with the account.
active_sales_sequences object Active sales campaigns that this account is part of.
owner_id object Identifier of the user who owns the record.
is_deleted boolean Set to 'true' if account is deleted.
last_assigned_at object Last assigned timestamp.
annual_revenue object Annual revenue of the account.
country object Country where the account was created.
team_user_ids array Identifiers of the collaborators linked to a task associated with the sales account.
id number Identifier of the account.
territory_id number Identifier of the territory.
facebook object Facebook ID.
last_contacted object Last contacted timestamp.
last_contacted_via_sales_activity object Last contacted timestamp (through sales activity).
status string Status of the account.
number_of_employees object Number of employees associated with this account.
mcr_id number Identifier of the master customer record. This value is auto-generated.
industry_type_id object Identifier of the industry type that the account belongs to.
address object Address associated with the account.
created_at object Account creation timestamp.
import_id string Identifier of the equivalent record in the external system from which it was imported.
twitter object Twitter handle of the account owner.
recent_note object Recently added note against the account.
merged_to object Reference of secondary accounts merged to the primary account.
updated_at object Updated timestamp.
last_contacted_via_chat object Last contacted via chat timestamp.
first_contacted object First contacted via chat timestamp.
last_contacted_sales_activity_mode object Last mode of sales activity rendered.
completed_sales_sequences object Completed sales sequences that this account was part of.
phone object Phone number associated with this account.
updater_id object Identifier of the user who updated the account.
parent_sales_account_id object Identifier of parent account.
parent_owner_id object Identifier of the owner of the parent account.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
creator user object Details of the account creator.
territory string Territory associated with the account.
business_type string Business type associated with this account.
parent_sales_account string Parent account.
owner user object Details of the account owner.
updater user object Details of the account updater.
industry_type string Industry type that the account belongs to.
team_users array Collaborators who work on a task associated with the sales account.
onSalesAccountUpdate

When a sales account is updated, the onSalesAccountUpdate event is is invoked and the registered callback method is executed.
Register the onSalesAccountUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onSalesAccountUpdate": { "handler": "onSalesAccountUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onSalesAccountUpdateCallback: function(payload) { console.log("Logging arguments from onSalesAccountUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "sales_account": { "open_deals_amount": { "label": "Open deals amount", "dom_type": "decimal", "value": "0.0" }, "business_type_id": { "label": "Business type", "type": "dropdown", "value": null }, "website": { "label": "Website", "type": "url", "value": null }, "city": { "label": "City", "type": "text", "value": null }, "zipcode": { "label": "Zipcode", "type": "text", "value": null }, "name": { "label": "Name", "type": "text", "value": "sales account update with owner" }, "custom_fields": [], "first_assigned_at": { "label": "First assigned at", "dom_type": "date_time", "value": "2020-06-24T18:31:38Z" }, "avatar": null, "last_contacted_mode": { "label": "Last contacted mode", "type": "dropdown", "value": null }, "state": { "label": "State", "type": "text", "value": null }, "parent_territory_id": null, "tags": { "label": "Tags", "type": "auto_complete", "value": [] }, "linkedin": { "label": "LinkedIn", "type": "text", "value": null }, "import_csv_id": { "label": "Import label", "dom_type": "multi_select_dropdown", "value": [] }, "creator_id": { "label": "Created by", "type": "dropdown", "value": 39897 }, "won_deals_amount": { "label": "Won deals amount", "dom_type": "decimal", "value": "0.0" }, "active_sales_sequences": { "label": "Active sales sequences", "type": "multi_select_dropdown", "value": [] }, "owner_id": { "label": "Sales owner", "type": "dropdown", "value": 39897 }, "is_deleted": false, "last_assigned_at": { "label": "Last assigned at", "type": "date_time", "value": "2020-06-24T18:31:38Z" }, "annual_revenue": { "label": "Annual revenue", "type": "decimal", "value": null }, "country": { "label": "Country", "type": "text", "value": null }, "team_user_ids": [], "id": 1100844, "territory_id": { "label": "Territory", "type": "dropdown", "value": null }, "facebook": { "label": "Facebook", "type": "text", "value": null }, "last_contacted": { "label": "Last contacted time", "type": "date_time", "value": null }, "last_contacted_via_sales_activity": { "label": "Last activity date", "type": "date_time", "value": null }, "status": "Active", "number_of_employees": { "label": "Number of employees", "type": "dropdown", "value": null }, "mcr_id": 1275859140088463400, "industry_type_id": { "label": "Industry type", "type": "dropdown", "value": null }, "address": { "label": "Address", "type": "text", "value": null }, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T18:31:37Z" }, "import_id": null, "twitter": { "label": "Twitter", "type": "text", "value": null }, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "merged_to": 0, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T18:32:02Z" }, "first_contacted": { "label": "First contacted", "dom_type": "date_time", "value": null }, "last_contacted_sales_activity_mode": { "label": "Last activity type", "type": "dropdown", "value": null }, "completed_sales_sequences": { "label": "Completed sales sequences", "type": "multi_select_dropdown", "value": [] }, "phone": { "label": "Phone", "type": "phone_number", "value": "123123123" }, "updater_id": { "label": "Updated by", "type": "dropdown", "value": 39897 }, "parent_sales_account_id": { "label": "Parent account", "type": "auto_complete", "value": null }, "parent_owner_id": null }, "associations": { "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "territory": null, "business_type": null, "parent_sales_account": null, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "industry_type": null, "team_users": [] }, "changes": { "model_changes": { "name": [ "sales account with owner", "sales account update with owner" ], "created_at": [ "2020-06-24T18:31:37Z", "2020-06-24T18:31:37Z" ], "updated_at": [ "2020-06-24T18:31:37Z", "2020-06-24T18:32:02Z" ], "phone": [ null, "123123123" ], "updater_id": [ null, 39897 ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onSalesAccountUpdate", "timestamp": 1593023522.2470818, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When a sales account is deleted, the is_deleted field is set to true.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onSalesAccountCreate event.
sales_account sales_account object Details of the sales_account object.
associations associations object Associated objects related to the sales_account object.
changes object Updated field values.
onCustomModuleCreate

When a custom module record is created, the onCustomModuleCreate event is invoked and the registered callback method is executed.
Register the onCustomModuleCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onCustomModuleCreate": { "handler": "onCustomModuleCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onCustomModuleCreateCallback: function(payload) { console.log("Logging arguments from onCustomModuleCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "custom_module_record": { "name": { "label": "Name", "type": "text", "value": "custom_create" }, "custom_fields": [ { "name": "cf_cm_edit", "label": "CM_edit", "column": "cf_str01", "type": "text", "value": null } ], "creator_id": { "label": "Created by", "type": "auto_complete", "value": { "id": 39897, "model": "user" } }, "owner_id": { "label": "Sales owner", "type": "auto_complete", "value": { "id": 39897, "model": "user" } }, "is_deleted": false, "id": 40764, "status": 1, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T14:05:16Z" }, "import_id": null, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T14:05:16Z" }, "updater_id": { "label": "Updated by", "type": "auto_complete", "value": { "id": null, "model": "user" } }, "module_name": "cm_create" }, "associations": { "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null } } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onCustomModuleCreate", "timestamp": 1593007516.6833186, "version": "2.0" }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onCustomModuleCreate event.
custom_module_record custom_module_record object Details of the custom module record object created when the onCustomModuleCreate event is triggered.
associations associations object Associated objects related to the custom module record object.

Attributes of the custom_module_record object

ATTRIBUTE DATA TYPE DESCRIPTION
name object Name in the record.
custom_fields array Key value pairs containing the names and values of custom fields.
creator_id object Details of the user who created the record.
owner_id object Details of the user who owns the record.
is_deleted boolean Set to 'true' if record is deleted.
id number Identifier of the record.
status number Status of the record.
created_at object Record creation timestamp.
import_id string Identifier of the equivalent record in the external system from which it was imported.
recent_note object Recently added note against the record.
updated_at object Updated timestamp. For onCustomModuleCreate, updated_at is the same as created_at.
updater_id object Details of the user who updated the record.
module_name object Name of the module.

Attributes of the associations object

ATTRIBUTE TYPE DESCRIPTION
owner user object Details of custom module record creator.
updater user object Details of the custom module record updater.
creator user object Details of the custom module record creator.
onCustomModuleUpdate

When a custom module record is updated, the onCustomModuleUpdate event is invoked and the registered callback method is executed.
Register the onCustomModuleUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onCustomModuleUpdate": { "handler": "onCustomModuleUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onCustomModuleUpdateCallback: function(payload) { console.log("Logging arguments from onCustomModuleUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "custom_module_record": { "name": { "label": "Name", "type": "text", "value": "custom_create_update" }, "custom_fields": [ { "name": "cf_cm_edit", "label": "CM_edit", "column": "cf_str01", "type": "text", "value": null } ], "creator_id": { "label": "Created by", "type": "auto_complete", "value": { "id": 39897, "model": "user" } }, "owner_id": { "label": "Sales owner", "type": "auto_complete", "value": { "id": 39897, "model": "user" } }, "is_deleted": false, "id": 40764, "status": 1, "created_at": { "label": "Created at", "type": "date_time", "value": "2020-06-24T14:05:16Z" }, "import_id": null, "recent_note": { "label": "Recent note", "type": "paragraph", "value": null }, "updated_at": { "label": "Updated at", "type": "date_time", "value": "2020-06-24T14:06:21Z" }, "updater_id": { "label": "Updated by", "type": "auto_complete", "value": { "id": 39897, "model": "user" } }, "module_name": "cm_create" }, "associations": { "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null } }, "changes": { "model_changes": { "name": [ "custom_create", "custom_create_update" ], "updater_id": [ null, 39897 ], "updated_at": [ "2020-06-24T14:05:16Z", "2020-06-24T14:06:21Z" ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onCustomModuleUpdate", "timestamp": 1593007581.9710617, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When a record is deleted, the is_deleted field is set to true.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onCustomModuleUpdate event.
custom_module_record custom_module_record object Details of the custom module record object.
associations associations object Associated objects related to the custom module record object.
changes object Updated field values.
onAppointmentCreate

When an appointment is created, the onAppointmentCreate event is invoked and the registered callback method is executed.
Register the onAppointmentCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onAppointmentCreate": { "handler": "onAppointmentCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onAppointmentCreateCallback: function(payload) { console.log("Logging arguments from onAppointmentCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "appointment": { "source_additional_info": {}, "targetable_id": null, "location": null, "latitude": null, "description": "asds", "creator_id": 39897, "targetable_type": null, "is_deleted": false, "longitude": null, "id": 283387, "is_allday": false, "end_date": "2020-06-24T17:00:45Z", "outcome_id": null, "created_at": "2020-06-24T16:18:10Z", "from_date": "2020-06-24T16:30:45Z", "title": "Test", "updated_at": "2020-06-24T16:18:10Z", "time_zone": "UTC", "checkedin_at": null, "updater_id": null }, "associations": { "targetable": null, "outcome": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "appointment_attendees": [ { "_association_id": 346754, "id": 39897, "_model": "FdMultitenant::User" }, { "_association_id": 346755, "id": 1399366, "_model": "Contact" } ], "updater": null } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onAppointmentCreate", "timestamp": 1593015490.2012472, "version": "2.0" }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onAppointmentCreate event.
appointment appointment object Details of the appointment object created when the onAppointmentCreate event is triggered.
associations associations object Associated objects related to the appointment object.

Attributes of the appointment object

ATTRIBUTE DATA TYPE DESCRIPTION
source_additional_info object Meta information specified as a custom JSON object.
targetable_id string Identifier of the contact/salesaccount/deal for whom appointment has been created.
location string Location where the appointment is scheduled.
latitude string Latitude of the location where the appointment is scheduled.
description string Description of the appointment.
creator_id number Identifier of the user who created the appointment.
targetable_type string Describes the entity value for whom the appointment was created.
Possible value: Contact
is_deleted boolean Set to 'true' if the appointment is deleted.
longitude string Longitude of the location where the appointment is scheduled.
id number Identifier of the appointment.
is_allday boolean Specifies if the appointment is an all-day appointment or not, the default value is false.
end_date
Mandatory
string Timestamp indicating the end of the appointment, or the end date, if this is an all-day appointment, specified in the UTC format.
outcome_id number Identifier of the appointment outcome.
created_at string Appointment creation timestamp, specified in the UTC format.
from_date
Mandatory
string Timestamp indicating the start of the appointment, or the start date if this is an all-day appointment, specified in the UTC format.
title
Mandatory
string Title of the appointment.
updated_at string Appointment updated timestamp, specified in the UTC format.
time_zone string Time zone of the region where the appointment is scheduled.
checkedin_at string Date and time of the scheduled appointment.
updater_id string Identifier of the user who created the appointment.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
targetable number Details of the contact/salesaccount/deal for whom the appointment has been created.
Attributes of the targetable object:
id (number): Identifier of the contact/salesaccount/deal.
_model (string): Description of the entity value.
Possible values : Contact, SalesAccount, Deal
outcome string Details of the user who updated the appointment.
creator user object Details of the user who updated the appointment.
appointment_attendees array Details of all the attendees associated with the appointment.
updater user object Details of the user who updated the appointment. For onAppointmentCreate, this value is null.
onAppointmentUpdate

When an appointment is updated, the onAppointmentUpdate event is invoked and the registered callback method is executed.
Register the onAppointmentUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onAppointmentUpdate": { "handler": "onAppointmentUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onAppointmentUpdateCallback: function(payload) { console.log("Logging arguments from onAppointmentUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "appointment": { "targetable_id": null, "location": null, "latitude": null, "description": "This is just an updated version of sample Appointment.", "creator_id": 39897, "targetable_type": null, "is_deleted": false, "longitude": null, "id": 283270, "is_allday": false, "end_date": "2016-06-20T06:00:00Z", "outcome_id": null, "created_at": "2020-06-24T14:03:26Z", "from_date": "2016-06-20T05:00:00Z", "title": "Updated Appointment", "updated_at": "2020-06-24T14:03:27Z", "time_zone": "UTC", "checkedin_at": null, "updater_id": 39897 }, "associations": { "targetable": null, "outcome": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "appointment_attendees": [ { "_association_id": 346754, "id": 39897, "_model": "FdMultitenant::User" }, { "_association_id": 346755, "id": 1399366, "_model": "Contact" } ], "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null } }, "changes": { "model_changes": { "title": [ "Sample Appointment", "Updated Appointment" ], "description": [ "This is just a sample Appointment.", "This is just an updated version of sample Appointment." ], "updater_id": [ null, 39897 ], "updated_at": [ "2020-06-24T14:03:26Z", "2020-06-24T14:03:27Z" ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onAppointmentUpdate", "timestamp": 1593007407.3063838, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When an appointment is deleted, the is_deleted field is set to true.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onAppointmentUpdate event.
appointment appointment object Details of the appointment object.
associations associations object Associated objects related to the appointment object.
changes object Updated field values.
onTaskCreate

When a task is created, the onTaskCreate event is invoked and the registered callback method is executed.
Register the onTaskCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onTaskCreate": { "handler": "onTaskCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onTaskCreateCallback: function(payload) { console.log("Logging arguments from onTaskCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "task": { "source_additional_info": {}, "targetable_id": null, "description": "task create", "creator_id": 39897, "owner_id": 39897, "targetable_type": null, "is_deleted": false, "task_type_id": null, "id": 301943, "status": "Open", "outcome_id": null, "completed_date": null, "due_date": "2020-06-25T14:30:00Z", "created_at": "2020-06-24T14:18:23Z", "title": "task create", "updated_at": "2020-06-24T14:18:23Z", "updater_id": null }, "associations": { "targetable": null, "task_type": null, "outcome": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": null, "task_users": [ { "_association_id": 428048, "user_id": 39897 } ] } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onTaskCreate", "timestamp": 1593008303.3584583, "version": "2.0" }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onTaskCreate event.
task task object Details of the task object created when the onTaskCreate event is triggered.
associations associations object Associated objects related to the task object.

Attributes of the task object

ATTRIBUTE DATA TYPE DESCRIPTION
source_additional_info object Meta information specified as a custom JSON object.
targetable_id
Mandatory
number Identifier of the contact/salesaccount/deal for whom the task has been created.
description string Description of the task.
creator_id number Identifier of the user who created the task.
owner_id number ID of the user to whom the task has been assigned.
targetable_type
Mandatory
string Describes the entity value for whom the task was created.
Possible value:
Contact
is_deleted boolean Set to 'true' if the task has been deleted.
task_type_id number Identifier of task sales activity type
id number Identifier of the task.
status string Status of the task.
Possible values : Open (0), Completed (1)
outcome_id number Identifier of outcome of task sales activity type.
completed_date string Timestamp indicating when the task was completed, specified in the UTC format.
due_date
Mandatory
string Timestamp indicating when the task is to be completed, specified in the UTC format.
created_at string Task creation timestamp, specified in the UTC format.
title
Mandatory
string Title of the task.
updated_at string Task updated timestamp, specified in the UTC format. For onTaskCreate, this value is the same as created_at.
updater_id object Identifier of the user who updated the task.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
targetable targetable object Details of the contact/salesaccount/deal for whom the task has been created.
Attributes of the targetable object
id (number): ID of the contact/salesaccount/deal
_model (string): Description of the entity value.
Possible values:
Contact, SalesAccount, Deal
task_type task_type object Description of the task sales activity type.
Attributes of the task_type object
name (string): Name of the task.
sales_activity_type_id (number): Identifier of the sales activity type.
outcome outcome object Description of the task sales activity type outcome.
Attributes of the outcome object
id (number): Identifier of the task sales activity type outcome.
name (string): Description of the entity value.
creator user object Details of the user who created the task.
owner user object Details of the user to whom the task has been assigned.
updater user object Details of the user who updated the task
task_users array of objects Details (_association_id, user_id) of the task collaborators.

onTaskUpdate

When a task is updated, the onTaskUpdate event is invoked and the registered callback method is executed.
Register the onTaskUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onTaskUpdate": { "handler": "onTaskUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onTaskUpdateCallback: function(payload) { console.log("Logging arguments from onTaskUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{ "iparams": {}, "region": "US", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshworks_crm" }, "data": { "actor": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "language": "en", "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "is_forgotten": false, "mobile_number": null }, "task": { "source_additional_info": {}, "targetable_id": null, "description": "task update", "creator_id": 39897, "owner_id": 39897, "targetable_type": null, "is_deleted": false, "task_type_id": null, "id": 301943, "status": "Open", "outcome_id": null, "completed_date": null, "due_date": "2020-06-25T14:30:00Z", "created_at": "2020-06-24T14:18:23Z", "title": "task update", "updated_at": "2020-06-24T14:18:38Z", "updater_id": 39897 }, "associations": { "targetable": null, "task_type": null, "outcome": null, "creator": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "owner": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "updater": { "deal_pipeline_id": 27149, "name": "Jim Doe", "is_active": true, "email": "jim.doe@xyz.com", "job_title": "Engineer", "uuid": "195818342547907164", "id": 39897, "created_at": "2020-06-24T08:32:11Z", "type": "user", "updated_at": "2020-06-24T08:34:20Z", "work_number": null, "time_zone": "UTC", "mobile_number": null }, "task_users": [ { "_association_id": 428048, "user_id": 39897 } ] }, "changes": { "model_changes": { "title": [ "task create", "task update" ], "description": [ "task create", "task update" ], "updated_at": [ "2020-06-24T14:18:23Z", "2020-06-24T14:18:38Z" ], "updater_id": [ null, 39897 ] }, "system_changes": {}, "misc_changes": {} } }, "account_id": "195818342531129946", "domain": "sample.myfreshworks.com", "event": "onTaskUpdate", "timestamp": 1593008318.8261375, "version": "2.0" }
EXPAND ↓

The changes field is passed along with the payload. When a task is deleted, the is_deleted field is set to true.

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
actor actor object Details of the entity that triggered the onTaskUpdate event.
task task object Details of the task object.
associations associations object Associated objects related to the task object.
changes object Updated field values.
onCpqDocumentCreate

The Configure, Price, Quote (CPQ) feature of Freshsales Suite enables organizations to configure and generate customer-specific quotes for products/services. As part of this feature, Freshsales Suite users can create standardized documents such as proposals, NDAs, MSAs, and so on by using pre-set templates. For more information, see CPQ add-on in Freshsales Suite.

The onCpqDocumentCreate event is triggered and the registered callback method is executed, when a new document is created in the Freshsales Suite system.

Register the onCpqDocumentCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onCpqDocumentCreate": { "handler": "onCpqDocumentCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onCpqDocumentCreateCallback: function(payload) { console.log("Logging arguments from onCpqDocumentCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ "timestamp": 1496400354326, "account_id": "13", "domain": "sample.myfreshworks.com", "event": "onCpqDocumentCreate", "region": "US", "version": "2.0", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshsales" }, "data": { "cpq_document": { "id": 153150, "created_at": "2022-09-07T09:12:39Z", "updated_at": "2022-09-07T09:12:39Z", "display_name": "Purchase agreement", "display_id_prefix": "DOC", "display_id": 1, "document_number": "DOC-1", "document_type": 1019868749, "cpq_document_template_name": "Purchase agreement document", "deal_id": 6796197, "sales_account_id": 5135558, "contact_id": 8441389, "amount": 677, "base_currency_amount": "677.0", "currency_code": "USD", "stage": 1019868753, "valid_till": "2022-09-22T00:00:00Z", "shipping_address": "chennai", "shipping_city": "chennai", "shipping_state": "Tamil Nadu", "shipping_zipcode": "600006", "shipping_country": "India", "billing_address": "604-5854 Beckford St.", "billing_city": "Glendale", "billing_state": "Arizona", "billing_zipcode": "100652", "billing_country": "USA", "creator_id": 523562, "owner_id": 523562, "territory_id": 818551, "is_deal_primary": false, "cpq_document_template_id": 168209, "is_deleted": false, "custom_fields": { "cf_number": 2, "cf_text": "Description" } }, "associations": { "cpq_document_product_associations": [ { "id": 70000010084, "created_at": "2022-10-21T04:29:49.000Z", "currency_code": "USD", "unit_price": "13.0", "setup_fee": "0.0", "billing_type": 4, "billing_cycle": 1 }, { "id": 70000010085, "created_at": "2022-10-21T04:29:49.000Z", "currency_code": "USD", "unit_price": "12.0", "setup_fee": "0.0", "billing_type": 4, "billing_cycle": 1 } ] }, "actor": { "id": 0, "name": "System", "type": "system" } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
cpq_document cpq document object Information pertaining to the document that is created in the Freshsales Suite system.
associations associations object All associated objects of the cpq document object, which specify additional information pertaining to the document created.
actor actor object Information pertaining to the entity who triggered the onCpqDocumentCreate event in the Freshsales Suite system.
Attributes of the actor object:
id (integer): Identifier of the actor who triggered the product event.
The value of this attribute is 0 when the value of actor.type is system.
name (string): Full name of the actor.
type (string): Name of the entity that triggered the onCpqDocumentCreate event.
Possible value: system

Attributes of the cpq document object

ATTRIBUTE DATA TYPE DESCRIPTION
id integer Identifier of the document object, auto-generated when a document is created in the Freshsales Suite system.
created_at string Timestamp of when the document is created in the Freshsales Suite system, specified in the UTC format.
updated_at string Timestamp of when the document is updated in the Freshsales Suite system, specified in the UTC format.
For onCpqDocumentCreate, the value of this attribute is the same as the created_at value.
display_name string Name of the document created.
display_id_prefix string Preconfigured prefix used as part of the document_number that uniquely identifies a document.
Possible value: DOC
display_id integer Numeric identifier used as part of the document_number that uniquely identifies a document.
document_number string Identifier of a document, auto-generated when the document is created in the Freshsales Suite system.
The value of this attribute is a combination of the values of cpq_document.display_id and cpq_document.display_id_prefix.
document_type integer Type of the document created. For example, quote, proposal, Non-Disclosure Agreement (NDA), Master Service Agreement (MSA), and so on.
cpq_document_template_name string Organizations can standardize the various types of documents by configuring document templates in the Freshsales Suite system.
The value of cpq_document_template_name refers to the name of the template based on which the document is created.
deal_id integer Identifier of the deal object, auto-generated when a deal is created in the Freshsales Suite system.
The value of deal_id identifies the deal for which the document is created.
sales_account_id integer Identifier of the sales account object, auto-generated when a new sales account is configured in the Freshsales Suite system.
The value of sales_account_id identifies the sales account associated with the deal for which the document is created.
contact_id integer Identifier of the contact object, auto-generated when a contact is created in the Freshsales Suite system.
The value of contact_id identifies the primary contact associated with the deal for which the document is created.
amount integer Deal value, which is determined based on the unit price, quantity, and discount specified for the products added to the deal associated with the document.
base_currency_amount string Total value of the product(s) added to the document specified in the base currency configured for the Freshsales Suite account.
currency_code string Currency code indicating the currency in which the deal value is expressed the currency code is in the ISO 4217 format.
stage integer Document stages can be configured in the Freshsales Suite system based on the business process of the organization. The default document stages are,
  • Draft
  • Sent to customer
  • Accepted
  • Declined
The value of stage is the identifier of the current document stage of the document.
When a document is created in the Freshsales Suite system, the document stage is set as draft automatically.
For onCpqDocumentCreate event, the value of this attribute is the identifier of the Draft stage.
valid_till string Validity of the document, specified as a timestamp in the UTC format.
shipping_address string Address to which the product is shipped.
shipping_city string City, district, town, or any other similar component of the address to which the product is shipped.
shipping_state string State, region, province, county, or any other sub component of the address to which the product is shipped.
shipping_zipcode string ZIP or postal code in the address to which the product is shipped.
shipping_country string Country to which the product is shipped.
billing_address string Address associated with the deal’s payment information.
billing_city string City, district, town, or any other similar component of the address associated with the deal’s payment information.
billing_state string State, region, province, county, or any other sub component of the address associated with the deal’s payment information.
billing_zipcode string ZIP or postal code in the address associated with the deal’s payment information.
billing_country string Country name in the address associated with the deal’s payment information.
creator_id integer Identifier of the user who created the document.
owner_id integer Identifier of the user who is assigned as the owner of the document.
For onCpqDocumentCreate event, by default the value of this attribute is the same as the creator_id value.
territory_id integer Identifier of the territory object, auto-generated when a territory is created in the Freshsales Suite system.
Territories can be configured to group users, so the users can focus on a particular set of customers and their sales activities can be monitored on territory basis.
The value of territory_id identifies the territory to which the user who created the document is added.
is_deal_primary boolean Specifies whether a deal is synced with the document created.
A deal can be synced with a document to ensure that any updates to the products associated with the deal will be automatically synced with the document and vice-versa. For more information, see Auto-syncing of deals with documents.
Possible values: true, false
cpq_document_template_id integer Identifier of the template based on which the document is created.
is_deleted boolean Specifies whether the document is deleted from the Freshsales Suite system.
Possible values: true, false
custom_fields object Document details specified through custom fields.
Note: Custom fields can be configured to obtain additional information about the document. The custom_fields attribute contains the custom field names and corresponding values, as a valid JSON object of key (custom field name)-value (custom field’s value) pairs.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
cpq_document_product_associations array of objects Additional information pertaining to the products added to the deal for which the document is created.
Attributes of the cpq_document_product_associations object:
  • id (integer): Identifier of product, auto-generated when the product is created in the Freshsales Suite system.
  • created_at (string): Timestamp of when the product is created in the Freshsales Suite system, specified in the UTC format.
  • currency_code (string): Currency in which the product’s value is expressed, specified in the ISO 4217 format.
  • unit_price (string): Price per unit of the product added to the document.
  • setup_fee (string): Setting up fees, if any, for the product added to the document.
  • billing_type (integer): Identifier of the billing type of the product added to the document.
    Possible values:
    1: monthly subscription
    2: quarterly subscription
    2: half-yearly subscription
    4: annual subscription
    For products with one-time billing, the value of billing_type is null.
  • billing_cycle (integer): Frequency of billing for the product added to the document.
    If the product has one-time billing, billing_cycle is null.

onCpqDocumentUpdate

The onCpqDocumentUpdate event is triggered when,

  • The details of the document are updated.
  • The details of the products associated with the document are modified.
  • The document is previewed or saved as a PDF file.
  • The document is soft deleted.
Register the onCpqDocumentUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onCpqDocumentUpdate": { "handler": "onCpqDocumentUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onCpqDocumentUpdateCallback: function(payload) { console.log("Logging arguments from onCpqDocumentUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{ "timestamp": 1496400354326, "account_id": "13", "domain": "sample.myfreshworks.com", "event": "onCpqDocumentUpdate", "region": "US", "version": "2.0", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshsales" }, "data": { "cpq_document": { "id": 153150, "created_at": "2022-09-07T09:12:39Z", "updated_at": "2022-09-07T09:12:39Z", "display_name": "new doc", "display_id_prefix": "DOC", "display_id": 1, "document_number": "DOC-1", "document_type": 1019868749, "cpq_document_template_name": "document copy", "deal_id": 6796197, "sales_account_id": 5135558, "contact_id": 8441389, "amount": 677, "base_currency_amount": "677.0", "currency_code": "USD", "stage": 1019868753, "valid_till": "2022-09-22T00:00:00Z", "shipping_address": "chennai", "shipping_city": "chennai", "shipping_state": "Tamil Nadu", "shipping_zipcode": "600006", "shipping_country": "India", "billing_address": "604-5854 Beckford St.", "billing_city": "Glendale", "billing_state": "Arizona", "billing_zipcode": "100652", "billing_country": "USA", "creator_id": 523562, "owner_id": 523562, "territory_id": 818551, "is_deal_primary": false, "cpq_document_template_id": 168209, "is_deleted": false, "custom_fields": { "cf_number": 2, "cf_text": "Hello" } }, "associations": { "cpq_document_product_associations": [ { "id": 70000010084, "created_at": "2022-10-21T04:29:49.000Z", "currency_code": "USD", "unit_price": "13.0", "setup_fee": "0.0", "billing_type": 4, "billing_cycle": 1 }, { "id": 70000010085, "created_at": "2022-10-21T04:29:49.000Z", "currency_code": "USD", "unit_price": "12.0", "setup_fee": "0.0", "billing_type": 4, "billing_cycle": 1 } ] }, "changes": { "model_changes": { "deal_id": [ 6796197, 6891801 ], "sales_account_id": [ 5135558, 5212715 ], "contact_id": [ 8441389, 8597857 ], "amount": [ 677, 0 ], "valid_till": [ "2022-09-22T00:00:00Z", "2022-09-30T00:00:00Z" ], "billing_address": [ "604-5854 Beckford St.", null ], "billing_city": [ "Glendale", null ], "billing_state": [ "Arizona", null ], "billing_zipcode": [ "100652", null ], "billing_country": [ "USA", null ], "updater_id": [ null, 523562 ], "updated_at": [ "2022-09-07T09:12:39Z", "2022-09-07T09:15:51Z" ], "base_currency_amount": [ 677, 0 ] }, "system_changes": {}, "misc_changes": {} }, "actor": { "id": 0, "name": "System", "type": "system" } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
cpq_document cpq document object Information pertaining to the document that is updated in the Freshsales system.
associations associations object All associated objects of the cpq document object, which specify additional information pertaining to the document updated.
changes object Changes that triggered the onCpqDocumentUpdate event, specified as a JSON object of the following format:
1
2
3
4
5
6
7
8
"changes": { "model_changes": { //For non-array attributes "<cpq_document.attribute that changed>": ["New value", "Old value"] }, "system_changes": {}, "misc_changes": {} }
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"changes": { "model_changes": { "deal_id": [ 6796197, 6891801 ], "sales_account_id": [ 5135558, 5212715 ], "base_currency_amount": [ 677, 0 ] } "system_changes": {}, "misc_changes": {} }
EXPAND ↓
Attributes of the changes object:
model_changes (object): List of all attributes whose values have changed along with the old and modified values of the attributes.
system_changes (object): List of all system-level parameters whose values have changed, along with the old and modified values.
misc_changes (object): List of all miscellaneous database parameters whose values have changed, along with the old and modified values.
actor actor object Information pertaining to the entity who triggered the onCpqDocumentUpdate event in the Freshsales system.
Attributes of the actor object:
id (integer): Identifier of the actor who triggered the product event.
The value of this attribute is 0 when the value of actor.type is system.
name (string): Full name of the actor.
type (integer): Name of the entity that triggered the onCpqDocumentUpdate event.
Possible value: system

onCpqDocumentDelete

The onCpqDocumentDelete event is triggered and the registered callback method is executed, when a document is deleted from the Freshsales Suite system.
Register the onCpqDocumentDelete event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onCpqDocumentDelete": { "handler": "onCpqDocumentDeleteCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onCpqDocumentDeleteCallback: function(payload) { console.log("Logging arguments from onCpqDocumentDelete event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ "timestamp": 1496400354326, "account_id": "13", "domain": "sample.myfreshworks.com", "event": "onCpqDocumentDelete", "region": "US", "version": "2.0", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshsales" }, "data": { "cpq_document": { "id": 50000002175, "cpq_document_product_association_ids": [ 50000002674 ] }, "actor": { "id": 0, "name": "System", "type": "system" } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
cpq_document object Information pertaining to the document that is deleted from the Freshsales Suite system.
Attributes of the object:
id (string): Identifier of the document object, auto-generated when a document is created in the Freshsales Suite system.
cpq_document_product_association_ids (array of integers): Identifiers of the products/services associated with the document. This identifier helps purge the system of any association created between the document and the corresponding products, when the onCpqDocumentDelete event deletes a document from the Freshsales Suite system.
actor object Information pertaining to the entity who triggered the onCpqDocumentDelete event in the Freshsales Suite system. Attributes of the actor object:
id (integer): Identifier of the actor who triggered the product event.
The value of this attribute is 0 when the value of actor.type is system.
name (string): Full name of the actor.
type (integer): Name of the entity that triggered the onCpqDocumentDelete event.
Possible values: system

onProductCreate

When a product is created in the Freshsales Suite system, the onProductCreate is invoked and the registered callback method is executed.
Register the onProductCreate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onProductCreate": { "handler": "onProductCreateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onProductCreateCallback: function(payload) { console.log("Logging arguments from onProductCreate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{ "timestamp": 1496400354326, "account_id": "13", "domain": "sample.myfreshworks.com", "event": "onProductCreate", "region": "US", "version": "2.0", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshsales" }, "data": { "product": { "id": 547921, "created_at": "2022-09-07T08:47:04Z", "updated_at": "2022-09-07T08:47:04Z", "name": "Samsung", "category": "Hardware", "product_code": "S11", "sku_number": "MOSA12309", "parent_product": 547920, "valid_till": "2023-01-05T00:00:00Z", "is_active": true, "description": "Extra 2GB RAM", "is_deleted": false, "import_csv_id": 18, "import_id": 3, "creator_id": 523562, "custom_fields": { "cf_number": 2, "cf_text": "Hello" } }, "associations": { "product_pricings": [ { "id": 70000004121, "created_at": "2022-10-21T04:29:23.000Z", "currency_code": "USD", "unit_price": "15.0", "setup_fee": 0, "billing_type": 4, "billing_cycle": 1 } ], "creator": { "id": 523562, "created_at": "2022-08-29T08:59:50Z", "updated_at": "2022-09-07T08:40:13Z", "name": "Alice Adrian", "type": "user", "email": "alice.adrian@freshworks.com", "is_active": true, "work_number": "91780000457", "mobile_number": "917900003478", "time_zone": "Eastern Time (US & Canada)", "deal_pipeline_id": 322010, "job_title": "Engineer" }, "owner": { "id": 523562, "created_at": "2022-08-29T08:59:50Z", "updated_at": "2022-09-07T08:40:13Z", "name": "Alice Adrian", "type": "user", "email": "alice.adrian@freshworks.com", "is_active": true, "work_number": "91780000457", "mobile_number": "917900003478", "time_zone": "Eastern Time (US & Canada)", "deal_pipeline_id": 322010, "job_title": "Engineer" }, "updater": null }, "actor": { "id": 0, "name": "System", "type": "system" } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
product product object Information pertaining to the product created in the Freshsales Suite system.
associations associations object All associated objects of the product object, which specify additional information pertaining to the product created.
actor actor object Information pertaining to the entity who triggered the onProductCreate event in the Freshsales Suite system.
Attributes of the actor object:
id (integer): Identifier of the actor who triggered the product event.
The value of this attribute is 0 when the value of actor.type is system.
name (string): Full name of the actor.
type (string): Name of the entity that triggered the onProductCreate event.
Possible value: system

Attributes of the product object

ATTRIBUTE DATA TYPE DESCRIPTION
id integer Identifier of the product object, auto-generated when a product is created in the Freshsales Suite system.
created_at string Timestamp of when the product is created in the Freshsales Suites system, specified in the UTC format.
updated_at string Timestamp of when the product details are last updated in the Freshsales Suite system, specified in the UTC format.
For onProductCreate, the value of this attribute is the same as the created_at value.
name string Name of the product.
category string Name of the category associated with the product. For example, hardware, software, maintenance, and so on. Custom categories can be created in the account as per requirements.
product_code string Value of the product code associated with the product.
sku_number string Stock keeping unit number associated with the product.
parent_product integer Identifier of the parent product.
A product created in the Freshsales Suite system can be added as a subsidiary product of a primary/ parent product.
The value of this attribute is a valid product.id.
valid_till string Date till when the product is available in the Freshsales Suite system, specified as a timestamp in the UTC format.
is_active boolean Specifies whether the product is available for sale currently.
Possible values: true, false
description string Summary of the product.
is_deleted boolean Specifies whether the product details are deleted from the Freshsales Suite system.
Possible values: true, false
import_csv_id integer Identifier of the CSV file uploaded into the Freshsales Suite system for importing product details.
Product details can be imported, in bulk, into the account through CSV files. For more information on importing products, see How to import products into Freshsales.
import_id integer Identifier of the import task that creates the product in the Freshsales Suite system.
creator_id integer Identifier of the user who created the product.
custom_fields object Information pertaining to the product’s custom fields, which are configured in the account to display additional product information.
Attributes within this object are key-value pairs representing name and value of the custom field respectively.

Attributes of the associations object

ATTRIBUTE DATA TYPE DESCRIPTION
product_pricings array of objects Information pertaining to the pricing of the created product.
Attributes of the product_pricings object:
  • id (integer): Identifier of the product, auto-generated when the product is created in the Freshsales Suite system.
  • created_at (string): Timestamp of when the product is created in the Freshsales Suite system, specified in the UTC format.
  • currency_code (string): Currency in which the product’s value is expressed, specified in the ISO 4217 format.
  • unit_price (string): Price per unit of the product.
  • setup_fee (string): Setting-up fee of the product.
  • billing_type (integer): Identifier of the billing type specified for the product. Possible values:
    1: monthly subscription
    2: quarterly subscription
    2: half-yearly subscription
    4: annual subscription
    For products with one-time billing, the value of billing_type is null.
    Note: Billing type for the product cannot be changed once configured.
  • billing_cycle (integer): Frequency of billing.
    If the product has one-time billing, billing_cycle is null.
creator user object Information pertaining to the user who created the product.
owner user object Information pertaining to the user who is assigned as the owner of the product.
For onProductCreate, by default, owner is the same as the creator.
updater user object Information pertaining to the user who last updated the product details.
For onProductCreate, this value is null.

onProductUpdate

The onProductUpdate event is triggered when,

  • A product’s details are modified.
  • A product is soft deleted.
  • A product’s pricing details are modified.
Register the onProductUpdate event by using the following sample manifest.json content.

Copied Copy
1
2
3
4
5
"events": { "onProductUpdate": { "handler": "onProductUpdateCallback" } }

Define the corresponding callback by using the following sample server.js content:

Copied Copy
1
2
3
4
5
exports = { onProductUpdateCallback: function(payload) { console.log("Logging arguments from onProductUpdate event: " + JSON.stringify(payload)); } }
Sample Payload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ "timestamp": 1496400354326, "account_id": "13", "domain": "sample.myfreshworks.com", "event": "onProductUpdate", "region": "US", "version": "2.0", "productContext": { "url": "https://sample.myfreshworks.com/crm", "name": "freshsales" }, "data": { "product": { "id": 547921, "created_at": "2022-09-07T08:47:04Z", "updated_at": "2022-09-07T08:47:04Z", "name": "Samsung", "category": "Hardware", "product_code": "S11", "sku_number": "MOSA12309", "parent_product": 547920, "valid_till": "2023-01-05T00:00:00Z", "is_active": true, "description": "Extra 2GB RAM", "is_deleted": true, "import_csv_id": 9, "import_id": 18, "creator_id": 523562, "custom_fields": { "cf_number": 2, "cf_text": "Hello" } }, "associations": { "product_pricings": [ { "id": 70000004121, "created_at": "2022-10-21T04:29:23.000Z", "currency_code": "USD", "unit_price": "15.0", "setup_fee": 0, "billing_type": 4, "billing_cycle": 1 } ], "creator": { "id": 523562, "created_at": "2022-08-29T08:59:50Z", "updated_at": "2022-09-07T08:40:13Z", "name": "Alice Adrian S", "type": "user", "email": "alice.adrian@freshworks.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "Eastern Time (US & Canada)", "deal_pipeline_id": 322010, "job_title": "Engineer" }, "owner": { "id": 523562, "created_at": "2022-08-29T08:59:50Z", "updated_at": "2022-09-07T08:40:13Z", "name": "Alice Adrian S", "type": "user", "email": "alice.adrian@freshworks.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "Eastern Time (US & Canada)", "deal_pipeline_id": 322010, "job_title": "Engineer" }, "updater": { "id": 523562, "created_at": "2022-08-29T08:59:50Z", "updated_at": "2022-09-07T08:40:13Z", "name": "Alice Adrian S", "type": "user", "email": "alice.adrian@freshworks.com", "is_active": true, "work_number": null, "mobile_number": null, "time_zone": "Eastern Time (US & Canada)", "deal_pipeline_id": 322010, "job_title": "Engineer" } }, "changes": { "model_changes": { "name": [ "Samsung", "Apple" ], "product_code": [ "S11", "A01" ], "sku_number": [ "MOSA12309", "A12309" ], "description": [ "Extra 2GB RAM", "Extra Security" ], "updated_at": [ "2022-09-07T08:54:44Z", "2022-09-07T08:56:41Z" ], "is_deleted": [ false, true ] }, "system_changes": {}, "misc_changes": {} }, "actor": { "id": 0, "name": "System", "type": "system" } } }
EXPAND ↓

Attributes of the data object

ATTRIBUTE DATA TYPE DESCRIPTION
product product object Information pertaining to the product that is updated in the Freshsales Suite system.
associations associations object All associated objects of the product object, which specify additional information pertaining to the product updated.
changes object Changes that triggered the onProductUpdate event, specified as a JSON object of the following format:
1
2
3
4
5
6
7
8
"changes": { "model_changes": { //For non-array attributes "<product.attribute that changed>": ["New value", "Old value"] }, "system_changes": {}, "misc_changes": {} }
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"changes": { "model_changes": { "name": [ "Samsung", "Apple" ], "product_code": [ "S11", "A01" ], "sku_number": [ "MOSA12309", "A12309" ] }, "system_changes": {}, "misc_changes": {} }
EXPAND ↓
Attributes of the changes object:
model_changes (object): List of all attributes whose values have changed along with the old and modified values of the attributes.
Note: If a product’s deletion triggers the onProductUpdate event, the is_deleted attribute is set to true and the is_deleted attribute is present as part of the changes object.
system_changes (object): List of all system-level parameters whose values have changed, along with the old and modified values.
misc_changes (object): List of all miscellaneous database parameters whose values have changed, along with the old and modified values.
actor actor object Information pertaining to the entity who triggered the onProductUpdate event in the Freshsales Suite system.
Attributes of the actor object:
id (integer): Identifier of the actor who triggered the product event.
The value of this attribute is 0 when the value of actor.type is system.
name (string): Full name of the actor.
type (string): Name of the entity that triggered the onProductUpdate event.
Possible value: system

Test

For information on how to test external events, see Test the App.