Skip to content

Python SDK

The official HookBridge SDK for Python provides a simple way to integrate with HookBridge.

Terminal window
pip install hookbridge
from hookbridge import HookBridge
client = HookBridge(api_key="YOUR_API_KEY")
# Create an endpoint
endpoint = client.create_endpoint(
url="https://your-app.com/webhooks",
description="My webhook endpoint"
)
# Send a webhook
result = client.send(
endpoint_id=endpoint.id,
payload={
"event": "user.created",
"data": {"user_id": "123", "email": "user@example.com"}
}
)
print(f"Message sent: {result.message_id}")

The SDK also provides async methods:

import asyncio
from hookbridge import AsyncHookBridge
async def main():
async with AsyncHookBridge(api_key="YOUR_API_KEY") as client:
result = await client.send(
endpoint_id="ep_abc123",
payload={"event": "test"}
)
print(f"Message sent: {result.message_id}")
asyncio.run(main())
Personalize Examples

Enter your credentials to populate code examples throughout the docs.