glamorous-crayon-34702
09/22/2025, 2:33 PMchilly-king-10285
09/22/2025, 2:33 PMchilly-king-10285
09/22/2025, 2:33 PMbash curl --request PATCH "https://$<http://ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID|ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID>" \ --header "Authorization: Bearer $ORY_API_KEY" \ --header "Content-Type: application/json" \ --data-raw '[ { "op": "replace", "path": "/metadata_public", "value": { "role": "user", "plan": "pro" } } ]'
Notes and cautions: - PATCH replaces the whole field you target. If you replace /metadata_public or /metadata_admin, send the complete desired object, not just a fragment. [[Modify identities](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#modify-identities)] - Do not attempt to modify credentials with PATCH; it’s unsupported and may break flows. Use PATCH only for allowed fields or use PUT updateIdentity if you need to update credentials via the supported mechanism. [[patchIdentity](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json); [Kratos discussion](https://github.com/ory/kratos/discussions/4395)] If you need to bulk-update metadata across many identities, consider the batchPatchIdentities endpoint, which follows the same patch semantics across multiple identities in one request. [[batchPatchIdentities](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json); [batchPatchIdentities](https://raw.githubusercontent.com/ory/kratos/master/spec/api.json)]