We have a self hosted instance of `ory kratos` (Ve...
# talk-kratos
b
We have a self hosted instance of
ory kratos
(Version 1.0.0 as 0.10.1 did not have this feature) where some users need to be patched by us. I tried to use the method for patching an identity: https://www.ory.sh/docs/kratos/reference/api#tag/identity/operation/patchIdentity The required field
path
is set to the trait I want to patch, which is "/traits.name.first" in my case, `op`is
replace
, value is the new value I want to set, which is a string. This trait is defined in the schemafile and I can see it under the mentioned path, if I do a simple
GET
request on the same user. The
PATCH
request returns success (status code
200
) as described in the documentation, but the returned data still show the old value (and a subsequent
GET
shows the old data too). I experimented a bit with giving different or outright wrong values for
op
or `path`and noticed that I can put virtually anything inside
path
as long as it starts with "/" without being able to provoke an error. I also tried giving the
from
field too, although that seems pointless here, just to mimic what is described in the documentation as close as possible, to no avail. Maybe a bug?
m
Hello @breezy-apple-10968 patchIdentity should do the trick! See this guide https://www.ory.sh/docs/identities/model/manage-identity-schema#update-identities-to-use-a-new-schema Let me know if that helps
b
This seems to be another pointer to the same thing: The API interface to the management of identities. I did exactly what is described there, but get the error I already described. Have you been able to use this successfully? I have now resorted to `PUT`aka "Update". So I first make a `GET`request and then I do a `PUT`after having changed what I wanted to. This works.
m
Have you been able to use this successfully?
Yea I wrote the guide so I tested it extensively. Maybe you can share in DM with me what you were trying with PATCH that did not work. You cant change
id
,
stateChangedAt
and
credentials
with PATCH, traits should work without issue