Webhooks
LobsterCage provides a gateway proxy that forwards HTTP webhooks to your cage. When your cage is hibernated, requests are buffered and delivered when it wakes.
Webhook URL
Each cage gets a stable webhook URL at creation:
https://gateway.lobstercage.ai/hook/{cageId}/{webhookToken}/{path}This URL is injected into the cage as the LOBSTERCAGE_WEBHOOK_URL environment variable. Register it with any external service that sends webhooks.
Supported platforms
The gateway proxy works with any HTTP webhook sender. It has optimized response handling for:
- Telegram β Bot API webhook updates
- Slack β Event subscriptions and slash commands
- Discord β Interaction endpoints
- Signal β Signal Bot API
- WhatsApp β WhatsApp Business API
How forwarding works
External service sends POST
β
Gateway proxy receives request
β
Cage running?
ββ Yes β Forward to cage immediately
ββ No β Buffer request, return 202, trigger wake
β
Cage wakes β health check β drain buffer in orderWhen the cage is running
Requests are forwarded directly to the cageβs internal IP on port 18789. The response from your application is returned to the caller.
When the cage is hibernated
- The request body is encrypted (AES-256-GCM) and stored in PostgreSQL
- A
202 Acceptedresponse is returned immediately (platform-aware formatting) - An async wake is triggered
- Once the cage passes health checks, buffered requests are drained in order
Buffered requests expire after 5 minutes.
Rate limits
The gateway proxy enforces rate limits to prevent abuse:
| Scope | Limit |
|---|---|
| Per IP | 60 requests/min |
| Per cage | 30 requests/min |
Rate limits are checked before reading the request body to prevent payload-based DoS.
Payload limits
Maximum webhook payload size: 1 MB (1,048,576 bytes).
Setting up a webhook
-
Deploy a cage and note the webhook URL:
lobster deploy my-bot lobster status my-bot # shows webhook URL -
Register the URL with your platform (e.g., Telegram
setWebhook) -
Your application listens on port 18789 inside the cage
See the Telegram bot guide for a complete walkthrough.