# Simple Web Server for Webhooks

## Goal

The goal of this page is to show you how you can do some automation around iMessage using the BlueBubbles Server and the webhook events that it emits.

## Building the HTTP Web Server

Before setting up any webhooks with the BlueBubbles Server, you need to create a web server to receive the webhook requests that the server will be emitting.

There are tools out there built for automation that do this for you such as [n8n](https://n8n.io/). However, if you want full controller over the code, I recommend building a webserver yourself.

Here are some quick implementation code in various languages.

{% embed url="<https://docs.bluebubbles.app/server/developer-guides/simple-web-server-for-webhooks/python-web-server>" %}

## Creating a Webhook

Once you've built your HTTP server, note the port that the server runs on (if running it on localhost).

Open up the BlueBubbles Server and open the `API & Webhooks` page. Then click on the `Manage` drop down, and select `Add Webhook`

![](/files/LqHbOlsV1ypCbEQRllj1)

In the popup, enter your webserver's URL + port (if on localhost). Here is an example where my localhost webserver is listening on port 8000:

![](/files/is4HxxwCIVKf2kW09th7)

Next, select the events you want to subscribe to from the `Event Subscriptions` drop down.

Lastly, hit save. You should see your new entry show up in the table.

<figure><img src="/files/t7ZwFMrymrCkBdY4EFQh" alt=""><figcaption></figcaption></figure>

Assuming your webserver is running, it should now receive HTTP POST requests when the subscribed events are emitted from the server!

{% hint style="info" %}
If you have a cool automation project, please share it with us in our Discord! We love to see all the cool ways people are using BlueBubbles and its' API!
{% endhint %}


---

# 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.bluebubbles.app/server/developer-guides/simple-web-server-for-webhooks.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.
