Create userAttributeAssignments

Namespace: microsoft.graph

Create a new identityUserFlowAttributeAssignment object in a b2xIdentityUserFlow.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) IdentityUserFlow.ReadWrite.All
Delegated (personal Microsoft account) Not supported
Application IdentityUserFlow.ReadWrite.All

HTTP request

POST /identity/b2xUserFlows/{id}/userAttributeAssignments

Request headers

Name Description
Authorization Bearer {token}. Required.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the identityUserFlowAttributeAssignment object.

The following table shows the properties that are required when you create the identityUserFlowAttributeAssignment.

Property Type Description
displayName String The display name of the identityUserFlowAttribute within a user flow.
isOptional Boolean Determines whether the identityUserFlowAttribute is optional. true means the user doesn't have to provide a value. false means the user cannot complete sign-up without providing a value.
requiresVerification Boolean Determines whether the identityUserFlowAttribute requires verification. This is only used for verifying the user's phone number or email address.
userAttributeValues userAttributeValuesItem collection The input options for the user flow attribute. Only applicable when the userInputType is radioSingleSelect, dropdownSingleSelect, or checkboxMultiSelect.
userInputType identityUserFlowAttributeInputType The input type of the user flow attribute. Possible values are: textBox, dateTimeDropdown, radioSingleSelect, dropdownSingleSelect, emailBox, checkboxMultiSelect.
userAttribute identityUserFlowAttribute The identifier for the user flow attribute to include in the user flow assignment.

Response

If successful, this method returns a 201 Created response code and an identityUserFlowAttributeAssignment object in the response body.

Examples

Request

POST https://graph.microsoft.com/v1.0/identity/b2xUserFlows/B2X_1_Partner/userAttributeAssignments
Content-Type: application/json

{
    "isOptional": false,
    "requiresVerification": false,
    "userInputType": "TextBox",
    "displayName": "Shoe size",
    "userAttributeValues": [],
    "userAttribute": {
        "id": "extension_guid_shoeSize"
    }
}

Response

Note: The response object shown here might be shortened for readability.

HTTP/1.1 201 Created
Location: https://graph.microsoft.com/v1.0/identity/b2xUserFlows/B2X_1_Partner/userAttributeAssignments/extension_guid_shoeSize
Content-Type: application/json

{
    "id": "extension_guid_shoeSize",
    "isOptional": false,
    "requiresVerification": false,
    "userInputType": "TextBox",
    "displayName": "Shoe size",
    "userAttributeValues": []
}