Events

1. Events

These are the events that FusionAuth generates that can be optionally consumed by your registered Webhook.

2. User Actions

This event is generated when a User Action is taken on a user and when temporal actions transition between phases.

Table 1. Event Body

event.action [String]

This parameter specifies the name of the action that is occurring.

event.actionId [UUID]

This parameter specifies the unique Id of the action that is occurring.

event.actioneeUserId [UUID]

This parameter specifies the unique identifier of the user the action is being performed on.

event.actionerUserId [UUID]

This parameter specifies the Id of the User that performed the action that resulted in the notification being sent. If the action was initiated by FusionAuth this value will not be provided.

event.applicationIds [Array<UUID>]

This parameter if provided specifies the scope of the User Action. When an Action is scoped to one or more Applications the Application Ids will be provided in this parameter.

event.comment [String]

An optional comment left to possibly indicate why the action was taken, modified or canceled.

event.createInstant [Long]

The instant that the event was generated.

event.email [Object]

Email object. See Example POST body below for fields.

event.expiry [Long]

The instant that the action will expire, if the action expires.

event.id [UUID]

The event unique Id. You may receive an event more than once based upon your transaction settings. This Id may be used to identity a duplicate event.

event.localizedAction [String]

This parameter specifies the localized name of the action that’s occurring, based on the user’s preferred languages.

event.localizedDuration [String]

The duration of the action in a human readable format that is localized based on the user’s preferred languages.

event.localizedOption [String]

This parameter specifies the localized option of the action that’s occurring, based on the user’s preferred languages.

event.localizedReason [String]

This parameter specifies the localized reason of the action that’s occurring, based on the user’s preferred languages.

event.notifyUser [Boolean]

This parameter specifies whether the user should be notified or not.

event.option [String]

An optional value to provide additional context to the Action. This value is free form and defined by the User Action.

event.emailedUser [Boolean]

This parameter specifies whether the FusionAuth has attempted to send an email to notify the User of the event.

event.phase [Boolean]

If the Action is temporal, this parameter will be provided to indicate the current phase of the action. The following are the possible Action states:

  • start - The event has started.

  • modify - The event has been modified.

  • cancel - The event has been canceled, the end phase will not be reached.

  • end - The event has ended.

When the action is started by an admin, the phase will be "start". If an admin changes the duration of the action, the phase will be "modify". If an admin cancels an action it will be "cancel" or the action expires, the phase will be "end". If the action is key-based, the phase will be "start".

event.reason [String]

The reason the admin selected. Reasons are configured in the Web Interface via System → User Action Reasons. This value will be null when no reasons are selected (or configured).

event.reasonCode [String]

The reason code the admin selected. Reasons are configured in the Web Interface via System → User Action Reasons. This value will be null when no reasons are selected (or configured).

event.type [String]

This parameter specifies the type of notification and will always be userAction for this type of notification.

Example Event JSON
{
  "event": {
    "type": "userAction",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "applicationIds": [
      "2a6972a9-d332-458f-9c11-aa0eb74cfefc",
      "a1d7c8d2-be38-4530-8c61-b32245f94f0c",
      "def77957-1818-4fd5-b052-004777acb6fa",
      "96ebce2f-f9c0-44f6-a92f-6f476e08b678",
      "563215b9-b819-4ec5-b983-88174f26e390"
    ],
    "actioneeId": "32ac49fe-1f7f-40b6-a3a1-02611a10945a",
    "actionerId": "1219c8e2-c0c2-4efc-9323-6ee9062e9c1f",
    "action": "Mute",
    "comment": "a comment",
    "expiry": 1408554564119,
    "localizedAction": "Mute",
    "localizedDuration": "2 days",
    "localizedOption": null,
    "localizedReason": "Misconduct",
    "notifyUser": true,
    "option": null,
    "phase": "start",
    "reason": "Misconduct",
    "reasonCode": "123",
    "email": {
      "attachments": [],
      "bcc": [],
      "cc": [],
      "from": {
        "address": "no-reply@yourorganization.com",
        "display": "no-reply@yourorganization.com"
      },
      "html": "no-reply@yourorganization.com",
      "replyTo": null,
      "subject": "You've received a Misconduct action",
      "text": ".... insert text here ....",
      "to": [
        {
          "address": "Allan249@example.com",
          "display": null
        }
      ]
    }
  }
}

3. User Bulk Create

This event is generated when multiple users are created. The JSON includes each of the Users that were created. The array of User objects inside the JSON are the same as the response from the Search for Users API.

3.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.bulk.create",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "users": [
      {
        "active": true,
        "birthDate": "1976-05-30",
        "data": {
          "displayName": "Johnny Boy",
          "favoriteColors": [
            "Red",
            "Blue"
          ]
        },
        "email": "example@fusionauth.io",
        "expiry": 1571786483322,
        "firstName": "John",
        "fullName": "John Doe",
        "id": "00000000-0000-0001-0000-000000000000",
        "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
        "lastLoginInstant": 1471786483322,
        "lastName": "Doe",
        "middleName": "William",
        "mobilePhone": "303-555-1234",
        "passwordChangeRequired": false,
        "passwordLastUpdateInstant": 1471786483322,
        "preferredLanguages": [
          "en",
          "fr"
        ],
        "registrations": [
          {
            "applicationId": "10000000-0000-0002-0000-000000000001",
            "data": {
              "displayName": "Johnny",
              "favoriteSports": [
                "Football",
                "Basketball"
              ]
            },
            "id": "00000000-0000-0002-0000-000000000000",
            "insertInstant": 1446064706250,
            "lastLoginInstant": 1456064601291,
            "preferredLanguages": [
              "en",
              "fr"
            ],
            "roles": [
              "user",
              "community_helper"
            ],
            "username": "johnny123",
            "usernameStatus": "ACTIVE"
          }
        ],
        "timezone": "America/Denver",
        "twoFactorEnabled": false,
        "usernameStatus": "ACTIVE",
        "username": "johnny123",
        "verified": true
      }
    ]
  }
}

4. User Create

This event is generated when a single user is created. The JSON includes the User that was created. The User object inside the JSON is the same as the response from the Retrieve a User API.

4.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.create",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "user": {
      "active": true,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy",
        "favoriteColors": [
          "Red",
          "Blue"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-1234",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en",
        "fr"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny",
            "favoriteSports": [
              "Football",
              "Basketball"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en",
            "fr"
          ],
          "roles": [
            "user",
            "community_helper"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    }
  }
}

5. User Deactivate

This event is generated when a user is deactivated. The JSON includes the User that was deactivated. The User object inside the JSON is the same as the response from the Retrieve a User API.

5.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.deactivate",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "user": {
      "active": false,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy",
        "favoriteColors": [
          "Red",
          "Blue"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-1234",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en",
        "fr"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny",
            "favoriteSports": [
              "Football",
              "Basketball"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en",
            "fr"
          ],
          "roles": [
            "user",
            "community_helper"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    }
  }
}

6. User Delete

This event is generated when a user id deleted. The JSON includes the User that was deleted. The User object inside the JSON is the same as the response from the Retrieve a User API.

6.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.delete",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "user": {
      "active": true,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy",
        "favoriteColors": [
          "Red",
          "Blue"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-1234",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en",
        "fr"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny",
            "favoriteSports": [
              "Football",
              "Basketball"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en",
            "fr"
          ],
          "roles": [
            "user",
            "community_helper"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    }
  }
}

7. User Reactivate

This event is generated when user is reactivated. The JSON includes the User that was reactivated. The User object inside the JSON is the same as the response from the Retrieve a User API.

7.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.reactivate",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "user": {
      "active": true,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy",
        "favoriteColors": [
          "Red",
          "Blue"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-1234",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en",
        "fr"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny",
            "favoriteSports": [
              "Football",
              "Basketball"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en",
            "fr"
          ],
          "roles": [
            "user",
            "community_helper"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    }
  }
}

8. User Update

This event is generated when a user is updated. The JSON includes the User that was updated including the original data for the User and the new data for the User. The User objects (original and user) inside the JSON is the same as the response from the Retrieve a User API.

8.1. Event JSON

