# Sandbox Error: undefined on creating user

**URL:** <https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776>\
**Category:** Get Help\
**Created:** [July 11, 2022, 7:53pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776 "2022-07-11T19:53:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudumonteiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dudumonteiro/32/35891_2.png) [@dudumonteiro](https://community.auth0.com/u/dudumonteiro)\
**Post date:** [July 11, 2022, 7:53pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/1 "2022-07-11T19:53:57Z")

</div>

Hi,

I’m stuck trying to create user with the management api.  
I get this error: `Sandbox Error: undefined` on creating user

The description of the error on auth0 dashboard logs is:` "Unexpected token C in JSON at position 0"`  
It does not makes sense to me.

I have a custom database with “Import users to auth0” enabled.  
I have no action flow scripts.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 11, 2022, 9:31pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/3 "2022-07-11T21:31:38Z")

</div>

Hi @dudumonteiro,

Thanks for reaching out to the Auth0 Community!

I understand that you have encountered issues when creating a user with the Management API.

Before we continue, could you please share your Create a User request?

And, could you please clarify if you are trying to use the Management API to create a user in your custom database?

I look forward to hearing from you.

Thank you.

---

<div class="post-metadata">

**Author:** ![dudumonteiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dudumonteiro/32/35891_2.png) [@dudumonteiro](https://community.auth0.com/u/dudumonteiro)\
**Post date:** [July 11, 2022, 9:54pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/4 "2022-07-11T21:54:12Z")

</div>

hi @rueben.tiow ,

thanks for replying.

here is my create user request:  
`curl -H "Authorization: Bearer {access_token}" -X POST -H "Content-Type: application/json" -d '{"email":"mariay@example.com","given_name":"Maria","family_name":"Silva","name":"Maria Silva","nickname":"mariay","connection":"MigrationDatabase","password":"maria","username":"mariay"}' https://{AUTH0_DOMAIN}/api/v2/users`

and yes, I am trying to create a user in my custom database (MigrationDatabase).

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 13, 2022, 5:18pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/5 "2022-07-13T17:18:06Z")

</div>

Hi @dudumonteiro,

Thank you for your response and clarification.

After reviewing your request, everything looks good. Could you please confirm if you have implemented your Database Action scripts?

And could you please DM your tenant name for me to investigate your settings?

Thank you.

---

<div class="post-metadata">

**Author:** ![dudumonteiro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dudumonteiro/32/35891_2.png) [@dudumonteiro](https://community.auth0.com/u/dudumonteiro)\
**Post date:** [July 13, 2022, 5:28pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/6 "2022-07-13T17:28:53Z")

</div>

Hi @rueben.tiow ,

The problem was on `Get User` script.  
It wasn’t handling the “404 exception” when user is not found.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [July 13, 2022, 8:45pm UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/7 "2022-07-13T20:45:53Z")

</div>

Hi @dudumonteiro,

Thank you for sharing your solution with the rest of the Community!

Please reach out if you have any other questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 11:38am UTC](https://community.auth0.com/t/sandbox-error-undefined-on-creating-user/86776/8 "2022-12-22T11:38:02Z")

</div>


