# Cannot update the phone\_number for user

**URL:** <https://community.auth0.com/t/cannot-update-the-phone-number-for-user/107914>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [May 26, 2023, 5:14pm UTC](https://community.auth0.com/t/cannot-update-the-phone-number-for-user/107914 "2023-05-26T17:14:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jringsakabe](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jringsakabe/32/47555_2.png) [@jringsakabe](https://community.auth0.com/u/jringsakabe)\
**Post date:** [May 26, 2023, 5:14pm UTC](https://community.auth0.com/t/cannot-update-the-phone-number-for-user/107914/1 "2023-05-26T17:14:42Z")

</div>

### Describe the problem

I’m trying to update the user’s phone number, but got the following error `{"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Expected type object but found type null'.","errorCode":"invalid_body"}`  
I’m able to get data from API.

### What was the expected behavior?

Get success update response.

### Reproduction

 ![image (6)](https://global.discourse-cdn.com/auth0/original/3X/8/c/8c755872aee0b3603b76cbfabe7f7012b7ee72ef.png)

---

<div class="post-metadata">

**Author:** ![sylvainf](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sylvainf/32/35478_2.png) [@sylvainf](https://community.auth0.com/u/sylvainf)\
**Post date:** [May 31, 2023, 12:26pm UTC](https://community.auth0.com/t/cannot-update-the-phone-number-for-user/107914/2 "2023-05-31T12:26:22Z")

</div>

Hi @jringsakabe

The endpoint to update users works for me. What does line 6 in your Python script do? It looks like the tool you’re using (Postman?) doesn’t send the actual body. It also looks like you’re creating an empty “payload” dictionary. What data are you sending on line 13? (i can’t see because it’s truncated). Below is a working example (I didn’t include the imports and headers but you need them):

```auto
		user_id = 'auth0|123'
		phone_number = '+33123456789'

		payload = {
			'phone_number': phone_number
		}

		r = requests.patch(url + f'/api/v2/users/{user_id}', headers=headers, json=payload).json()
		pprint(r)

```

---

<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:** [June 14, 2023, 12:27pm UTC](https://community.auth0.com/t/cannot-update-the-phone-number-for-user/107914/3 "2023-06-14T12:27:03Z")

</div>

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