honcho/src/webhooks
Vineeth Voruganti e914dbe334
feat: Add get summaries endpoints & Custom Timestamps (#185)
* feat: add support for custom message timestamps in API

- Introduced `created_at` parameter for message creation, allowing users to specify custom timestamps.
- **Single source of truth for timestamp string format**
- Updated SDK documentation to reflect this new feature and its use cases.
- Enhanced validation schemas to include the optional `created_at` field.
- Added tests to verify functionality for messages with and without custom timestamps, ensuring correct behavior and default timestamp usage.

* feat: add timestamp option to sdks

* feat: Add get summaries endpoints

* feat: WIP basic SDK implementation blocked until stainless release

* feat: Implement SDKs with honcho-core methods

* fix (sdk): Used release 1.4.0 core sdks

* fix: Code Rabbit

* chore: Pytest errors

---------

Co-authored-by: Benjamin McCormick <docterformer@protonmail.com>
2025-08-12 17:19:53 -04:00
..
README.md feat: webhooks (#168) 2025-08-06 17:52:35 -04:00
events.py feat: webhooks (#168) 2025-08-06 17:52:35 -04:00
webhook_delivery.py feat: Add get summaries endpoints & Custom Timestamps (#185) 2025-08-12 17:19:53 -04:00

README.md

Webhooks

Webhooks are used to deliver event notifications to user-configured URLs.

System Architecture

The webhooks system consists of several key components:

  • API Endpoints (routers/webhooks.py): Provides endpoints for users to create, list, delete, and test their webhook subscriptions.
  • Event Publishing (webhooks/events.py): Defines the event types and allows us to publish new events to the processing queue.
  • Webhook Delivery (webhooks/webhook_delivery.py): Contains the logic for sending the webhook to the subscriber's URL.

Event Flow

  1. An event is triggered within the application by calling publish_webhook_event with a defined event payload.
  2. This function creates a QueueItem and stores it in the database.
  3. The QueueManager background process polls the database for new items.
  4. When a new event is found, it is passed to the deliver_webhook function.
  5. deliver_webhook fetches all subscriber URLs for the event's workspace, signs the payload with a secret key, and sends an HTTP POST request to each URL.

Note that the webhooks require the deriver process to be running to facilitate the delivery of the webhook.