Skip to main content
PATCH
https://{tenantDomain}/api/v2
/
users
/
{id}
/
authentication-methods
/
{authentication_method_id}
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Users.AuthenticationMethods.UpdateAsync(
            id: "id",
            authenticationMethodId: "authentication_method_id",
            request: new UpdateUserAuthenticationMethodRequestContent()
        );
    }

}
package example

import (
    context "context"

    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
    users "github.com/auth0/go-auth0/management/management/users"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &users.UpdateUserAuthenticationMethodRequestContent{}
    client.Users.AuthenticationMethods.Update(
        context.TODO(),
        "id",
        "authentication_method_id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.users.authenticationmethods.requests.UpdateUserAuthenticationMethodRequestContent;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.users().authenticationMethods().update(
            "id",
            "authentication_method_id",
            UpdateUserAuthenticationMethodRequestContent
                .builder()
                .build()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Users\AuthenticationMethods\Requests\UpdateUserAuthenticationMethodRequestContent;

$client = new Management(
    token: '<token>',
);
$client->users->authenticationMethods->update(
    'id',
    'authentication_method_id',
    new UpdateUserAuthenticationMethodRequestContent([]),
);
from auth0.management import ManagementClient

client = ManagementClient(
    token="<token>",
)

client.users.authentication_methods.update(
    id="id",
    authentication_method_id="authentication_method_id",
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.users.authentication_methods.update(
  id: "id",
  authentication_method_id: "authentication_method_id"
)
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.users.authenticationMethods.update("id", "authentication_method_id", {});
}
main();
curl --request PATCH \
  --url https://{tenantDomain}/api/v2/users/{id}/authentication-methods/{authentication_method_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "totp_secret": "<string>",
  "phone_number": "<string>",
  "email": "<string>",
  "authentication_methods": [
    {
      "id": "<string>"
    }
  ],
  "key_id": "<string>",
  "public_key": "<string>",
  "aaguid": "<string>",
  "relying_party_identifier": "<string>",
  "confirmed": true,
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The ID of the user in question.

authentication_method_id
string
required

The ID of the authentication method to update.

Body

name
string

A human-readable label to identify the authentication method.

preferred_authentication_method
enum<string>

Preferred phone authentication method

Available options:
voice,
sms

Response

Authentication method updated.

The successfully created authentication method.

type
enum<string>
required
Available options:
phone,
email,
totp,
webauthn-roaming
id
string<authenticator-id>

The ID of the newly created authentication method (automatically generated by the application)

name
string

A human-readable label to identify the authentication method.

totp_secret
string

Base32 encoded secret for TOTP generation

phone_number
string

Applies to phone authentication methods only. The destination phone number used to send verification codes via text and voice.

Required string length: 2 - 30
email
string

Applies to email authentication methods only. The email address used to send verification messages.

authentication_methods
object[]
preferred_authentication_method
enum<string>

Applies to phone authentication methods only. The preferred communication method.

Available options:
voice,
sms
key_id
string

Applies to webauthn authentication methods only. The id of the credential.

public_key
string

Applies to webauthn authentication methods only. The public key.

aaguid
string

Applies to passkey authentication methods only. Authenticator Attestation Globally Unique Identifier.

relying_party_identifier
string

Applies to webauthn authentication methods only. The relying party identifier.

confirmed
boolean

Whether the authentication method has been confirmed.

created_at
string<date-time>

Authentication method creation date