Configure onContactCreate and onContactUpdate

onContactCreate

When a contact is created, the onContactCreate event is invoked and the registered callback method is executed.

Subscribe to the onContactCreate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onContactCreate": {
    "handler": "onContactCreateCallback"
  }
}

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

server.js
exports = {
  onContactCreateCallback: function(payload) {
    console.log("Logging arguments from onContactCreate event: " + JSON.stringify(payload));
    }
  }

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onContactCreate event.

    • created_atstring

      Timestamp of when the actor is created in the Freshworks system, specified in the UTC format.

    • deal_pipeline_idinteger

      Identifier of deal pipelines that the actor is part of.

    • emailstring

      Email address of the actor.

    • idinteger

      Identifier associated with the actor.

    • is_activeboolean

      Specifies whether the actor is verified.

      Possible values: true, false

    • is_forgottenboolean

      Specifies whether the specified data is deleted permanently from the Freshworks system.

      Possible values: true, false

    • job_titlestring

      Designation of the actor.

    • languagestring

      Language of the actor; by default, language is en.

    • mobile_numberinteger

      Phone number of the actor.

    • namestring

      Name of the actor.

    • time_zonestring

      Time zone of the actor, specified in the UTC format.

    • typestring

      Category of the actor created.

    • updated_atstring

      Timestamp of when the actor is updated in the Freshworks system, specified in the UTC format.

      For onContactCreate, this attribute value is the same as created_at.

    • uuidstring

      Universally unique identifier of the actor.

    • work_numberinteger

      Official phone number of the actor.

  • associationsobject

    All associated objects of the contact object, which specify additional information pertaining to the contact created.

    • campaignstring

      UTM campaign.

    • contact_statusstring

      Qualification status of the contact.

    • creatorobject

      Details of contact creator.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • listsarray

      Marketing lists associated with the contact.

    • ownerobject

      Details of the contact owner.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • sales_accountsarray of integers

      Sales accounts of the contact.

    • sourcestring

      Source details of this contact.

    • team_usersarray

      Collaborators associated with the contact.

    • territorystring

      Territory of the contact.

    • updaterobject

      Details of the contact updater. For onContactCreate, this value is null.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

  • contactobject

    Information pertaining to the contact object created when the onContactCreate event is triggered.

    • active_sales_sequencesobject

      Active sales campaigns that this contact was part of.

    • addressobject

      Address of the contact.

    • avatarstring

      URL of the image used as the avatar for the contact.

    • campaign_idobject

      Identifier of the UTM campaign.

    • cityobject

      City where the contact is located.

    • completed_sales_sequencesobject

      Completed sales sequences that this contact was part of.

    • contact_status_idobject

      Identifier of the contact status.

    • countryobject

      Country of the contact.

    • created_atobject

      Contact creation timestamp.

    • creator_idobject

      Identifier of the user who created the contact.

    • custom_fieldsarray of strings

      Key value pairs containing the names and values of custom fields.

    • do_not_disturbboolean

      Set to true if contact is not to be disturbed.

    • emailsobject

      Primary and secondary emails associated with the contact.

    • external_idobject

      Identifier of the external references from which the contact information is fetched.

    • facebookobject

      Facebook ID of the contact.

    • first_assigned_atobject

      First assigned timestamp.

    • first_contactedobject

      First contacted timestamp.

    • first_nameobject

      First name of the contact.

    • idinteger

      Identifier of the contact.

    • import_csv_idobject

      Reference of all imports that this contact was part of.

    • import_idstring

      Identifier of the equivalent record in the external system from which it was imported.

    • is_deletedboolean

      Specifies whether the contact is deleted.

      Possible values: true, false

    • job_titleobject

      Job title of the contact.

    • keywordobject

      Keyword tracked in UTM.

    • last_assigned_atobject

      Last assigned timestamp.

    • last_contactedobject

      Last contacted timestamp.

    • last_contacted_modeobject

      Last mode of contact.

      Possible values: Email Incoming, Email Outgoing, Call Incoming, Call Outgoing, Email Opened, Chat, and Sales Activity.

    • last_contacted_sales_activity_modestring

      Last mode of sales activity rendered to the contact.

    • last_contacted_via_sales_activityobject

      Last contacted timestamp (through sales activity).

    • last_nameobject

      Last name of the contact.

    • last_seenobject

      Last seen timestamp.

    • lead_scoreobject

      Score to qualify a contact.

    • lead_source_idinteger

      Identifier of the source of the deal.

    • linkedinobject

      LinkedIn address of the contact.

    • list_idsarray of integers

      Identifiers of the marketing lists associated with the contact.

    • mcr_idinteger

      Identifier of the master customer record to which the contact information belongs. This value is auto-generated.

    • mediumobject

      Medium tracked in UTM.

    • merged_tonumber

      Reference of secondary contacts merged to the primary contact.

    • mobile_numberobject

      Mobile number of the contact.

    • nameobject

      First and last name of the contact.

    • open_deals_amountinteger

      Sum of all the open deals associated with the contact.

    • owner_idobject

      User who owns the record.

    • recent_noteobject

      Recently added note against the contact.

    • sales_account_idsarray of integers

      Identifiers of the sales account associated with this contact.

    • source_additional_infoobject

      Meta information specified as a custom JSON object.

    • stateobject

      State where the contact is located.

    • statusstring

      Status of the contact.

      Possible values: active, merged, deleted

    • subscription_typesobject

      Subscription types available.

      Possible values: Promotional, Newsletter, Product updates, Conferences & Events, Non-marketing emails from our company

    • tagsobject

      Tags associated with this contact.

    • team_user_idsarray

      Identifiers of the collaborators associated with the contact.

    • territory_idobject

      Identifier of the territory.

    • time_zoneobject

      Time zone of the contact.

    • twitterobject

      Twitter ID of the contact.

    • updated_atobject

      Timestamp of when the contact was updated.

    • updater_idobject

      Identifier of the user who updated the contact.

    • web_form_idsobject

      Forms through which this record was captured.

    • won_deals_amountobject

      Sum of all won deals associated with the contact.

    • work_emailobject

      Official email address of the contact.

    • work_numberobject

      Telephone number of the contact.

    • zipcodeobject

      Postal code of the region where the contact is located.

