Skip to content

[BE-58] Implement outbound Webhooks system — register URLs and dispatch events to external systems #931

Description

@yusuftomilola

Overview

External systems (Slack, ERPs, custom dashboards, Zapier) need to receive AssetsUp events in real time. A webhook system lets users register URLs that receive HTTP POST payloads when platform events occur — enabling integrations without polling. Enables FE-26 (Developer portal webhook management UI).

Context

  • Webhooks must be signed with HMAC-SHA256 using a per-webhook secret so receivers can verify authenticity
  • Failed deliveries must be retried with exponential backoff
  • Webhook payloads use the same NotificationEvent enum from BE-56

Acceptance Criteria

  • Create Webhook entity: id, userId, name, url, secret (stored hashed, original shown only once on creation), events (text array of NotificationEvent values to subscribe to), isActive, lastTriggeredAt, failureCount, createdAt
  • POST /webhooks — creates webhook, generates a random secret (shown once in response), stores hash
  • GET /webhooks — list user's webhooks (never return the secret)
  • DELETE /webhooks/:id
  • POST /webhooks/:id/test — sends a test payload ({ event: 'webhook.test', timestamp }) to the registered URL
  • Create WebhookDispatchService.trigger(event, payload) — finds all active webhooks subscribed to this event, POSTs JSON payload with header X-AssetsUp-Signature: sha256=${hmac}, retries on failure up to 3 times
  • Wire WebhookDispatchService into NotificationDispatchService from BE-56

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions