<@U04UQ68083H> is it possible to create an identit...
# ory-copilot
b
@chilly-king-10285 is it possible to create an identity with a specific ID? For example when restoring an identity from backup
c
A message from kapa.ai
No. Ory Kratos generates the identity ID (UUID) and it cannot be chosen or changed. When creating or importing identities, you can set traits and optional fields like external_id, but not the primary id. For migrations/restores, use external_id to preserve your own identifier and look up the generated id via the “get by external_id” API (the identity id “can not be changed and can not be chosen”; use external_id for migration and lookups) ([Identity model](https://www.ory.sh/docs/kratos/manage-identities/overview)), ([External Identifiers](https://www.ory.sh/docs/kratos/manage-identities/external-id)).
b
@chilly-king-10285 can you create an OAuth client with a specific id?
c
A message from kapa.ai
Yes. When creating or updating an OAuth2 client via the Admin API, you can set the client’s ID explicitly. The create endpoint echoes the provided client_secret (or generates one if omitted), and the set (PUT) endpoint replaces a client by its ID, allowing you to choose the ID path parameter and update all fields (be careful: it replaces the entire client) ([createOAuth2Client](https://raw.githubusercontent.com/ory/hydra/master/spec/api.json), [setOAuth2Client](https://raw.githubusercontent.com/ory/hydra/master/spec/api.json)). Using Ory tooling: - Ory Network/CLI supports creating and updating clients; the “update” commands replace the whole client, mirroring the PUT semantics (useful if you need to enforce a specific ID you control via API) ([Manage OAuth2 clients](https://www.ory.sh/docs/hydra/guides/oauth2-clients), [ory update oauth2-client](https://www.ory.sh/docs/cli/ory-update-oauth2-client#ory-update-oauth2-client), [hydra update oauth2-client](https://www.ory.sh/docs/hydra/cli/hydra-update-oauth2-client#hydra-update-oauth2-client)).