Create b2xIdentityUserFlow

Namespace: microsoft.graph

Create a new b2xIdentityUserFlow 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/b2xUserFlows

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 b2xIdentityUserFlow.

Property Type Description
id String Required. The name of the user flow. The name will be pre-pended with B2X_1 after creation.
userFlowType String Required. The type of user flow you are creating. This value will always be signUpOrSignIn.
userFlowTypeVersion Float Required. The version of the user flow. This value will always be 1.
apiConnectorConfiguration userFlowApiConnectorConfiguration Optional. Configuration for enabling an API connector for use as part of the user flow.

Response

If successful, this method returns a 201 Created response code and a Location header with a URI to the b2xIdentityUserFlow object created for this request, with the B2X_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/v1.0/identity/b2xUserFlows
Content-type: application/json

{
    "id": "Partner",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1
}

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/v1.0/identity/b2xUserFlows/B2X_1_Partner
Content-type: application/json

{
    "id": "B2X_1_Partner",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1
}

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/v1.0/identity/b2xUserFlows
Content-type: application/json

{
    "id": "Partner",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1,
    "identityProviders": [
        {
            "id": "Facebook-OAuth",
            "type": "Facebook",
            "name": "Facebook"
        }
    ]
}

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/v1.0/identity/b2xUserFlows/B2X_1_Partner
Content-type: application/json

{
    "id": "B2X_1_Partner",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1
}

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/v1.0/identity/b2xUserFlows
Content-type: application/json

{
    "id": "UserFlowWithAPIConnector",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1,
    "apiConnectorConfiguration":{
        "postFederationSignup":{
            "@odata.id": "https://graph.microsoft.com/v1/identity/apiConnectors/{id}"
        },
        "postAttributeCollection":{
            "@odata.id": "https://graph.microsoft.com/v1/identity/apiConnectors/{id}"
        }
    }
}

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/v1.0/identity/b2xUserFlows/B2X_1_Partner
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identity/b2xUserFlows/$entity",
    "id": "B2X_1_UserFlowWithAPIConnector",
    "userFlowType": "signUpOrSignIn",
    "userFlowTypeVersion": 1,
    "apiConnectorConfiguration": {}
}