Create b2xIdentityUserFlow

Namespace: microsoft.graph

Create a new b2xIdentityUserFlow object.

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) IdentityUserFlow.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application IdentityUserFlow.ReadWrite.All Not available.

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. Learn more about authentication and authorization.
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 prepended with B2X_1 after creation.
userFlowType String Required. The type of user flow you're 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 is returned with specific details.

Examples

Example 1: Create a user flow with the default values

Request

The following example shows a request.

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

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

Response

The following example shows 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 example shows a 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 example shows 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 example shows a 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 example shows 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": {}
}