> For the complete documentation index, see [llms.txt](https://docs.hostelmate.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostelmate.co/finance-management/user-management/api-access.md).

# API Access

{% hint style="info" %}
Hostel Mate is designed to play nicely with your other tools. The API Access page provides developers and tech-savvy managers with everything needed to connect custom software, external booking engines, or data analysis tools directly to your property's database.
{% endhint %}

## 1. API Key Management (Settings)

To authenticate external requests, you need an API key. We keep this simple and highly secure by providing **a single master API key per property**.

| Feature               | Description                                                                                                |
| --------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Generating a Key**  | If the empty state reads "No API Key Generated", click **Generate Key** to create your first active token. |
| **Copying & Viewing** | You can reveal the key with the eye icon, or copy it directly to your clipboard.                           |
| **Key Rotation**      | If you suspect your key has been compromised, you can generate a new one.                                  |

{% hint style="warning" %}
Generating a new key immediately invalidates the old key, so any integrations using the old key will break until updated.
{% endhint %}

## 2. Webhooks

{% hint style="success" %}
Why constantly ask the API if something changed when we can just tell you?
{% endhint %}

The **Webhooks** tab allows you to configure endpoints that will receive real-time `POST` requests whenever a critical event occurs (like a new booking or a payment update).

* **Adding Webhooks:** You can specify an external URL and pick exactly which events should trigger the webhook.
* **Monitoring Deliveries:** Click "View recent deliveries" on any webhook card to see a live log of exactly what we sent, and what HTTP status your server responded with.

## 3. Request Logs

Having integration issues? The **Logs** tab is your debugging command center.

Here you can view a raw feed of every single API request that has hit your property's data. You can filter these logs by:

* **HTTP Method** (`GET`, `POST`, etc.)
* **Status Code** (e.g., filter for `500` Server Errors)
* **Date Range**

Clicking on any log entry expands it to show the full payload, query parameters, and response details.
