-
Notifications
You must be signed in to change notification settings - Fork 22
Document the webhook management API #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
qayshp
wants to merge
3
commits into
BlueBubblesApp:master
Choose a base branch
from
qayshp:agent/document-webhook-api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| --- | ||
| description: Create, list, and delete BlueBubbles webhooks through the REST API | ||
| --- | ||
|
|
||
| # Webhook Management API | ||
|
|
||
| The webhook management endpoints let you configure a server without using the BlueBubbles desktop interface. They are useful for automated and declarative installations. | ||
|
|
||
| All examples below use these shell variables: | ||
|
|
||
| ```bash | ||
| export BLUEBUBBLES_URL="https://your-server.example.com" | ||
| read -s BLUEBUBBLES_PASSWORD | ||
| export BLUEBUBBLES_PASSWORD | ||
| ``` | ||
|
|
||
| Enter the BlueBubbles server password when prompted by `read`. | ||
|
|
||
| {% hint style="warning" %} | ||
| Webhook management requests authenticate through a query parameter. Use HTTPS, avoid placing the password directly in scripts or shell history, and take care not to copy authenticated request URLs into logs. | ||
| {% endhint %} | ||
|
|
||
| The examples use `password`, but the `guid` and `token` query parameter aliases also work. Every endpoint is under `/api/v1/webhook`. | ||
|
|
||
| ## List webhooks | ||
|
|
||
| Use `GET /api/v1/webhook` to retrieve all configured webhooks: | ||
|
|
||
| ```bash | ||
| curl --silent --show-error \ | ||
| --url-query "password=$BLUEBUBBLES_PASSWORD" \ | ||
| "$BLUEBUBBLES_URL/api/v1/webhook" | ||
| ``` | ||
|
|
||
| A successful response contains an array of webhook records: | ||
|
|
||
| ```json | ||
| { | ||
| "status": 200, | ||
| "message": "Successfully fetched webhooks!", | ||
| "data": [ | ||
| { | ||
| "id": 1, | ||
| "url": "https://automation.example.com/bluebubbles", | ||
| "events": [ | ||
| "new-message", | ||
| "updated-message" | ||
| ], | ||
| "created": "2026-01-01T00:00:00.000Z" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| To retrieve one webhook, include its numeric `id`: | ||
|
|
||
| ```bash | ||
| curl --silent --show-error \ | ||
| --url-query "password=$BLUEBUBBLES_PASSWORD" \ | ||
| --url-query "id=1" \ | ||
| "$BLUEBUBBLES_URL/api/v1/webhook" | ||
| ``` | ||
|
|
||
| ## Create a webhook | ||
|
|
||
| Use `POST /api/v1/webhook` with a JSON body containing: | ||
|
|
||
| * `url`: The HTTP or HTTPS endpoint that will receive webhook requests. HTTPS is strongly recommended. | ||
| * `events`: An array of webhook event keys. See [REST API & Webhooks](rest-api-and-webhooks.md#webhooks) for the supported events. Use `*` to subscribe to every event. | ||
|
|
||
| ```bash | ||
| curl --silent --show-error \ | ||
| --request POST \ | ||
| --url-query "password=$BLUEBUBBLES_PASSWORD" \ | ||
| --header "Content-Type: application/json" \ | ||
| --data '{ | ||
| "url": "https://automation.example.com/bluebubbles", | ||
| "events": ["new-message", "updated-message"] | ||
| }' \ | ||
| "$BLUEBUBBLES_URL/api/v1/webhook" | ||
| ``` | ||
|
|
||
| The response includes the webhook's generated `id`: | ||
|
|
||
| ```json | ||
| { | ||
| "status": 200, | ||
| "message": "Successfully created webhook!", | ||
| "data": { | ||
| "id": 1, | ||
| "url": "https://automation.example.com/bluebubbles", | ||
| "events": [ | ||
| "new-message", | ||
| "updated-message" | ||
| ], | ||
| "created": "2026-01-01T00:00:00.000Z" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Webhook URLs are unique. Posting a URL that is already registered returns the existing webhook without changing its event subscriptions. To replace its subscriptions through the REST API, delete the existing webhook and then create it again. | ||
|
|
||
| ## Delete a webhook | ||
|
|
||
| Use `DELETE /api/v1/webhook/:id`, replacing `:id` with the numeric webhook ID: | ||
|
|
||
| ```bash | ||
| curl --silent --show-error \ | ||
| --request DELETE \ | ||
| --url-query "password=$BLUEBUBBLES_PASSWORD" \ | ||
| "$BLUEBUBBLES_URL/api/v1/webhook/1" | ||
| ``` | ||
|
|
||
| A successful deletion returns: | ||
|
|
||
| ```json | ||
| { | ||
| "status": 200, | ||
| "message": "Successfully deleted webhook!" | ||
| } | ||
| ``` | ||
|
|
||
| Deleting an ID that does not exist returns `404`. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| * `400 Bad Request`: Check that `url` starts with `http` and every item in `events` is a supported string event key. | ||
| * `401 Unauthorized`: Check that an authentication query parameter is present and matches the server password. | ||
| * `404 Not Found`: The webhook ID in a delete request does not exist. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.