thousands-airline-2718
06/05/2025, 8:23 PMhydra, keto, kratos, maildlurper, oathkeeper, postgres of couse, and redis , all are good and healthy. I created a custom users admin api and ui projects to interact with it as well and I need to know how to start creating users on kratos first.chilly-king-10285
06/05/2025, 8:23 PMchilly-king-10285
06/05/2025, 8:23 PM/admin/identities endpoint. Here’s a sample curl command: bash curl --request POST -sL \ --header "Content-Type: application/json" \ --data '{ "schema_id": "default", "traits": { "email": "<mailto:[email protected]|[email protected]>" } }' <http://127.0.0.1:4434/admin/identities> - Replace "default" with your schema ID if you use a custom schema. - Adjust the traits object to match your identity schema (e.g., add name, etc.). This will create a new identity in Kratos. The response will include the identity’s ID and other details. Note that this only creates the identity; it does not set a password or credentials yet [Create identities](https://www.ory.sh/docs/kratos/manage-identities/create-users-identities). ### 2. Set Credentials (Password) To allow the user to set their password, you can either: - Use the self-service registration flow (recommended for end-users). - Or, for invited users, trigger an account recovery flow so they can set their password via a secure link [Invite users](https://www.ory.sh/docs/kratos/manage-identities/invite-users). #### Example: Invite User Flow 1. Create the identity (as above). 2. Trigger account recovery to generate a recovery link: bash curl --request POST -sL \ --header "Content-Type: application/json" \ --data '{ "identity_id": "<IDENTITY_ID>", "expires_in": "12h" }' <http://127.0.0.1:4434/admin/recovery/link> - Replace <IDENTITY_ID> with the ID from the previous step. 3. Send the recovery link to the user, so they can set their password and activate their account. --- Summary: - Use the Admin API to create identities. - Use the self-service registration or recovery flow to set credentials. Let me know if you need code samples for a specific language or more details on the registration flow!