# Action to Store the Auth0 user id in a remote system doesnt work

**URL:** <https://community.auth0.com/t/action-to-store-the-auth0-user-id-in-a-remote-system-doesnt-work/75902>\
**Category:** Get Help\
**Tags:** exporting-user-data-, actions, auth0\
**Created:** [January 6, 2022, 5:50am UTC](https://community.auth0.com/t/action-to-store-the-auth0-user-id-in-a-remote-system-doesnt-work/75902 "2022-01-06T05:50:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robliou01](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robliou01/32/34126_2.png) [@robliou01](https://community.auth0.com/u/robliou01)\
**Post date:** [January 6, 2022, 5:50am UTC](https://community.auth0.com/t/action-to-store-the-auth0-user-id-in-a-remote-system-doesnt-work/75902/1 "2022-01-06T05:50:34Z")

</div>

Hello,

I’m attempting to use the [Action that Stores the Auth0 user id in a remote system](https://auth0.com/docs/actions/triggers/post-user-registration#store-the-auth0-user-id-in-a-remote-system).

However, it doesn’t work. The error I get is simply:

_“Error! API Error. Please contact Auth0 if error persists.”_  
Below this message, the second error message just shows up as a blank object: _“Error: {}”_

Here is my test code, which is completely based off of the example given by Auth0:

```auto
const axios = require("axios");

exports.onExecutePostUserRegistration = async (event) => {

  await axios.post("postgres://<my_environment_name>:<my_password>@john.db.elephantsql.com/<database name>/<table name>", { params: { email: event.user.email }});

};

```

I have set up my database exactly as per the instructions noted [here](https://auth0.com/blog/configuring-postgresql-as-auth0-custom-database/#Setting-up-a-PostgreSQL-Database). It is a web-based Elephant PostgresSQL database.

**Note that the step to Create a user and send to that same external database works just fine for me (under Authentication, non Action- based).** So, does the problem lie somewhere within the Actions API?

Thanks and Regards,

@rueben.tiow @dan.woda @konrad.sopala

---

<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:** [January 25, 2022, 10:49pm UTC](https://community.auth0.com/t/action-to-store-the-auth0-user-id-in-a-remote-system-doesnt-work/75902/3 "2022-01-25T22:49:52Z")

</div>

Hi @robliou01,

Thanks for reaching out to the Auth0 Community!

> [@robliou01](#):
>
> I have set up my database exactly as per the instructions noted [here](https://auth0.com/blog/configuring-postgresql-as-auth0-custom-database/?#Setting-up-a-PostgreSQL-Database).

Based on the doc you shared, it describes steps to configure PostgreSQL as an Auth0 Custom Database. However, you’re using a Post-User Registration Action to create the user in your PostgreSQL DB instead of the custom DB script.

Additionally, when looking at the `axios.post` request, I believe the issue involves POST-ing a Database URL instead of an HTTPS URL. I can confirm after testing this in the Actions debugger interface.

Given that, I recommend completing the configuration for your custom database with PostgreSQL and implementing the **Create** script. This should create a user whenever a user signs up on your application using this connection. See below.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/d/1d3e8105dc65e2162e8d77af51c51c3201811477.jpeg)

Please let me know how this works for you.

Thanks.

---

<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:** [February 9, 2022, 10:50pm UTC](https://community.auth0.com/t/action-to-store-the-auth0-user-id-in-a-remote-system-doesnt-work/75902/4 "2022-02-09T22:50:44Z")

</div>

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