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

# Remove User

> Remove a user from your account. This will revoke their access and remove them from the shared user list.

## Overview

Removes a user from your account, revoking their access and removing them from the shared user list. This action cannot be undone.

## Purpose

### **User Removal**

* **Revoke Access**: Remove user access to your account
* **Clean Up**: Remove inactive or unnecessary users
* **Security**: Remove users who no longer need access
* **Account Management**: Maintain clean user lists

### **Access Control**

* **Immediate Effect**: Access is revoked immediately
* **Complete Removal**: User is removed from all account access
* **Security Measure**: Prevent unauthorized access
* **Account Cleanup**: Remove users who have left the organization

## Path Parameters

| Parameter        | Type    | Required | Description                     | Example |
| ---------------- | ------- | -------- | ------------------------------- | ------- |
| `shared-user-id` | integer | Yes      | ID of the shared user to remove | `479`   |

## Response

### **Success Response (204 No Content)**

The request succeeds and returns no content, indicating the user has been successfully removed.

### **Error Responses**

#### **User Not Found (404)**

```json theme={null}
{
  "detail": "Not found."
}
```

#### **Unauthorized (401)**

```json theme={null}
{
  "detail": "Authentication credentials were not provided."
}
```

## Examples

### **Remove User**

```bash theme={null}
curl -X DELETE "https://management.scanova.io/multi-users/479/" \
  -H "Authorization: YOUR_API_KEY"
```

### **Response (Success)**

```
HTTP/1.1 204 No Content
```

## Important Considerations

### **Before Removing a User**

* **Verify User ID**: Ensure you have the correct user ID
* **Check User Activity**: Review user's recent activity
* **Backup Data**: Ensure any important data is backed up
* **Communicate**: Inform the user if appropriate

### **After Removing a User**

* **Access Revoked**: User loses all access immediately
* **No Recovery**: User cannot be restored automatically
* **Re-invitation**: User must be re-invited to regain access
* **Data Impact**: User's QR codes remain in the account

## Integration Examples

### **JavaScript - User Removal with Confirmation**

```javascript theme={null}
async function removeUser(userId, userName) {
  // Show confirmation dialog
  const confirmed = confirm(`Are you sure you want to remove ${userName}? This action cannot be undone.`);
  
  if (!confirmed) {
    return false;
  }
  
  try {
    const response = await fetch(`https://management.scanova.io/multi-users/${userId}/`, {
      method: 'DELETE',
      headers: {
        'Authorization': 'YOUR_API_KEY'
      }
    });
    
    if (response.ok) {
      console.log('User removed successfully');
      showMessage(`User ${userName} has been removed from the account.`);
      
      // Refresh user list
      refreshUserList();
      
      return true;
    } else {
      const error = await response.json();
      throw new Error(error.detail || 'Failed to remove user');
    }
  } catch (error) {
    console.error('Error removing user:', error);
    showMessage('Error removing user: ' + error.message, 'error');
    return false;
  }
}

// Usage
removeUser(479, 'Jon Doe');
```

### **Python - User Removal with Logging**

```python theme={null}
import requests
import logging
from datetime import datetime

# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

def remove_user(user_id, user_name=None):
    url = f"https://management.scanova.io/multi-users/{user_id}/"
    headers = {"Authorization": "YOUR_API_KEY"}
    
    try:
        # Log the removal attempt
        logger.info(f"Attempting to remove user {user_id} ({user_name or 'Unknown'})")
        
        response = requests.delete(url, headers=headers)
        response.raise_for_status()
        
        # Log successful removal
        logger.info(f"User {user_id} ({user_name or 'Unknown'}) removed successfully")
        print(f"User {user_name or user_id} has been removed from the account.")
        
        return True
        
    except requests.exceptions.RequestException as e:
        # Log the error
        logger.error(f"Error removing user {user_id}: {e}")
        print(f"Error removing user: {e}")
        return False

def remove_multiple_users(user_ids):
    """Remove multiple users from a list"""
    results = []
    
    for user_id in user_ids:
        result = remove_user(user_id)
        results.append({'user_id': user_id, 'success': result})
    
    return results

# Usage
# Remove single user
remove_user(479, 'Jon Doe')

