> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-quickstart-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how you can implement flexible connection switching with Universal Login

# Configure Flexible Connection Switching

Flexible connection switching is an optional feature that allows users to choose their method of authentication when logging in to an application. When implemented, your application's login screen presents users with the option to authenticate with either traditional database credentials or a <Tooltip tip="" cta="View Glossary" href="/docs/glossary?term=passwordless">passwordless</Tooltip> connection. Users who select a [passwordless connection](/docs/authenticate/passwordless) receive a one-time password (OTP) through email or SMS that they can use to log in to your application.

Flexible connection switching uses [custom Universal Login prompts](/docs/customize/login-pages/universal-login/customize-signup-and-login-prompts) to provide users with a more autonomous authentication experience.

## Before you begin

Before you can implement flexible connection switching, ensure the following requirements are met:

* Use [Universal Login](/docs/authenticate/login/auth0-universal-login).

  * This feature is not available for custom login pages.
* Configure a [custom domain](/docs/customize/custom-domains).
* Enable the following for your application:

  * [Identifier First authentication](/docs/authenticate/login/auth0-universal-login/identifier-first)
  * [Database connection](/docs/authenticate/database-connections)
  * [Email or SMS passwordless authentication](/docs/authenticate/login/auth0-universal-login/passwordless-login/email-or-sms)

## Implement flexible connection switching