Example Event JSON
{
  "event": {
    "type": "user.update",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "original": {
      "active": true,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy Original",
        "favoriteColors": [
          "Green"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-4321",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny Boy Original",
            "favoriteSports": [
              "Football"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en"
          ],
          "roles": [
            "user"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    },
    "user": {
      "active": true,
      "birthDate": "1976-05-30",
      "data": {
        "displayName": "Johnny Boy",
        "favoriteColors": [
          "Red",
          "Blue"
        ]
      },
      "email": "example@fusionauth.io",
      "expiry": 1571786483322,
      "firstName": "John",
      "fullName": "John Doe",
      "id": "00000000-0000-0001-0000-000000000000",
      "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png",
      "lastLoginInstant": 1471786483322,
      "lastName": "Doe",
      "middleName": "William",
      "mobilePhone": "303-555-1234",
      "passwordChangeRequired": false,
      "passwordLastUpdateInstant": 1471786483322,
      "preferredLanguages": [
        "en",
        "fr"
      ],
      "registrations": [
        {
          "applicationId": "10000000-0000-0002-0000-000000000001",
          "data": {
            "displayName": "Johnny",
            "favoriteSports": [
              "Football",
              "Basketball"
            ]
          },
          "id": "00000000-0000-0002-0000-000000000000",
          "insertInstant": 1446064706250,
          "lastLoginInstant": 1456064601291,
          "preferredLanguages": [
            "en",
            "fr"
          ],
          "roles": [
            "user",
            "community_helper"
          ],
          "username": "johnny123",
          "usernameStatus": "ACTIVE"
        }
      ],
      "timezone": "America/Denver",
      "twoFactorEnabled": false,
      "usernameStatus": "ACTIVE",
      "username": "johnny123",
      "verified": true
    }
  }
}

9. JWT Public Key Update

This event is generated when a single token, all of a User’s tokens, or all tokens for an entire Application revoked. The JSON includes either the User id or the Application id depending on what was revoked. It will also include the time to live duration (in seconds) for each Application. This value is used to determine if JWTs are valid or not based on their expiration instants.

9.1. Event JSON (for a User)

Example Event JSON
{
  "event": {
    "type": "jwt.refresh-token.revoke",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "applicationTimeToLiveInSeconds": {
      "21a8893c-51b3-4964-8a50-6afb66ee8acd" : 600
    },
    "userId": "dfdbae16-4e65-42c2-9773-23dfd6f5671d"
  }
}

9.2. Event JSON (for an entire Application)

Example Event JSON
{
  "event": {
    "type": "jwt.refresh-token.revoke",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "applicationId": "21a8893c-51b3-4964-8a50-6afb66ee8acd",
    "applicationTimeToLiveInSeconds": {
      "21a8893c-51b3-4964-8a50-6afb66ee8acd" : 600
    }
  }
}

10. JWT Refresh Token Revoke

This event is generated when a refresh token is revoked. The JSON includes either the User Id or the Application Id depending on what was revoked. It will also include the time to live duration (in seconds) for each Application. This value is used to determine if JWTs are valid or not based on their expiration instants.

The following scenarios will cause this event to be generated:

  • A single Refresh Token is revoked

  • All Refresh Tokens owned by a single User are revoked

  • All Refresh Tokens for a FusionAuth Application are revoked

10.1. Event JSON (for a User)

Example Event JSON
{
  "event": {
    "type": "jwt.refresh-token.revoke",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "applicationTimeToLiveInSeconds": {
      "21a8893c-51b3-4964-8a50-6afb66ee8acd" : 600
    },
    "userId": "dfdbae16-4e65-42c2-9773-23dfd6f5671d"
  }
}

10.2. Event JSON (for an entire Application)

Example Event JSON
{
  "event": {
    "type": "jwt.refresh-token.revoke",
    "createInstant" : 1505762615056,
    "id" : "e502168a-b469-45d9-a079-fd45f83e0406",
    "applicationId": "21a8893c-51b3-4964-8a50-6afb66ee8acd",
    "applicationTimeToLiveInSeconds": {
      "21a8893c-51b3-4964-8a50-6afb66ee8acd" : 600
    }
  }
}