# API Documentation

Everything you need to connect external systems to Hostel Mate—create bookings, sync guests, fetch availability, and more.

## Quick Start

1. Generate an API key: [API Access](/finance-management/user-management/api-access.md)
2. Add the key to your request headers: [Authentication](/api-documentation/authentication.md)
3. Call your first endpoint — for example [Bookings Create](/api-documentation/bookings/create.md)

## Core Guides

* Authentication: required headers and rate limits — [read more](/api-documentation/authentication.md)
* Booking Engine API: surface availability on your website — [read more](/api-documentation/booking-engine.md)
* Booking operations: [Bookings List](/api-documentation/bookings/list.md), [Booking Detail](/api-documentation/bookings/get.md), [Bookings Create](/api-documentation/bookings/create.md), [Bookings Update](/api-documentation/bookings/update.md), [Booking Logs](/api-documentation/bookings/logs.md), and [Booking Delete](/api-documentation/bookings/delete.md)
* Payments endpoint: [Payments](/api-documentation/payments.md)
* Guests endpoints: [Guests GET](/api-documentation/guests/get.md) and [Guests Update](/api-documentation/guests/update.md)
* Webhooks: real-time event notifications — [read more](/api-documentation/webhooks.md)

## Best Practices

* Store API keys server-side only; rotate them after staff changes
* **Always include `Idempotency-Key`** on `POST` and `PATCH` requests — it is required, not optional; missing it returns `400`
* Respect the 120 req/min limit and add exponential backoff on 429 errors
* Log request IDs from responses to speed up support investigations

## Need Help?

Send request IDs, timestamps, and payload summaries to <contact@hostelmate.co> when opening a support ticket so we can assist quickly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hostelmate.co/api-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
