# Please tell me the arguments for Custom Database Connection functions.

**URL:** <https://community.auth0.com/t/please-tell-me-the-arguments-for-custom-database-connection-functions/192450>\
**Category:** Get Help\
**Tags:** custom-database-connections, connections\
**Created:** [September 26, 2025, 8:15am UTC](https://community.auth0.com/t/please-tell-me-the-arguments-for-custom-database-connection-functions/192450 "2025-09-26T08:15:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yasuyuki.kobayashi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yasuyuki.kobayashi/32/74891_2.png) [@yasuyuki.kobayashi](https://community.auth0.com/u/yasuyuki.kobayashi)\
**Post date:** [September 26, 2025, 8:15am UTC](https://community.auth0.com/t/please-tell-me-the-arguments-for-custom-database-connection-functions/192450/1 "2025-09-26T08:15:42Z")

</div>

In the “Update a connection” documentation

> **[Auth0 Management API v2](https://auth0.com/docs/api/management/v2/connections/patch-connections-by-id)**

I found that there is a customScripts section in the BODY PARAMETERS section, where change\_username and change\_phone\_number are present.

I believe it’s now possible to write change\_username and change\_phone\_number as scripts for a Custom Database Connection.

Please tell me the arguments for these functions.

There is documentation for change\_email.

> **[Change Email Script Template](https://auth0.com/docs/authenticate/database-connections/custom-db/templates/change-email)**
>
> Describes the custom database action script for changing a user's email.

However, there is no documentation for change\_username or change\_phone\_number.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [September 26, 2025, 8:51pm UTC](https://community.auth0.com/t/please-tell-me-the-arguments-for-custom-database-connection-functions/192450/3 "2025-09-26T20:51:56Z")

</div>

Hi @yasuyuki.kobayashi

Welcome to the Auth0 Community!

Thank you for bringing this to our attention! While the `change_username` and `change_phone_number` scripts are not mentioned in our documentations, let me try and provide some information :

- `change_username` : it should function the same way as the `change_email` script, as it ends with return(null, true) when successful. The script must also be added in the list of action scripts via the Management API :

```auto
"change_username": "function changeUsername(oldUsername, newUsername, callback) { console.log("ChangeUsername called")
callback(null, true);}"

```

- `change_phone_number` : this script needs to be implemented in order to update the phone number in the external DB through the [Management API](https://auth0.com/docs/api/management/v2/connections/patch-connections-by-id), as the Auth0 Dashboard does not support it:

```auto
{
"options": {
    "customScripts": {
        "change_phone_number": "function changePhoneNumber(oldPhoneNumber, newPhoneNumber, verified, callback) { console.log(\"Update phone number called....\"); console.log (\"oldPhoneNumber:\", oldPhoneNumber); console.log (\"newPhoneNumber:\", newPhoneNumber); console.log (\"verified:\", verified); console.log (\"callback:\", callback); callback(null, true); \n}\n",
     // other scripts are removed for brevity
    },
    // other attributes are removed for brevity
  }
}

```

Useful documentation:

- [Update the Phone Number of Users with Management API for Custom Database](https://support.auth0.com/center/s/article/Update-the-phone-number-of-users-with-management-API-for-custom-database-DB)

Hope this helped!  
Gerald

---

<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 10, 2025, 8:52pm UTC](https://community.auth0.com/t/please-tell-me-the-arguments-for-custom-database-connection-functions/192450/4 "2025-10-10T20:52:07Z")

</div>

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