> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove AuthN ID Errors

These are the most common error cases and error codes returned by the [Remove User Attribute](c_removeUserAttribute) Process.

## Cannot removes selected AuthN ID

Email addresses and phone numbers cannot be removed in cases where their removal would result in the user not having any remaining verified authN IDs. In these scenarios, the user must add and verify a second authentication identifier. Even if the user onboarded with their social account, that Process still involves the creation and verification of an authN ID attribute on the Storefront Gateway User entity (i.e., either the user confirms the email/mobile returned by the social provider, or they change the email/mobile value and then verify it before they can complete their onboarding).

If the user does attempt to remove their only verified authN ID, the Process returns the below error:

```
**RESPONSE - body**
{
   "processId": "9d8a22f5-dee8-4661-95a0-51ac272d819e",
   "stepName": "RemoveUserAttributePrompt",
   "lastStep": false,
   "processName": "userManagement.RemoveUserAttribute.v1.0",
   "operationError": [
      {
         "code": "last-auth-identifier",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "The only authentication identifier cannot be removed",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ]
}
```

## Specified attribute does not exist

If the user/client UI attempts to specify an attribute that does not exist on the User entity, the Process returns the below error:

```
**RESPONSE - body**
{
   "processId": "9d8a22f5-dee8-4661-95a0-51ac272d819e",
   "stepName": "RemoveUserAttributePrompt",
   "lastStep": false,
   "processName": "userManagement.RemoveUserAttribute.v1.0",
   "operationError": [
      {
         "code": "invalid-attribute-value",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "Provided attribute value not found",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ]
}
```

## Cannot remove user's primacy contact channel

The user cannot remove an authN ID if it is currently their primary contact channel (for system-generated notifications). If the user attempts this, the Process responds with the following error:

```
**RESPONSE - body**
{
   "processId": "9d8a22f5-dee8-4661-95a0-51ac272d819e",
   "lastStep": false,
   "processName": "userManagement.RemoveUserAttribute.v1.0",
   "operationError": [
      {
         "code": "attribute-attached-notification-channel",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "Provided attribute is used as preferred notification channel",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "stepName": "RemoveUserAttributePrompt"
}
```

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `operationError` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | An error object's internal code name. |
| `type` | Internal reference of the operation error type. |
| `message` | Optional message that describes the error in a human readable format. |
| `authorities` | The list of authority roles currently granted to the user. Can be used to help supply context to authorization errors (i.e. a process requires a user to be authenticated to Storefront Gateway, however they are an "anonymous", or unauthenticated user). |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to essentially retry the failed request. |
| The user must first set a new primary contact channel before executing this Process. | |

## Error Codes

Below is a list of potential error codes that may be returned during the execution of this Process.

**Note:** See [Common Process Error Codes](c_commonProcessErrors).

| HTTP Status | Storefront Gateway Business Error Code | Description |
| - | - | - |
| `400` | `NotEmpty` | When the provided attribute name is not a valid or empty |
| `400` | `ValidAttribute` | When the provided attribute property is not a valid |
| `400` | `ValidAttribute` | When the provided path is a collection and no value was provided |
| `400` | `ValidAttribute` | When the attribute is not removable |
| `400` | `invalid-attribute-value` | When the provided attribute value is not found |
| `400` | `attribute-attached-notification-channel` | When the attribute to be removed is used as preferred notification channel |
| `400` | `last-auth-identifier` | When this is the last authentication identifier (social included) |
| `400` | `non-unique-attribute-value` | When the provided attribute value is not unique |
| `400` | `non-verified-auth-identifier` | When all authentication identifier are not verified |

**Parent topic:**[Remove User Attribute Process](c_removeUserAttribute)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.