Skip to main content

Calry Webhooks

Get notified of any data changes from our cached database and avoid rate limits.

Overview​

When you've connected to Calry, you'll want to know when data in your linked integrations is updated so that you know when to sync data, keeping your own database up to date. Instead of polling for data on a recurring basis - which can be inefficient and result in timing conflicts - webhooks will push alerts to your API at the time that relevant data is updated.

Calry Webhooks

In this guide, you'll learn how to add and manage these webhooks. Webhooks will come in the form of inbound POST requests to your API, which you can use to trigger the creation, update, or deletion of data in your system to mirror some event in Calry, or any other action you want - you are only limited by the code you can write.

Adding a webhook​

  1. To create webhooks, go to the Webhooks management console in your Calry left side bar and click Webhook.

  2. Enable the webhook by clicking the left toggle button.

  3. Click on the Add Endpoint button on the top right to add a new endpoint.

  4. On the next page, add the endpoint name, add the URL that you want Calry to send a POST request to. This URL should point to a POST route in your API that you'll build to handle the incoming payload.

    Add Webhook

  5. Make sure to select the event types that you want to trigger the webhook.

  6. Create the endpoint by clicking the Create button.

  7. Your endpoint will now be listed in the Webhooks management console. You can edit or delete the endpoint by clicking the respective buttons.

    Webhook List

Events types​

There are two main types of events that can trigger a webhook:

  1. System Events - These are events that are triggered by changes to the Calry system, such as when a user links an account, or when a user's data is updated.
    1. account.created - A integration account has been created.
    2. account.updated - A integration account has been updated.
    3. account.deleted - A integration account has been deleted.
    4. link.created - A link has been created.
    5. link.updated - A link has been updated.
    6. link.deleted - A link has been deleted.
    7. sync.complete - A sync has been completed.
    8. sync.error - A sync has been errored.
    9. sync.paused - A sync has been paused.
  2. Entity Events - These are events that are triggered by changes to a specific entity, such as when a reservation is created, updated, or deleted.
    1. Reservation Events
      1. reservation.created - A reservation has been created.
      2. reservation.updated - A reservation has been updated.
      3. reservation.deleted - A reservation has been deleted.
      4. reservations.synced - Reservations have been synced.
    2. Property Events
      1. property.created - A property has been created.
      2. property.updated - A property has been updated.
      3. property.deleted - A property has been deleted.
      4. properties.synced - Properties have been synced.
    3. Conversation Events
      1. conversation.created - A conversation has been created.
      2. conversation.updated - A conversation has been updated.
      3. conversation.deleted - A conversation has been deleted.
      4. conversations.synced - Conversations have been synced.

Payload Properties​

The payload that Calry sends to your webhook endpoint will contain the following properties:

  1. hook - Object
    • id - string
      • The ID of the webhook that was triggered.
    • timestamp - string
      • The date and time that the webhook was triggered.
    • eventType - string
      • The type of event that triggered the webhook.
    • source - string
      • The source of the webhook that was triggered. [CALRY_WEBHOOK]
  2. data - Object
    • integrationAccountId - string
      • The unique identifier for the Integration Account.
    • workspaceId - string
      • The unique identifier for the Workspace.
    • newRecord - Object (optional)
      • The new record that was created or updated.
    • oldRecord - Object (optional)
      • The old record that was updated or deleted.
    • result - SUCCESS | FAILURE
      • The result of the event that triggered the webhook.

Example Payloads​

{
"data": {
"integrationAccountId": "4a905074-4dd9-426a-b5a9-cf7c9bb33034",
"newRecord": {
"attachments": [],
"body": "<p>Hello there?</p>",
"conversationId": 13880892,
"createdAt": "2024-02-09T06:03:27.000Z",
"id": 115678155,
"images": null,
"propertyId": 212815,
"reservationId": 23783880,
"seenStatus": "seen",
"status": "sent",
"type": "emailFormatted",
"updatedAt": "2024-02-09T06:03:27.000Z"
},
"workspaceId": "6fd2160c-3ea6-42c2-bcdd-2eef89f5ca66"
},
"hook": {
"eventType": "conversation_message.created",
"id": "bdfa02f3-edf0-4c1a-8faa-e2b3428c3d4f",
"timestamp": "2024-02-09T11:33:43.954Z",
"source": "CALRY_WEBHOOK"
}
}
{
"data": {
"integrationAccountId": "4a905074-4dd9-426a-b5a9-cf7c9bb33034",
"result": "SUCCESS",
"workspaceId": "6fd2160c-3ea6-42c2-bcdd-2eef89f5ca66"
},
"hook": {
"eventType": "sync.complete",
"id": "c1348091-bd3e-4598-9e7f-5ea457f02e85",
"timeStamp": "2024-02-09T11:33:41.658Z",
"source": "CALRY_WEBHOOK"
}
}