Setting up Webhooks

What are Webhooks?

Webhooks are user-defined HTTP callbacks that are triggered by specific events in Autohost. When an event occurs, Autohost sends an HTTP POST request to the webhook URL you have configured, containing a payload with details about the event.

This can enhance automation, improve responsiveness, and integrate seamlessly with your existing systems.

Supported Events

Autohost supports a variety of webhook events, including:

  • Verification Status Changes: Triggered when the verification status of a reservation changes.
  • Guest Portal Information Submission: Triggered when a guest completes the Guest Portal.
  • Stargate Message Triggers: Triggered by specific messages sent through Stargate.
  • Reservation Creation or Updates: Triggered when a reservation is created or updated.
  • Listing Creation or Updates: Triggered when a listing is created or updated.
  • User Creation or Updates: Triggered when a user is created or updated.

Setting up Webhooks

Step 1: Create a Webhook

  1. Log in to your Autohost Dashboard.
  2. Navigate to Settings > Advanced > Webhooks.
  3. Enter the Webhook URL: This is the URL where you want to receive the webhook payloads. Enter your URL into each event you would like to subscribe to.
  4. Optionally, set up the HTTP Authorization header: This is useful for securing your webhook endpoint.
  5. Click Save.

Step 2: Configure Your Webhook Endpoint

Your webhook endpoint must be able to handle HTTPS POST requests.

Step 3: Test Your Webhook

  1. Trigger an Event: Perform an action in Autohost that triggers the event you subscribed to (e.g., change the verification status of a reservation).
  2. Check Your Webhook Endpoint: Verify that your webhook endpoint received the HTTP POST request and handled the event correctly.

Webhook Payload Structure

The payload sent to your webhook endpoint contains details about the event. Here is an example payload for a verification status change event:

{
  "id": "XXXX",
  "status": "review",
  "guestportal_completed": true,
  "reason": "User changed verification status",
  "business_rules": [
    "Last minute reservation"
  ],
  "notes": "Approved - ID, name and selfie matches.",
  "supervised": "approve"
}

Visit our developer documentation to see the payload structure for all webhook events.

Securing Your Webhooks

To ensure that the requests to your webhook endpoint are coming from Autohost, you can use the HTTP Authorization header. When setting up the webhook in Autohost, you can specify an authorization token. Your webhook endpoint should then verify this token.

Handling Webhook Retries

Autohost will retry sending the webhook if your endpoint does not respond with a 2xx status code. Ensure your endpoint is idempotent, meaning it can handle receiving the same event multiple times without causing unintended side effects.