Hi, ory team 1. Is there an API available for upda...
# ory-network
p
Hi, ory team 1. Is there an API available for updating a user's password? 2. Is there an API that allows registering a user without a password? Additionally, after registering the user, is there another API available to update the user's password?
p
Hi @powerful-ram-10043 Have you seen these docs? https://www.ory.sh/docs/kratos/manage-identities/create-users-identities
p
@proud-plumber-24205 After creating a user using identities, how can we update their password? Is there an API available for updating the password after the user has been registered?
@proud-plumber-24205 And also in traits it is only accepting email sync submitSignupFlow(signUpInput: SignupFlowInput) { console.log('>>>>>>>>>>>>signUpInput', signUpInput); const oryResponse = await this.registerUserWithEmail({ schema_id: 'preset://email', traits: { email: signUpInput.email, userType: signUpInput.userType, firstName: signUpInput.fullName || '', lastName: signUpInput.fullName || '', }, }); console.log('>>>>>>>>>>>>>>oryResponse', oryResponse); }
You can use this API to create an identity with a password
You have to make sure the schemaId is correct
p
@proud-plumber-24205 I want to register the user without a password it is possible with identities, also after registering him I need to update the user with the password with our UI is that possible do you have any APIs to achieve this case
p
so you want to from an admin portal create users and update their passwords?
p
yes
p
Then yes, we have APIs for creating the identity and setting a password. The links I sent above should help with that 🙂
p
@proud-plumber-24205 with this link https://www.ory.sh/docs/reference/api#tag/identity/operation/createIdentity i am able to create the user with email it is working fine after that i tried this one https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities now i tried to update the user with password it is giving me this error while validating Request failed with status code 409 i am not able to update it with the password it is giving conflict
p
When you update, are you making a POST request or a PUT request?
p
Thank you it is working but there is one problem https://www.ory.sh/docs/reference/api#tag/identity/operation/createIdentity this API is taking only email in traits if I pass any extra feilds it is throwing an error
p
how does your identity schema look like?
p
like this { "$id": "https://schemas.ory.sh/presets/kratos/identity.email.schema.json", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "title": "E-Mail", "ory.sh/kratos": { "credentials": { "password": { "identifier": true }, "webauthn": { "identifier": true }, "totp": { "account_name": true } }, "recovery": { "via": "email" }, "verification": { "via": "email" } }, "maxLength": 320 }, "name": { "type": "string" }, "userType": { "type": "string" } }, "required": [ "email" ], "additionalProperties": true } } }
p
so make sure you are passing the correct schema ID to the admin API. the schema ID can be retrieved through a different API https://www.ory.sh/docs/reference/api#tag/identity/operation/listIdentitySchemas