webhooksExplanation

Register webhooks and let Hostfully call you back based on specific triggered events

This API allows Hostfully tech partner to register webhooks and have their system called back when specific events are triggered on Hostfully for specific entities.

For example, a partner may want to be notified every time a new booking happens for a specific property or a specific agency. Partner might also want to be notified when a specific property is being updated.

Agency resources events

The following event types are supported:

  • NEW_INQUIRY
  • NEW_HOLD
  • NEW_BOOKING_REQUEST
  • NEW_BOOKING
  • NEW_BLOCKED_DATES
  • BOOKING_UPDATED
  • BOOKING_CANCELLED
  • NEW_PROPERTY
  • UPDATED_PROPERTY
  • DELETED_PROPERTY
  • PINCODE_CREATED
  • PINCODE_DELETED
  • NEW_INBOX_MESSAGE

Note: for the event BOOKING_UPDATED, this would work to both inquiry and booking.

Access changes events

  • CHANNEL_ACTIVATED
  • CHANNEL_DEACTIVATED
  • INTEGRATION_ACTIVATED
  • INTEGRATION_DEACTIVATED

As a partner you are either a Channel or an Integration - you're only interested in 2 out of 4 of the above events.

Format of the callbacks

When Hostfully detects an event for which a webhook has been registered, our system will perform a callback to your URL and will send data via a HTTP POST . Please make sure the URL you are provid is accessible, returns successful response when called and is accessible using HTTPS protocol. Plain HTTP will be ignored as it's insecure.

Depending on the webhookType you choose, you will either receive a with content-type

  • application/x-www-form-urlencoded; charset=utf-8 for POST_FORM
  • application/json for POST_JSON

Webhooks payload

The following data will be send in the body of the POST call:

  • agency_uid: the uid of the agency associated with the monitored object
  • event_type: the type of event for which this callback is being performed

Optional data:

  • property_uid: if the object monitored is a property, the property UID will be provided
  • lead_uid: if the event type is related to bookings or inquiries, the lead UID will be provided
  • pincode_uid: if the event type is related to pincode the pincode UID will be provided

Sample webhook payloads :

{
  "agency_uid":"1293fab6-71ba-4317-a3c0-be3365180c7b",
  "event_type":"BOOKING_UPDATED",
  "lead_uid":"ce0668b5-7abd-4928-8dba-113d687dac58",
  "property_uid":"906738ca-aacb-4e86-be5f-9e7616507c12"
}
{
  "agency_uid":"641f958b-b40f-4ae7-be79-f3e6ea9960af",
  "message_uid":"7f795941-df3d-4235-8362-0f78309b0ea3",
  "event_type":"NEW_INBOX_MESSAGE",
  "thread_uid":"658128d5-dc29-48b5-b2d6-eb4a34aadebb"
}
{
  "agency_uid":"1293fab6-71ba-4317-a3c0-be3365180c7b",
  "event_type":"INTEGRATION_ACTIVATED"
}
{
  "agency_uid":"1293fab6-71ba-4317-a3c0-be3365180c7b",
  "event_type":"INTEGRATION_ACTIVATED",
  "property_uid":"906738ca-aacb-4e86-be5f-9e7616507c12"
}

Agency resources events:

For booking oriented events:

  • NEW_INQUIRY
  • NEW_HOLD
  • NEW_BOOKING_REQUEST
  • NEW_BOOKING
  • NEW_BLOCKED_DATES
  • BOOKING_UPDATED
  • BOOKING_CANCELLED

register webhook for an agency (objectUid = agencyUid)

For property oriented events:

  • NEW_PROPERTY
  • UPDATED_PROPERTY
  • DELETED_PROPERTY

you may:

  • register webhook for an agency (objectUid = agencyUid)
  • register webhook for a property (objectUid = propertyUid)

For pincode oriented events:

  • PINCODE_CREATED
  • PINCODE_DELETED

register webhook for a property (objectUid = propertyUid)

For new message oriented events:

  • NEW_INBOX_MESSAGE

register webhook for an agency (objectUid = agencyUid)

Agency access events:

For events of type INTEGRATIONACTIVATED, INTEGRATION_DEACTIVATED, CHANNEL_ACTIVATED, CHANNEL_DEACTIVATED, just pass the affiliate ID (your API key) as the value for the _objectUid parameter and skip agencyUid.

Please see examples in the POST request documentation below: