> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.hosthub.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How can I generate and use an API key with Hosthub?

# How can I generate and use an API key with Hosthub?

## Introduction

Hosthub allows users to integrate with external systems using its API. To facilitate this, you need an API key for accessing the API. Here’s a comprehensive guide to help you understand how to generate and use an API key in Hosthub.

The API also provides robust integration capabilities, supporting platforms such as Webflow, allowing seamless data exchange and synchronization.

## Steps to Generate an API Key

Follow these instructions to create your API key for Hosthub:

**Log in to your Hosthub account.** Navigate to the **Settings** section, which can be reached from the icon with your account name in the top right corner of the screen. Open the **API Keys** tab. Click on "Create new API key" to generate a new key, then copy it. If prompted, ensure this feature is enabled for your account.

You can access the API Keys settings directly at https://app.hosthub.com/settings#api-keys.

You do not need to complete any account setup before generating an API key. However, without any data in your Hosthub account, the API will not return any data, so we recommend setting up your account so you can pull real data via the API.

## Troubleshooting API Key Access

If the API Keys section is not visible in your account settings, it means the API key feature has not been activated for your account yet. Contact Hosthub support (or ask for a human agent in the chat) so they can enable it for you.

Additionally, keep your API key private and secure to prevent unauthorized access. Avoid embedding it directly into frontend applications.

## Using the API and Documentation

Once you have your API key, you can use it to integrate with external systems. The Hosthub API allows registered users to exchange data about users, rentals, and bookings. To get started with the API, access the **API documentation** at https://www.hosthub.com/docs/api/ (also available at https://www.hosthub.com/api-documentation), which provides detailed instructions and use cases for integration. You can also download the API YAML file from the documentation front page.

### Custom Website and Channel Manager Integrations

For custom websites and channel managers, you can use the API key to sync data yourself. With a custom API solution, your system handles the syncing, not Hosthub. If you want Hosthub to handle the syncing for a website, we only support the **MotoPress Hotel Booking** plugin (WordPress), which offers a full two-way sync of availability, pricing, and bookings. Other booking engines connect via iCal, which syncs availability only.

### API Base URL and Authentication

The API base URL uses a dated version path. For example, to fetch calendar events for a rental:

```
GET https://app.hosthub.com/api/2019-03-01/rentals/{rentalId}/calendar-events
```

Authentication is done via an `Authorization` header containing your API key directly. Do **not** use a `Bearer` prefix or an `X-API-Key` header — both will fail (`X-API-Key` returns HTTP 403, and `Authorization: Bearer <key>` returns HTTP 401 "API key not valid"). Set the header to your raw API key only:

```
Authorization: <your-api-key>
```

### What the API Can and Cannot Do

The Hosthub API lets you exchange data for users, rentals, and bookings, including retrieving booking data for reporting or pulling booking financial details into your own application. It supports multi-property setups, including Parent-Child relationships where a main property (Parent) is linked with sub-properties (Children).

The API does **not** support push updates via webhooks — there is no webhook notification mechanism, so data must be pulled from the API.

There is no automated built-in export for booking financial data. For manual exports, go to **Bookings → Export → Financial Export XLSX or CSV**. For automated retrieval, use the API.

The **Open API is included in the Hosthub subscription price** and available to all users at no extra cost.

### Working with Rentals and Bookings

To create bookings or retrieve rental data, first use the API to fetch your rentals and obtain their `encodedIds` (Rental IDs). Use these IDs when creating or syncing bookings. The API supports automating booking flows, such as creating a reservation with guest name, email, phone number, check-in/check-out dates, and reservation amount after a guest completes payment on your own website. This is the API equivalent of creating an [offline reservation](https://help.hosthub.com/en/articles/6129649-how-to-create-an-offline-reservation).

## Conclusion

By following these steps, you can generate your API key and explore the opportunities provided by the Hosthub API. Refer to the documentation for details on leveraging the API to its fullest extent. If you encounter any issues, don't hesitate to reach out to Hosthub support.
