Skip to content

Webhooks

As explained in the architecture overview section, there are many internal events in the NurtureCloud system that will relay data through the Data API. Any time new data is available a webhook notification will be triggered for each notification subscribers.

The notification is a simple HTTP Request using the POST verb. To allow subscribers to better understand the data it's being sent to your servers, every message will be wrapped by a message envelope as described below.

{
  "domainComponentName": "agent",
  "state": "Current",
  "payload": {
    "organisationName": "raywhite",
    "businessId": "00000000-0000-0000-0000-000000000001",
    ...
  }
}

It is important to notice that the payload will vary according to the Business Entity being sent. However, each of them will always contain the organisationName and businessId fields in it.

With regard to state, it can have one of the following values:

  • Created - identifies that an entry was just created in the core of the system.
  • Updated - identifies that an entry was just modified in the core of the system.
  • Current - identifies that the received entity is an exact copy of the current state of it.
  • Deleted - identifies that an entry was just deleted in the core of the system.

Deletion Notifications

Deletion notifications have the same format for all domain components. They contain the following fields only:

  • organisationName - the name of the organisation that the entity belongs to.
  • businessId - the id of the business that the entity belonged to.
  • id - the id of the entity that was deleted.
  • mergedInto (optional) - this is an optional field that will be present if the entity was merged into another one. If you don't have any special logic around merging entities it is safe to ignore.
  • mergedInto.organisationName - the name of the organisation that the entity was merged into. Currently it will always be the same as the organisationName field.
  • mergedInto.businessId - the id of the business that the entity was merged into.
  • mergedInto.id - the id of the entity that the entity was merged into.
{
  "domainComponentName": "agent",
  "state": "Deleted",
  "payload": {
    "organisationName": "raywhite",
    "businessId": "00000000-0000-0000-0000-000000000001",
    "id": "00000000-0000-0000-0000-000000000001"
    "mergedInto": {
        "organisationName": "raywhite",
        "businessId": "00000000-0000-0000-0000-000000000001",
        "id": "00000000-0000-0000-0000-000000000002"
    }
  }
}