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

Hello,

I’m attempting to use the Action that Stores 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:

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. 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?

Can anyone else get this to work?

Thanks and Regards,

I’m trying this integration right now… but haven’t gotten it to work yet…

Hey team! :waving_hand:

Since this topic touches Auth0 Actions, quick heads-up that we’re hosting an Ask Me Anything dedicated to Actions with Gaston Danilo Asis Sanchez, Senior Technical Product Manager. We’ll cover practical usage, new capabilities like Transaction Metadata and Actions Types, plus a peek at what’s next. :sparkles:

  • Submit questions now through Aug 26 :writing_hand:
  • Get detailed written answers live on Aug 27, 9–11 AM PT :speech_balloon:

Earn community points + a badge :trophy:. If you’re exploring how Actions can streamline your auth flows, this is a great time to get direct guidance from the team.
Join the AMA & drop your questions here: August 27 Auth0 Community Ask Me Anything: Actions

Dawid