Hi there, when when calling the "create identity" ...
# talk-kratos
r
Hi there, when when calling the "create identity" API you must provide a
schema_id
. How do you know which ID to provide? Do people set a fixed ID using an env var or similar? I tried looking in the API for a way to fetch the default schema, but cannot find anything. How do people usually do this? Thanks 😊
l
We just store the id in our config.
r
That's also what I ended up doing for now to unblock this. It doesn't feel ideal though. We have dev, staging and prod Ory projects. So we have to update the config for each of them. And if we ever need change the schema, we also have to touch 3 of them. It's fine I guess. Calling an API to get the schema ID would have been nice.
l
There is a /schemas endpoint
r
As far as I can tell there is no info about which one is the "default" in there.
l
That’s true. The
id
value is actually the hash of the schema, so if you use the same schema across your environments, it’ll be the same.
r
Uh nice! That might make things a little easier! Thanks! Maybe we can even generate the ID in CI then since the schema itself is also in our Git repo 🤔 Thanks 🙂
l
In your CI pipeline, you can download the identity-config. The default is listed there.
r
Will look into this! The hint with the ID being a hash makes it much nicer to handle. Thanks again