Articles on: Integrations

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 (no "Bearer" prefix or other scheme):


Authorization: <your-api-key>


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.


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.

Updated on: 29/07/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!