# Not able to update the phone\_number attribute for users with SMS connection

**URL:** <https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554>\
**Category:** Get Help\
**Tags:** passwordless-sms-connection, connections\
**Created:** [April 8, 2024, 10:36pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554 "2024-04-08T22:36:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![othecos](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@othecos](https://community.auth0.com/u/othecos)\
**Post date:** [April 8, 2024, 10:36pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/1 "2024-04-08T22:36:12Z")

</div>

Every time I try to update an user phone\_number with the management API I get this error:

```auto
Bad Request: Can only update phone_number for auth0 connections with attribute configuration enabled and options.attributes configured.

```

What am I missing here on the configuration?  
Couldn’t find any docs talking about this.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 8, 2024, 11:31pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/3 "2024-04-08T23:31:21Z")

</div>

Hey there @othecos welcome to the community!

Just to clarify, this is a passwordless user (sms) for which you are attempting to update the `phone_number` attribute - Are you using the `/api/v2/users/{id}` [endpoint](https://auth0.com/docs/api/management/v2/users/patch-users-by-id)?

---

<div class="post-metadata">

**Author:** ![othecos](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@othecos](https://community.auth0.com/u/othecos)\
**Post date:** [April 9, 2024, 12:20pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/4 "2024-04-09T12:20:45Z")

</div>

Hey @ty.frith ! Thank you for the quick response!

First, yes, **I’m trying to update a passwordless user (sms) phone\_number**.

Secondly, I’m using the [Node.js Sdk](https://www.npmjs.com/package/auth0) to make the call.

This is the code I’m running

```auto
import { ManagementClient } from 'auth0';
const authzManagementClient = new ManagementClient({
        domain: this.configService.get<string>('auth0.managementApi.domain') || '',
        clientId: this.configService.get<string>('auth0.managementApi.clientId') || '',
        clientSecret: this.configService.get<string>('auth0.managementApi.clientSecret') || '',
        scope: this.configService.get<string>('auth0.managementApi.scope') || '',
      });
return authzManagementClient.updateUser({ id: auth0Id }, { phone_number });

```

It works for a development tenant that I have, but for the production tenant it throws the error message I described in the topic. I don’t recall doing any different setup for the development tenant, so I’m really confuse about the error message.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 9, 2024, 4:57pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/5 "2024-04-09T16:57:55Z")

</div>

No problem, happy to help!

Thanks for the additional context 🙂 The fact that you only get the error in the production tenant makes me believe it related to a feature flag of sorts. Let me dig into this a bit internally and get back to you!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 13, 2024, 3:48pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/8 "2024-04-13T15:48:18Z")

</div>

Hey @othecos , quick update here - We took at look at your tenants and don’t see any differences there that could be causing this. Do you mind sharing the ID of the user via DM? I’m also curious if you can update the phone number on the `sms` connection user using the Management API [endpoint](https://auth0.com/docs/api/management/v2/users/patch-users-by-id) directly?

Thanks for your patience!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 22, 2024, 10:53pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/9 "2024-04-22T22:53:19Z")

</div>

Following up on this:

This error could happen for an SMS Connection user under the following scenario:

- User profile with two linked identities: 1) auth0 db connection as the primary identity 2) sms connection as the secondary identity
- PATCH `/api/v2/users/{id}` with a `phone_number` in the payload, but no `connection` parameter specified.

When no `connection` parameter is specified in the payload, the primary identity’s connection is used. However, if that is a regular db connection without Attributes configured, this error would show up.

---

<div class="post-metadata">

**Author:** ![othecos](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@othecos](https://community.auth0.com/u/othecos)\
**Post date:** [April 22, 2024, 11:54pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/10 "2024-04-22T23:54:10Z")

</div>

@ty.frith Hey! Thank you for the response!

I’ve been busy with other requests, thus I haven’t checked this in a while!

So, we saw that the users that are facing this have both SMS and DB connections.

To be able to update those users, what is the correct approach then?

Simply specifying the type of connection would solve the issue?

PATCH `/api/v2/users/{id}` with a `phone_number` in the payload, but and `connection` sms ?

And again, thank you for the response!

---

<div class="post-metadata">

**Author:** ![othecos](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@othecos](https://community.auth0.com/u/othecos)\
**Post date:** [April 23, 2024, 12:14am UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/11 "2024-04-23T00:14:23Z")

</div>

@ty.frith Update! Tried the PATCH with the connection type equal SMS and it worked!!

Thank you for all the help!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 23, 2024, 10:11pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/12 "2024-04-23T22:11:04Z")

</div>

Hey @othecos that’s awesome! Happy to hear and thanks a bunch for following up to confirm here 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 7, 2024, 10:11pm UTC](https://community.auth0.com/t/not-able-to-update-the-phone-number-attribute-for-users-with-sms-connection/131554/13 "2024-05-07T22:11:54Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
