Resend code not working
Hi Zitadel team!
I am trying to create a user via API, it creates it and its also sending a notification through SMTP, I receive the email correctly, but what if the user lost that first activation email and needs a new one, I was expecting to click on Resend Code and receive a new email, instead I see the error Could not find code. I wonder if this is something on your end, or it something I have to add on my instance?
Much thanks!

4 Replies
Hi @Avlambertucci, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
I wasn't able to find a direct answer to your "Resend Code" issue in the available documentation, here are some relevant sources:
1. Create a User (1) : This shows how email verification codes can be returned directly to you instead of being sent automatically, giving you control over the verification process.
2. How to programmatically activate a user through the API (2) : This discussion mentions using the send email code and verify email endpoints for user activation scenarios.
To learn more, see the sources I considered:
[1] Create a User
[2] How to programmatically activate a user through the API
Feel free to tag @Ask Inkeep with additional questions.
hey @Avlambertucci thanks for your question, its actually neither your problem or zitadel's, its just that the notifier(the service that sends the code to your email) is a bit slow sometimes, how are you hosted?. Can you also pls share your curl request taht you used?. Thanks
@Rajat Hi thanks for reaching out, an update to this issue is that I would like to be able to select which notifications send to the user, because I have my own communication center that also sends email.
These are the endpoints we've been using
self.create_user_url = f"{settings.AUTHORITY}/v2/users/human"
self.invite_code_url = f"{settings.AUTHORITY}/v2/users/{{user_id}}/invite_code"
I noticed that the one I create user is deprecated, but I tried to
~ curl -i -X OPTIONS https://mydomain/v2/users/new
and I received a 405, so I am not sure if that new endpoint is available or not
PAYLOAD CREATE USER: {'profile': {'givenName': 'user', 'familyName': 'user'}, 'email': {'email': 'email@gmail.com', 'sendCode': {'urlTemplate': 'http://localhost:8080/?code={{.Code}}&userID={{.UserID}}&orgID={{.OrgID}}'}}, 'organization': {'orgId': '332215580171960323'}}
1- One thing it worth showing is that on the payload I am passing a sendCode with my app domain because I noticed that after this registration process the user login and goes directly to Zitadel profile page and I don't want that, is there a way of adding a redirect uri on this specific case? when the user logs in I could have something to point out to my OIDC app and redirect that this way.
2- Another thing I was considering is creating the user in a different way so I don't trigger the verify email, is that possible? then I could use my custom email to send a initial password and require them to change on the first login
3- By the way I think in order for the resend button to work it needs to have orgID, userID and code on that popup URL so I added that to sendCodehey @Avlambertucci thanks for the detailed response, I will get back to you on it.