# Create user via Management API? (using auth0-PHP)

**URL:** <https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496>\
**Category:** Get Help\
**Tags:** auth0-php\
**Created:** [September 29, 2022, 1:40am UTC](https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496 "2022-09-29T01:40:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david29](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david29/32/33194_2.png) [@david29](https://community.auth0.com/u/david29)\
**Post date:** [September 29, 2022, 1:40am UTC](https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496/1 "2022-09-29T01:40:05Z")

</div>

I can’t seem to get a create user request to work. I’m getting a 400 Bad Request reply every time.  
I assume it’s due to the body parameter being wrong in some way, but there seems to be no way for me to know what’s wrong with it.

My example:

$management-\>users()-\>create(“Username-Password-Authentication”, [“email” =\> “[tj@inthooz.com](mailto:tj@inthooz.com)”, “phone\_number” =\> “+199999999999999”, “password” =\> “H6e\>@i9KZmVd}'S;”, “email\_verified” =\> true ] );

---

<div class="post-metadata">

**Author:** ![david29](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david29/32/33194_2.png) [@david29](https://community.auth0.com/u/david29)\
**Post date:** [September 29, 2022, 1:55am UTC](https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496/2 "2022-09-29T01:55:02Z")

</div>

Scratch that. I figured it out!

1. I wasn’t using the HttpResponse::decodeContent() method on the response. That’s why I didn’t get any useful feedback.

2. Once I added that, the API helpfully told me that the phone number was not allowed.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [September 30, 2022, 7:39pm UTC](https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496/3 "2022-09-30T19:39:58Z")

</div>

Thank you for sharing your solution with us! 👏 👍

---

<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:** [October 14, 2022, 7:39pm UTC](https://community.auth0.com/t/create-user-via-management-api-using-auth0-php/91496/4 "2022-10-14T19:39:59Z")

</div>

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