calm-farmer-87562
08/15/2025, 8:14 PMbrief-egg-61061
08/15/2025, 8:15 PMbrief-egg-61061
08/15/2025, 8:15 PMDELETE /admin/identities/{id}/credentials/{type}
- To remove the code auth credential (which is typically used for "Log in via email or SMS" with a one-time code), set {type}
to code
. - If the phone number is used as an identifier for another credential type (such as password
or code
), you may need to remove that credential type as well, depending on your schema and how the phone is used. Important: You cannot delete code auth credentials through this API. The documentation explicitly states: > You cannot delete passkeys or code auth credentials through this API. [Delete Identity Credentials API](https://www.ory.sh/docs/reference/api#tag/identity/operation/deleteIdentityCredentials) So, while you can remove other credential types (like password
, totp
, lookup_secret
, etc.), you cannot remove the code
credential via the API at this time. Summary: - You can remove most credential types (including those using phone as an identifier) with the API. - You cannot remove the code
credential (code auth) via the API. If you need to remove a phone identifier from another credential (e.g., password
), you can use: DELETE /admin/identities/{id}/credentials/password
But for code
credentials, removal is not currently supported via the API. For more details, see the official documentation: [Delete Identity Credentials API](https://www.ory.sh/docs/reference/api#tag/identity/operation/deleteIdentityCredentials)calm-farmer-87562
08/17/2025, 3:58 PMbrief-egg-61061
08/17/2025, 3:58 PMbrief-egg-61061
08/17/2025, 3:58 PMpassword
or code
) that uses the phone number as an identifier. This is done using the Admin API: DELETE /admin/identities/{id}/credentials/{type}
- {id}
is the identity's ID. - {type}
is the credential type (e.g., password
, code
). However, according to the documentation, you cannot delete code auth credentials (the "code" type, used for SMS one-time codes) through this API. You can only delete other credential types, such as password
, totp
, etc. If the phone number is used as an identifier for the password
credential, you can remove it with: DELETE /admin/identities/{id}/credentials/password
But if the phone number is only used for the code
credential, there is currently no supported API method to remove it directly via the Admin APIĀ [Delete Identity Credentials API](https://www.ory.sh/docs/reference/api#tag/identity/operation/deleteIdentityCredentials). Summary: - You can remove a phone identifier by deleting the credential type (e.g., password
) that uses it, except for the code
credential. - Removing an SMS phone identifier from the code
credential is not supported via the API at this time. If you need to update the identifiers for a credential, you may need to update the identity's schema or traits and then update the identity, but the knowledge sources do not provide explicit instructions for this scenario.