Good day, dear team,

Thanks for your constant devotion to the redash product. Currently we are using it as a dashboard in our intenal network. It really helps us a lot.

The issue is the network is isolated and we cant send email verification to the user.

I wonder if we have a simpler way to create users such as inserting the username, email to the database?

Thanks in advance.

You can’t insert usernames and passwords directly, but you can do this with the API. Each user requires two requests:

First Request: create a new user

Do this with a POST request to baseurl/api/users?no_invite. Your request should include a JSON object with name and email keys. The no_invite querystring variable forces Redash to return an invite_link in the response.

Second Request: Push a password

POST to the invite_link URL from the first request. This network request should be multi-part form encoded with a single key: password.

Commentary

I’d avoid forcing the passwords with the second request. It’s probably sufficient to make the first network request, note the invite_link and share that with your users through some internal system. But that’s up to you.

Thanks for your instant response, much appreciated! :clap:

1 Like

I tried the way you said but I’m getting a message as “Couldn’t find resource. Please login and try again.”

Here is the screenshot from postman.

I fixed it by creating user from cli.

The CLI can do it to :slight_smile: But there’s no reason you can’t do it via the API. I suspect you received an error because you didn’t include an Authorization header in your HTTP request.

curl --header “Content-Type: application/json” --request POST --data ‘{“email”: “mail_account”, “name”: “user_name”}’ ‘https://link_redash/api/users?no_invite’ --header “Authorization: API_KEY”