You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/docs/v1/tech/events-webhooks/writing-a-webhook.adoc
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ Additional headers may be added to the request by adding headers to the Webhook
18
18
* <<Configuration>>
19
19
** <<Application Scoped Events>>
20
20
** <<Tenant Scoped Events>>
21
-
** <<Example Configuration>>
21
+
** <<Example Configuration Before 1.37.0>>
22
+
** <<Example Configuration After 1.37.0>>
22
23
* <<Retries>>
23
24
** <<Retry Examples>>
24
25
* <<Calling FusionAuth APIs In Webhooks>>
@@ -36,7 +37,9 @@ Then, configure the Tenant to listen for the event by navigating to [breadcrumb]
36
37
37
38
If you have multiple Webhooks configured for a single Tenant, the transaction setting for the event will dictate if FusionAuth will commit the transaction or not.
38
39
39
-
If you have multiple tenants listening for the same event, they will all receive that event and can filter on the provided [field]#tenantId# to determine if they should handle the event.
40
+
As of version 1.37.0 if you have multiple tenants listening for the same event, they will only receive the events for that tenant, but not for other tenants.
41
+
42
+
Prior to version 1.37.0 if you have multiple tenants listening for the same event, they will all receive that event and can filter on the provided [field]#tenantId# to determine if they should handle the event.
40
43
41
44
=== Application Scoped Events
42
45
@@ -52,7 +55,7 @@ As of version 1.37.0, all events can be tenant scoped except instance events:
52
55
53
56
If you want to get events for certain applications, the preferred method is to send events for a tenant. Filter on the `applicationId` when consuming the event and discard events from any applications not of interest.
54
57
55
-
=== Example Configuration
58
+
=== Example Configuration Before 1.37.0
56
59
57
60
Here's an example scenario. You have two tenants, Pied Piper and Hooli. You have configured two webhooks listening for `user.create` events. One updates a separate user database, the other records information in an analytics system. Both the Pied Piper and Hooli tenants have the `user.create` event enabled in their webhook configurations.
58
61
@@ -64,6 +67,16 @@ If you are separating your staging and production environments using tenants, we
64
67
65
68
Please review this issue for additional information about https://github.com/FusionAuth/fusionauth-issues/issues/1543[future webhook improvements].
66
69
70
+
=== Example Configuration After 1.37.0
71
+
72
+
Here's an example scenario. You have two tenants, Pied Piper and Hooli. You have configured two webhooks listening for `user.create` events. One updates a separate user database, the other records information in an analytics system. Both the Pied Piper and Hooli tenants have the `user.create` event enabled in their webhook configurations and both webhooks are selected to receive events from both tenants.
73
+
74
+
In this scenario, each webhook will receive data when a user is created in either tenant, Pied Piper or Hooli.
75
+
76
+
Transaction settings can be managed at the tenant level. It is possible, for example, to require only the analytics webhook to succeed for the Pied Piper tenant and only the user database sync to succeed for the Hooli tenant.
77
+
78
+
If you are separating your staging and production environments using tenants, webhooks will not cross those boundaries except for the instance scoped events.
79
+
67
80
== Retries
68
81
69
82
If the webhook transaction succeeds, FusionAuth will try to send the payload to any failed webhooks again. For example, if there are three webhooks set up to listen to a `user.update` request, and the transaction level is set to "Any single webhook must succeed" and one webhook succeeds, the two failures will be retried. FusionAuth will retry sending the payload up to three additional times. This retry logic means that webhook endpoints may receive a payload multiple times and should be prepared to handle such a situation.
0 commit comments