To implement this feature, use the [Auth0 Management API](https://auth0.com/docs/api/management/v2) to configure custom signup and login prompt partials. Partials refer to custom code inserted into an entry point within a prompt screen, such as the login screen. To learn more, review [Customize Signup and Login Prompts](/docs/customize/login-pages/universal-login/customize-signup-and-login-prompts).

To implement flexible connection switching, you will configure custom prompt partials with the following parameters:

<table class="table">
  <thead>
    <tr>
      <th><strong>Parameter</strong></th>
      <th><strong>Description</strong></th>
      <th><strong>Example</strong></th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>state</code></td>
      <td>Renders the current page's state value, which is opaque and used for security purposes.<br /><br />To learn more about current screen information, review <a href="/docs/customize/login-pages/universal-login/customize-templates#current-screen-information">Customize Univeral Login Page Templates</a>.</td>
      <td><code>\<input type='hidden' name='state' value='{{state}}'></code></td>
    </tr>

    <tr>
      <td><code>connection</code></td>
      <td>Name and type of the connection.<br /><br />For passwordless connections, value is either <code>email</code> or <code>sms</code>.</td>
      <td><code>\<input type='hidden' name='connection' value='email'></code></td>
    </tr>
  </tbody>
</table>

<Warning>
  In the code samples below, ensure you replace the placeholders with the appropriate values:

  * Replace `{yourDomain}` with `yourdomain.auth0.com`.
  * Replace `{mgmtApiToken}` with your access token.
</Warning>

### Configure signup prompt

You can configure the `signup-password` prompt using the [Set partials for a prompt](https://auth0.com/docs/api/management/v2/prompts/put-partials) endpoint:

<CodeGroup>
  ```bash cURL lines
  curl --request PUT \
    --url 'https://{yourDomain}/api/v2/prompts/signup-password/partials' \
    --header 'authorization: Bearer {mgmtApiToken}' \
    --header 'content-type: application/json' \
    --data '{"signup-password":{"form-footer-start":"   Send a secure code by email "}}'
  ```

  ```csharp C# lines
  var client = new RestClient("https://{yourDomain}/api/v2/prompts/signup-password/partials");
  var request = new RestRequest(Method.PUT);
  request.AddHeader("authorization", "Bearer {mgmtApiToken}");
  request.AddHeader("content-type", "application/json");
  request.AddParameter("application/json", "{\"signup-password\":{\"form-footer-start\":\"   Send a secure code by email \"}}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go lines expandable
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/prompts/signup-password/partials"

  	payload := strings.NewReader("{\"signup-password\":{\"form-footer-start\":\"<form method=\\\"post\\\" data-form-secondary=\\\"true\\\"><input type=\\\"hidden\\\" name=\\\"state\\\" value=\\\"{{state}}\\\"> <input type=\\\"hidden\\\" name=\\\"connection\\\" value=\\\"email\\\"> <button type=\\\"submit\\\" id=\\\"switchConnectionButton\\\" style=\\\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\\\" data-action-button-secondary=\\\"true\\\"> <span>Send a secure code by email</span> </button></form>\"}}")

  	req, _ := http.NewRequest("PUT", url, payload)

  	req.Header.Add("authorization", "Bearer {mgmtApiToken}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java lines
  HttpResponse response = Unirest.put("https://{yourDomain}/api/v2/prompts/signup-password/partials")
    .header("authorization", "Bearer {mgmtApiToken}")
    .header("content-type", "application/json")
    .body("{\"signup-password\":{\"form-footer-start\":\"   Send a secure code by email \"}}")
    .asString();
  ```

  ```javascript Node.JS lines
  var axios = require("axios").default;

  var options = {
    method: 'PUT',
    url: 'https://{yourDomain}/api/v2/prompts/signup-password/partials',
    headers: {authorization: 'Bearer {mgmtApiToken}', 'content-type': 'application/json'},
    data: {
      'signup-password': {
        'form-footer-start': '<form method="post" data-form-secondary="true"><input type="hidden" name="state" value="{{state}}"> <input type="hidden" name="connection" value="email"> <button type="submit" id="switchConnectionButton" style="background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;" data-action-button-secondary="true"> <span>Send a secure code by email</span> </button></form>'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```obj-c Obj-C lines expandable
  #import <Foundation/Foundation.h>

  NSDictionary *headers = @{ @"authorization": @"Bearer {mgmtApiToken}",
                             @"content-type": @"application/json" };
  NSDictionary *parameters = @{ @"signup-password": @{ @"form-footer-start": @"<form method=\"post\" data-form-secondary=\"true\"><input type=\"hidden\" name=\"state\" value=\"{{state}}\"> <input type=\"hidden\" name=\"connection\" value=\"email\"> <button type=\"submit\" id=\"switchConnectionButton\" style=\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\" data-action-button-secondary=\"true\"> <span>Send a secure code by email</span> </button></form>" } };

  NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/prompts/signup-password/partials"]
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:10.0];
  [request setHTTPMethod:@"PUT"];
  [request setAllHTTPHeaderFields:headers];
  [request setHTTPBody:postData];

  NSURLSession *session = [NSURLSession sharedSession];
  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                  if (error) {
                                                      NSLog(@"%@", error);
                                                  } else {
                                                      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                      NSLog(@"%@", httpResponse);
                                                  }
                                              }];
  [dataTask resume];
  ```

  ```php PHP lines expandable
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/prompts/signup-password/partials",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_POSTFIELDS => "{\"signup-password\":{\"form-footer-start\":\"<form method=\\\"post\\\" data-form-secondary=\\\"true\\\"><input type=\\\"hidden\\\" name=\\\"state\\\" value=\\\"{{state}}\\\"> <input type=\\\"hidden\\\" name=\\\"connection\\\" value=\\\"email\\\"> <button type=\\\"submit\\\" id=\\\"switchConnectionButton\\\" style=\\\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\\\" data-action-button-secondary=\\\"true\\\"> <span>Send a secure code by email</span> </button></form>\"}}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {mgmtApiToken}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python lines
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{\"signup-password\":{\"form-footer-start\":\"<form method=\\\"post\\\" data-form-secondary=\\\"true\\\"><input type=\\\"hidden\\\" name=\\\"state\\\" value=\\\"{{state}}\\\"> <input type=\\\"hidden\\\" name=\\\"connection\\\" value=\\\"email\\\"> <button type=\\\"submit\\\" id=\\\"switchConnectionButton\\\" style=\\\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\\\" data-action-button-secondary=\\\"true\\\"> <span>Send a secure code by email</span> </button></form>\"}}"

  headers = {
      'authorization': "Bearer {mgmtApiToken}",
      'content-type': "application/json"
      }

  conn.request("PUT", "/{yourDomain}/api/v2/prompts/signup-password/partials", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby lines
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/prompts/signup-password/partials")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Put.new(url)
  request["authorization"] = 'Bearer {mgmtApiToken}'
  request["content-type"] = 'application/json'
  request.body = "{\"signup-password\":{\"form-footer-start\":\"<form method=\\\"post\\\" data-form-secondary=\\\"true\\\"><input type=\\\"hidden\\\" name=\\\"state\\\" value=\\\"{{state}}\\\"> <input type=\\\"hidden\\\" name=\\\"connection\\\" value=\\\"email\\\"> <button type=\\\"submit\\\" id=\\\"switchConnectionButton\\\" style=\\\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\\\" data-action-button-secondary=\\\"true\\\"> <span>Send a secure code by email</span> </button></form>\"}}"

  response = http.request(request)
  puts response.read_body
  ```

  ```swift Swift lines expandable
  import Foundation

  let headers = [
    "authorization": "Bearer {mgmtApiToken}",
    "content-type": "application/json"
  ]
  let parameters = ["signup-password": ["form-footer-start": "<form method=\"post\" data-form-secondary=\"true\"><input type=\"hidden\" name=\"state\" value=\"{{state}}\"> <input type=\"hidden\" name=\"connection\" value=\"email\"> <button type=\"submit\" id=\"switchConnectionButton\" style=\"background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\" data-action-button-secondary=\"true\"> <span>Send a secure code by email</span> </button></form>"]] as [String : Any]

  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

  let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/prompts/signup-password/partials")! as URL,
                                          cachePolicy: .useProtocolCachePolicy,
                                      timeoutInterval: 10.0)
  request.httpMethod = "PUT"
  request.allHTTPHeaderFields = headers
  request.httpBody = postData as Data

  let session = URLSession.shared
  let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
    if (error != nil) {
      print(error)
    } else {
      let httpResponse = response as? HTTPURLResponse
      print(httpResponse)
    }
  })

  dataTask.resume()
  ```
</CodeGroup>

As a result, a **Send a secure code by email button** is added to the `signup-password` screen. When a user selects this button, it submits a form body containing the login state parameter and the name of the desired connection.

### Configure login prompts

For best results, configuring the login prompt for both password and passwordless connections is recommended.

You can configure the `login-password` prompt using the [Set partials for a prompt](https://auth0.com/docs/api/management/v2/prompts/put-partials) endpoint:

<CodeGroup>
  ```bash cURL lines
  curl --request PUT \
    --url 'https://{yourDomain}/api/v2/prompts/login-password/partials' \
    --header 'authorization: Bearer {mgmtApiToken}' \
    --header 'content-type: application/json' \
    --data '{"login-password":{"form-footer-start":"   Send a secure code by email "}}'
  ```

  ```csharp C# lines
  var client = new RestClient("https://{yourDomain}/api/v2/prompts/login-password/partials");
  var request = new RestRequest(Method.PUT);
  request.AddHeader("authorization", "Bearer {mgmtApiToken}");
  request.AddHeader("content-type", "application/json");
  request.AddParameter("application/json", "{\"login-password\":{\"form-footer-start\":\"   Send a secure code by email \"}}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go lines expandable
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/prompts/login-password/partials"

  	payload := strings.NewReader("{\"login-password\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>\"}}")

  	req, _ := http.NewRequest("PUT", url, payload)

  	req.Header.Add("authorization", "Bearer {mgmtApiToken}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }n(string(body))
  }
  ```

  ```java Java lines
  HttpResponse response = Unirest.put("https://{yourDomain}/api/v2/prompts/login-password/partials")
    .header("authorization", "Bearer {mgmtApiToken}")
    .header("content-type", "application/json")
    .body("{\"login-password\":{\"form-footer-start\":\"   Send a secure code by email \"}}")
    .asString();
  ```

  ```javascript Node.JS lines
  var axios = require("axios").default;

  var options = {
    method: 'PUT',
    url: 'https://{yourDomain}/api/v2/prompts/login-password/partials',
    headers: {authorization: 'Bearer {mgmtApiToken}', 'content-type': 'application/json'},
    data: {
      'login-password': {
        'form-footer-start': '<form method=\'post\' data-form-secondary=\'true\'><input type=\'hidden\' name=\'state\' value=\'{{state}}\'> <input type=\'hidden\' name=\'connection\' value=\'email\'> <button type=\'submit\' id=\'switchConnectionButton\' style=\'background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\' data-action-button-secondary=\'true\'> <span>Send a secure code by email</span> </button></form>'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```obj-c Obj-C lines expandable
  #import <Foundation/Foundation.h>

  NSDictionary *headers = @{ @"authorization": @"Bearer {mgmtApiToken}",
                             @"content-type": @"application/json" };
  NSDictionary *parameters = @{ @"login-password": @{ @"form-footer-start": @"<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>" } };

  NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/prompts/login-password/partials"]
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:10.0];
  [request setHTTPMethod:@"PUT"];
  [request setAllHTTPHeaderFields:headers];
  [request setHTTPBody:postData];

  NSURLSession *session = [NSURLSession sharedSession];
  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                  if (error) {
                                                      NSLog(@"%@", error);
                                                  } else {
                                                      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                      NSLog(@"%@", httpResponse);
                                                  }
                                              }];
  [dataTask resume];
  ```

  ```php PHP lines expandable
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/prompts/login-password/partials",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_POSTFIELDS => "{\"login-password\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>\"}}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {mgmtApiToken}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python lines
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{\"login-password\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>\"}}"

  headers = {
      'authorization': "Bearer {mgmtApiToken}",
      'content-type': "application/json"
      }

  conn.request("PUT", "/{yourDomain}/api/v2/prompts/login-password/partials", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby lines
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/prompts/login-password/partials")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Put.new(url)
  request["authorization"] = 'Bearer {mgmtApiToken}'
  request["content-type"] = 'application/json'
  request.body = "{\"login-password\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>\"}}"

  response = http.request(request)
  puts response.read_body
  ```

  ```swift Swift lines expandable
  import Foundation

  let headers = [
    "authorization": "Bearer {mgmtApiToken}",
    "content-type": "application/json"
  ]
  let parameters = ["login-password": ["form-footer-start": "<form method='post' data-form-secondary='true'><input type='hidden' name='state' value='{{state}}'> <input type='hidden' name='connection' value='email'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Send a secure code by email</span> </button></form>"]] as [String : Any]

  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

  let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/prompts/login-password/partials")! as URL,
                                          cachePolicy: .useProtocolCachePolicy,
                                      timeoutInterval: 10.0)
  request.httpMethod = "PUT"
  request.allHTTPHeaderFields = headers
  request.httpBody = postData as Data

  let session = URLSession.shared
  let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
    if (error != nil) {
      print(error)
    } else {
      let httpResponse = response as? HTTPURLResponse
      print(httpResponse)
    }
  })

  dataTask.resume()
  ```
</CodeGroup>

As a result, a **Send a secure code by email button** is added to the `login-password` screen. When a user selects this button, it submits a form body containing the login state parameter and the name of the desired connection.

Similarly, you can configure the `login-passwordless` prompt using the [Set partials for a prompt](https://auth0.com/docs/api/management/v2/prompts/put-partials) endpoint:

<CodeGroup>
  ```bash cURL lines
  curl --request PUT \
    --url 'https://{yourDomain}/api/v2/prompts/login-passwordless/partials' \
    --header 'authorization: Bearer {mgmtApiToken}' \
    --header 'content-type: application/json' \
    --data '{"login-passwordless-email-code":{"form-footer-start":"   Use Password Instead "}}'
  ```

  ```csharp C# lines
  var client = new RestClient("https://{yourDomain}/api/v2/prompts/login-passwordless/partials");
  var request = new RestRequest(Method.PUT);
  request.AddHeader("authorization", "Bearer {mgmtApiToken}");
  request.AddHeader("content-type", "application/json");
  request.AddParameter("application/json", "{\"login-passwordless-email-code\":{\"form-footer-start\":\"   Use Password Instead \"}}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go lines expandable
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/prompts/login-passwordless/partials"

  	payload := strings.NewReader("{\"login-passwordless-email-code\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>\"}}")

  	req, _ := http.NewRequest("PUT", url, payload)

  	req.Header.Add("authorization", "Bearer {mgmtApiToken}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java lines
  HttpResponse response = Unirest.put("https://{yourDomain}/api/v2/prompts/login-passwordless/partials")
    .header("authorization", "Bearer {mgmtApiToken}")
    .header("content-type", "application/json")
    .body("{\"login-passwordless-email-code\":{\"form-footer-start\":\"   Use Password Instead \"}}")
    .asString();
  ```

  ```javascript Node.JS lines
  var axios = require("axios").default;

  var options = {
    method: 'PUT',
    url: 'https://{yourDomain}/api/v2/prompts/login-passwordless/partials',
    headers: {authorization: 'Bearer {mgmtApiToken}', 'content-type': 'application/json'},
    data: {
      'login-passwordless-email-code': {
        'form-footer-start': '<form method=\'post\' data-form-secondary=\'true\'><input type=\'hidden\'  name=\'state\' value=\'{{state}}\'> <input type=\'hidden\' name=\'connection\' value=\'Username-Password-Authentication\'> <button type=\'submit\' id=\'switchConnectionButton\' style=\'background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;\' data-action-button-secondary=\'true\'> <span>Use Password Instead</span> </button></form>'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```obj-c Obj-C lines expandable
  #import <Foundation/Foundation.h>

  NSDictionary *headers = @{ @"authorization": @"Bearer {mgmtApiToken}",
                             @"content-type": @"application/json" };
  NSDictionary *parameters = @{ @"login-passwordless-email-code": @{ @"form-footer-start": @"<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>" } };

  NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];

  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://{yourDomain}/api/v2/prompts/login-passwordless/partials"]
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:10.0];
  [request setHTTPMethod:@"PUT"];
  [request setAllHTTPHeaderFields:headers];
  [request setHTTPBody:postData];

  NSURLSession *session = [NSURLSession sharedSession];
  NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                  if (error) {
                                                      NSLog(@"%@", error);
                                                  } else {
                                                      NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                      NSLog(@"%@", httpResponse);
                                                  }
                                              }];
  [dataTask resume];
  ```

  ```php PHP lines expandable
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/prompts/login-passwordless/partials",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_POSTFIELDS => "{\"login-passwordless-email-code\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>\"}}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {mgmtApiToken}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python lines
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{\"login-passwordless-email-code\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>\"}}"

  headers = {
      'authorization': "Bearer {mgmtApiToken}",
      'content-type': "application/json"
      }

  conn.request("PUT", "/{yourDomain}/api/v2/prompts/login-passwordless/partials", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby lines
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/prompts/login-passwordless/partials")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Put.new(url)
  request["authorization"] = 'Bearer {mgmtApiToken}'
  request["content-type"] = 'application/json'
  request.body = "{\"login-passwordless-email-code\":{\"form-footer-start\":\"<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>\"}}"

  response = http.request(request)
  puts response.read_body
  ```

  ```swift Swift lines expandable
  import Foundation

  let headers = [
    "authorization": "Bearer {mgmtApiToken}",
    "content-type": "application/json"
  ]
  let parameters = ["login-passwordless-email-code": ["form-footer-start": "<form method='post' data-form-secondary='true'><input type='hidden'  name='state' value='{{state}}'> <input type='hidden' name='connection' value='Username-Password-Authentication'> <button type='submit' id='switchConnectionButton' style='background: #635dff; width: 100%; padding: 12px 16px; border: none; color: white;' data-action-button-secondary='true'> <span>Use Password Instead</span> </button></form>"]] as [String : Any]

  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

  let request = NSMutableURLRequest(url: NSURL(string: "https://{yourDomain}/api/v2/prompts/login-passwordless/partials")! as URL,
                                          cachePolicy: .useProtocolCachePolicy,
                                      timeoutInterval: 10.0)
  request.httpMethod = "PUT"
  request.allHTTPHeaderFields = headers
  request.httpBody = postData as Data

  let session = URLSession.shared
  let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
    if (error != nil) {
      print(error)
    } else {
      let httpResponse = response as? HTTPURLResponse
      print(httpResponse)
    }
  })

  dataTask.resume()
  ```
</CodeGroup>