onContactUpdate

When a contact is updated, the onContactUpdate event is invoked and the registered callback method is executed.

Subscribe to the onContactUpdate event and register the callback by using the following sample manifest.json content.

manifest.json
"events": {
  "onContactUpdate": {
    "handler": "onContactUpdateCallback"
  }
}

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

server.js
exports = {
  onContactUpdateCallback: function(payload) {
    console.log("Logging arguments from onContactUpdate event: " + JSON.stringify(payload));
    }
  }

Attributes of the data object

  • actorobject

    Information pertaining to the entity who triggered the onContactUpdate event.

    • created_atstring

      Timestamp of when the actor is created in the Freshworks system, specified in the UTC format.

    • deal_pipeline_idinteger

      Identifier of deal pipelines that the actor is part of.

    • emailstring

      Email address of the actor.

    • idinteger

      Identifier associated with the actor.

    • is_activeboolean

      Specifies whether the actor is verified.

      Possible values: true, false

    • is_forgottenboolean

      Specifies whether the specified data is deleted permanently from the Freshworks system.

      Possible values: true, false

    • job_titlestring

      Designation of the actor.

    • languagestring

      Language of the actor; by default, language is en.

    • mobile_numberinteger

      Phone number of the actor.

    • namestring

      Name of the actor.

    • time_zonestring

      Time zone of the actor, specified in the UTC format.

    • typestring

      Category of the actor created.

    • updated_atstring

      Timestamp of when the actor is updated in the Freshworks system, specified in the UTC format.

      For onContactCreate, this attribute value is the same as created_at.

    • uuidstring

      Universally unique identifier of the actor.

    • work_numberinteger

      Official phone number of the actor.

  • associationsobject

    All associated objects of the contact object, which specify additional information pertaining to the contact updated.

    • campaignstring

      UTM campaign.

    • contact_statusstring

      Qualification status of the contact.

    • creatorobject

      Details of contact creator.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • listsarray

      Marketing lists associated with the contact.

    • ownerobject

      Details of the contact owner.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

    • sales_accountsarray of integers

      Sales accounts of the contact.

    • sourcestring

      Source details of this contact.

    • team_usersarray

      Collaborators associated with the contact.

    • territorystring

      Territory of the contact.

    • updaterobject

      Details of the contact updater. For onContactCreate, this value is null.

      • created_atstring

        Timestamp of when the user is created in the Freshworks system, specified in the UTC format.

      • deal_pipeline_idinteger

        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.

      • emailstring

        Email address of the user.

      • idinteger

        Identifier of the user.

      • is_activeboolean

        Specifies whether the user is currently active in the Freshworks system.

        Possible values: true, false

      • job_titlestring

        Designation of the user in the Freshworks system.

      • mobile_numberstring

        Contact number of the user.

      • namestring

        Name of the user.

      • time_zonestring

        Time zone of the user configured in the Freshworks system.

      • typestring

        Identifier of the person involved in creating, owning, or updating the product.

        Possible value: user

      • updated_atstring

        Timestamp of when the user is last updated in the Freshworks system, specified in the UTC format.

      • uuidinteger

        Unique user identifier, this value is auto-generated.

      • work_numberstring

        Official phone number of the user.

  • changesobject

    Information pertaining to the contact whose details are modified in the Freshworks system.

    Changes that triggered the onContactUpdate event, specified as a JSON object of the following format:

    "changes": {
      "misc_changes": {},
      "model_changes": {
        //For non-array attributes
        "<contact.attribute that changed>": ["Old value", "New value"]
      },
      "system_changes": {}
    }
    • misc_changesobject

      List of all miscellaneous database parameters whose values have changed, along with the old and modified values.

    • model_changesobject

      List of all attributes whose values have changed, along with the old and modified values of the attributes.

    • system_changesobject

      List of all system-level parameters whose values have changed, along with the old and modified values.

  • contactobject

    Information pertaining to the contact.

    • active_sales_sequencesobject

      Active sales campaigns that this contact was part of.

    • addressobject

      Address of the contact.

    • avatarstring

      URL of the image used as the avatar for the contact.

    • campaign_idobject

      Identifier of the UTM campaign.

    • cityobject

      City where the contact is located.

    • completed_sales_sequencesobject

      Completed sales sequences that this contact was part of.

    • contact_status_idobject

      Identifier of the contact status.

    • countryobject

      Country of the contact.

    • created_atobject

      Contact creation timestamp.

    • creator_idobject

      Identifier of the user who created the contact.

    • custom_fieldsarray of strings

      Key value pairs containing the names and values of custom fields.

    • do_not_disturbboolean

      Set to true if contact is not to be disturbed.

    • emailsobject

      Primary and secondary emails associated with the contact.

    • external_idobject

      Identifier of the external references from which the contact information is fetched.

    • facebookobject

      Facebook ID of the contact.

    • first_assigned_atobject

      First assigned timestamp.

    • first_contactedobject

      First contacted timestamp.

    • first_nameobject

      First name of the contact.

    • idinteger

      Identifier of the contact.

    • import_csv_idobject

      Reference of all imports that this contact was part of.

    • import_idstring

      Identifier of the equivalent record in the external system from which it was imported.

    • is_deletedboolean

      Specifies whether the contact is deleted.

      Possible values: true, false

    • job_titleobject

      Job title of the contact.

    • keywordobject

      Keyword tracked in UTM.

    • last_assigned_atobject

      Last assigned timestamp.

    • last_contactedobject

      Last contacted timestamp.

    • last_contacted_modeobject

      Last mode of contact.

      Possible values: Email Incoming, Email Outgoing, Call Incoming, Call Outgoing, Email Opened, Chat, and Sales Activity.

    • last_contacted_sales_activity_modestring

      Last mode of sales activity rendered to the contact.

    • last_contacted_via_sales_activityobject

      Last contacted timestamp (through sales activity).

    • last_nameobject

      Last name of the contact.

    • last_seenobject

      Last seen timestamp.

    • lead_scoreobject

      Score to qualify a contact.

    • lead_source_idinteger

      Identifier of the source of the deal.

    • linkedinobject

      LinkedIn address of the contact.

    • list_idsarray of integers

      Identifiers of the marketing lists associated with the contact.

    • mcr_idinteger

      Identifier of the master customer record to which the contact information belongs. This value is auto-generated.

    • mediumobject

      Medium tracked in UTM.

    • merged_tonumber

      Reference of secondary contacts merged to the primary contact.

    • mobile_numberobject

      Mobile number of the contact.

    • nameobject

      First and last name of the contact.

    • open_deals_amountinteger

      Sum of all the open deals associated with the contact.

    • owner_idobject

      User who owns the record.

    • recent_noteobject

      Recently added note against the contact.

    • sales_account_idsarray of integers

      Identifiers of the sales account associated with this contact.

    • source_additional_infoobject

      Meta information specified as a custom JSON object.

    • stateobject

      State where the contact is located.

    • statusstring

      Status of the contact.

      Possible values: active, merged, deleted

    • subscription_typesobject

      Subscription types available.

      Possible values: Promotional, Newsletter, Product updates, Conferences & Events, Non-marketing emails from our company

    • tagsobject

      Tags associated with this contact.

    • team_user_idsarray

      Identifiers of the collaborators associated with the contact.

    • territory_idobject

      Identifier of the territory.

    • time_zoneobject

      Time zone of the contact.

    • twitterobject

      Twitter ID of the contact.

    • updated_atobject

      Timestamp of when the contact was updated.

    • updater_idobject

      Identifier of the user who updated the contact.

    • web_form_idsobject

      Forms through which this record was captured.

    • won_deals_amountobject

      Sum of all won deals associated with the contact.

    • work_emailobject

      Official email address of the contact.

    • work_numberobject

      Telephone number of the contact.

    • zipcodeobject

      Postal code of the region where the contact is located.