Create b2cIdentityUserFlow

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.

Create a new b2cIdentityUserFlow object.

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

The work or school account needs to belong to one of the following roles:

  • Global administrator
  • External Identity User Flow administrator

HTTP request

POST /identity/b2cUserFlows

Request headers

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

Request body

In the request body, provide a JSON representation of a b2cIdentityUserFlow.

Property Type Description
id String Required. The name of the user flow. The name will be pre-pended with B2C_1_ after creation if the prefix was not added to the name during your request.
userFlowType String Required. The type of user flow you are creating. The supported values for userFlowType are:
  • signUp
  • signIn
  • signUpOrSignIn
  • passwordReset
  • profileUpdate
  • resourceOwner
userFlowTypeVersion Float Required. The version of the user flow.
isLanguageCustomizationEnabled Boolean Optional. Determines whether language customization is enabled within the Azure AD B2C user flow. Language customization is not enabled by default for Azure AD B2C user flows.
defaultLanguageTag String Optional. Specifies the default language of the b2cIdentityUserFlow that is used when no ui_locale tag is specified in the request. This field is RFC 5646 compliant.
identityProviders identityProvider collection Optional. The identity providers you want to include in the user flow.

Response

If successful, this method returns a 201 Created response code and a Location header with a URI to the b2cIdentityUserFlow object created for this request, with the B2C_1_ prefix added to the name. If unsuccessful, a 4xx error will be returned with specific details.

Examples

Example 1: Create a user flow with the default values

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/identity/b2cUserFlows
Content-type: application/json

{
    "id": "Customer",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 3
}

Response

The following is an example of the response.

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

HTTP/1.1 201 Created
Location: https://graph.microsoft.com/beta/identity/b2cUserFlows('B2C_1_Customer')
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/b2cUserFlows/$entity",
    "id": "B2C_1_Customer",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 3,
    "isLanguageCustomizationEnabled": false,
    "defaultLanguageTag": "en",
    "authenticationMethods": "emailWithPassword",
    "tokenClaimsConfiguration": {
        "isIssuerEntityUserFlow": false
    },
    "apiConnectorConfiguration": {}
}

Example 2: Create a user flow with the default values and an identity provider

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/identity/b2cUserFlows
Location: https://graph.microsoft.com/beta/identity/b2cUserFlows('B2C_1_Customer')
Content-type: application/json

{
    "id": "Customer",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 3,
    "identityProviders": [
        {
            "id": "Facebook-OAuth"
        }
    ]
}

Response

The following is an example of the response.

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

HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/b2cUserFlows/$entity",
    "id": "B2C_1_Customer",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 3,
    "isLanguageCustomizationEnabled": false,
    "defaultLanguageTag": "en",
    "authenticationMethods": "0",
    "tokenClaimsConfiguration": {
        "isIssuerEntityUserFlow": false
    },
    "apiConnectorConfiguration": {}
}

Example 3: Create a user flow with the default values and configuration for API connectors

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/identity/b2cUserFlows
Content-type: application/json

{
    "id": "UserFlowWithAPIConnector",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1,
    "apiConnectorConfiguration":{
        "postFederationSignup":{
            "@odata.id": "{apiConnectorId}"
        },
        "postAttributeCollection":{
            "@odata.id": "{apiConnectorId}"
        }
    }
}

Response

The following is an example of the response.

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

Note: The apiConnectorConfiguration property always returns a '{}' value. To see full value with the navigation properties, use this API.

HTTP/1.1 201 Created
Location: https://graph.microsoft.com/beta/identity/b2cUserFlows/B2C_1_Partner
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#identity/b2cUserFlows/$entity",
    "id": "B2C_1_UserFlowWithAPIConnector",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1,
    "apiConnectorConfiguration": {}
}