# Replace a user identity **PUT /api/my-account/identities** Replace (upsert) an identity (social identity) for the user. Creates the identity if absent, replaces it otherwise. Idempotent. Unlike POST, this allows replacing an existing identity for the same social target. When replacing with a different social user ID, previously stored third-party tokens for the old identity are cleared. A logto-verification-id header is required for checking sensitive permissions, and a verification record for the social identity is required. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters ### Body: application/json (object) - **newIdentifierVerificationRecordId** (string) The identifier verification record ID for the new social identity ownership verification. ## Responses ### 204 The identity was replaced successfully. ### 400 The request body is invalid or the social identity field is not editable. ### 401 Permission denied, identity verification is required or insufficient scope. ### 403 Forbidden ### 422 The new verification record is invalid or the identity is already in use. [Powered by Bump.sh](https://bump.sh)