# Remove multiple users
user_ids_to_remove = [479, 480, 481]
results = remove_multiple_users(user_ids_to_remove)
```

### **PHP - User Removal with Confirmation**

```php theme={null}
<?php
function removeUser($userId, $userName = null) {
    $url = "https://management.scanova.io/multi-users/{$userId}/";
    $headers = [
        "Authorization: YOUR_API_KEY"
    ];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode === 204) {
        echo "User " . ($userName ?: $userId) . " has been removed from the account.<br>";
        return true;
    } else {
        echo "Error removing user: " . $response;
        return false;
    }
}

// Handle form submission
if ($_POST['submit'] && $_POST['confirm'] === 'yes') {
    $userId = $_POST['user_id'];
    $userName = $_POST['user_name'];
    
    $result = removeUser($userId, $userName);
} else if ($_POST['submit'] && $_POST['confirm'] !== 'yes') {
    echo "User removal cancelled.<br>";
}

// HTML Form
?>
<form method="POST">
    <label>User ID: <input type="number" name="user_id" required></label><br>
    <label>User Name: <input type="text" name="user_name"></label><br>
    <label>
        <input type="checkbox" name="confirm" value="yes" required>
        I confirm that I want to remove this user. This action cannot be undone.
    </label><br>
    <input type="submit" name="submit" value="Remove User">
</form>
```

## Use Cases

### **User Management**

* **Remove Inactive Users**: Clean up users who no longer need access
* **Security Cleanup**: Remove users who have left the organization
* **Access Control**: Revoke access for security reasons
* **Account Maintenance**: Keep user lists clean and current

### **Administrative Tasks**

* **User Lifecycle**: Handle user departure from organization
* **Access Auditing**: Remove users during access audits
* **Security Incidents**: Remove users during security incidents
* **Account Cleanup**: Regular cleanup of user accounts

### **API Integration**

* **Automated Cleanup**: Automatically remove inactive users
* **User Synchronization**: Sync user removal with external systems
* **Access Management**: Integrate with access management systems
* **User Lifecycle**: Handle user lifecycle events

## Best Practices

### **Before Removal**

* **Verify Identity**: Ensure you're removing the correct user
* **Check Dependencies**: Verify no critical dependencies exist
* **Communicate**: Inform the user if appropriate
* **Document**: Keep records of user removals

### **After Removal**

* **Verify Removal**: Confirm user has been removed
* **Update Systems**: Update any external systems
* **Monitor Access**: Monitor for any access attempts
* **Document**: Record the removal for audit purposes

### **Security Considerations**

* **Immediate Effect**: Access is revoked immediately
* **No Recovery**: User cannot be restored automatically
* **Re-invitation**: User must be re-invited to regain access
* **Audit Trail**: Keep records of all removals

<Note>
  Removing a user is a permanent action that cannot be undone. The user will lose all access to your account immediately and must be re-invited to regain access.
</Note>

<Warning>
  Be very careful when removing users, especially Admin users, as this action cannot be undone. Make sure you have the correct user ID and that the removal is necessary.
</Warning>

<Info>
  The user's QR codes and other data will remain in your account after removal. Only the user's access is revoked.
</Info>


## OpenAPI

````yaml DELETE /multi-users/{shared-user-id}/
openapi: 3.0.0
info:
  title: Scanova API - User Management
  description: >-
    User management endpoints for managing shared users, roles, and permissions
    in your Scanova account. These endpoints allow you to invite users, assign
    roles, and manage access levels.
  version: 1.0.0
servers:
  - url: https://management.scanova.io
    description: Scanova Management API Server
security:
  - apiKeyAuth: []
paths:
  /multi-users/{shared-user-id}/:
    delete:
      tags:
        - User Management
      summary: Remove User
      description: >-
        Remove a user from your account. This will revoke their access and
        remove them from the shared user list.
      parameters:
        - name: shared-user-id
          in: path
          required: true
          description: ID of the shared user to remove
          schema:
            type: integer
          example: 479
      responses:
        '204':
          description: User removed successfully
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    AuthenticationErrorResponse:
      type: object
      properties:
        detail:
          type: string
          example: Authentication credentials were not provided.
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          example: Not found.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Enter your API key directly in the Authorization
        header.

````