Update authenticationEventsFlow

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Update the properties of an authenticationEventsFlow object by ID. You must specify the @odata.type property and the value of the authenticationEventsFlow object type to update. The following derived subtypes are supported:

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) EventListener.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application EventListener.ReadWrite.All Not available.

In delegated scenarios with work or school accounts, the signed-in user must be an owner or member of the group or be assigned a supported Microsoft Entra role or a custom role with a supported role permission. External ID User Flow Administrator is the following least privileged role supported for this operation.

HTTP request

PATCH /identity/authenticationEventsFlows/{authenticationEventsFlow-id}

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply only the values for properties to update. Existing properties that aren't included in the request body maintain their previous values or are recalculated based on changes to other property values.

The following table specifies the properties that can be updated.

You must include the @odata.type property with a value of the specific user flow type in the body. For example, "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignupEventsFlow".

Property Type Description
id String The unique identifier for the entity. Read-only.
displayName String The display name for the events policy.
description String The description of the events policy.
conditions authenticationConditions The conditions representing the context of the authentication request that is used to decide whether the events policy is invoked.
priority Int32 The priority to use for each individual event of the events policy. If multiple competing listeners for an event have the same priority, one is chosen and an error is silently logged.
onInteractiveAuthFlowStart onInteractiveAuthFlowStartHandler The configuration for what to invoke for the onInteractiveAuthFlowStart event.
onAuthenticationMethodLoadStart onAuthenticationMethodLoadStartHandler The configuration for what to invoke for the onAuthenticationMethodLoadStart event. Must have at least one identity provider linked.
onAttributeCollection onAttributeCollectionHandler The configuration for what to invoke for the onAttributeCollection event.

  • You can only update this property if it was configured during user flow creation. If it wasn't, call the Add attributes to a user flow API first.
  • You can't add or remove attributes by updating the attributeCollectionPage > views > inputs and attributes objects. Use the Add attribute to user flow or Remove attribute from user flow APIs instead to update both objects.
  • To update the attributeCollectionPage > views > inputs collection, you must include all objects in the collection, not only the changed objects.
  • The order of objects in the attributeCollectionPage > views > inputs collection corresponds to the order in which the attributes are displayed on the app's sign-up UI.
  • onUserCreateStart onUserCreateStartHandler The configuration for what to invoke for the onUserCreateStart event.

    Response

    If successful, this method returns a 204 No Content response code. If unsuccessful, a 4xx error is returned with specific details.

    Examples

    Example 1: Update the display name and priority of an authenticationEventsFlow

    Request

    The following example shows a request that updates the display name of a specific external identities user flow, as well as the priority for all the listeners associated with the policy.

    PATCH https://graph.microsoft.com/beta/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
    Content-Type: application/json
    
    {
      "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
      "displayName": "New user flow description",
      "priority": 200
    }
    

    Response

    The following example shows the response.

    HTTP/1.1 204 No Content
    

    Example 2: Update the page layout of a self-service sign up user flow

    The following request updates the configuration of some of the attributes. All the attributes are marked as required; the email attribute is marked as hidden; the input type of the custom attribute is also updated to a radio button with two options.

    Request

    PATCH https://graph.microsoft.com/beta/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
    Content-Type: application/json
    
    {
        "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
        "onAttributeCollection": {
            "@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
            "attributeCollectionPage": {
                "customStringsFileId": null,
                "views": [
                    {
                        "title": null,
                        "description": null,
                        "inputs": [
                            {
                                "attribute": "email",
                                "label": "Email Address",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": true,
                                "editable": false,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
                                "options": []
                            },
                            {
                                "attribute": "displayName",
                                "label": "Display Name",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
                                "options": []
                            },
                            {
                                "attribute": "city",
                                "label": "City",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
                                "options": []
                            },
                            {
                                "attribute": "extension_331d514c0c18477583ea7dd5a79feda2_RockorCountry",
                                "label": "Rock music or Country",
                                "inputType": "radioSingleSelect",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^.*",
                                "options": [
                                    {
                                        "label": "Rock music",
                                        "value": "Rock"
                                    },
                                    {
                                        "label": "Country music",
                                        "value": "Country"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    }
    

    Response

    The following example shows the response.

    HTTP/1.1 204 No Content