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

# deleteUser

> Deletes employee/user data for the provided companyId and userId.

### When to use:
- Whan an employee was added by mistake and is still in `Hiring and Onboarding`
- When an employee is incorrectly added as W2 or 1099-NEC and needs to be re-onboarded with the correct userType

### Notes:
- Deletion is only supported when the employee status is `Invite Sent` or `Add Wage`.
- To remove an employee who is active they must be dectivated or terminated



## OpenAPI

````yaml delete /adminPortal/deleteUser
openapi: 3.1.0
info:
  title: Default module
  description: |
    Webhook events emitted when a company's KYB status is created or changes.

    Rollfi sends these requests to the webhook URL configured for the client.
    Consumers should return a successful 2xx response after accepting the event.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Admin Portal
  - name: Pay Schedule Webhooks
  - name: Pay Period Webhooks
  - name: Employee Bank Account Webhooks
  - name: Employee KYC Webhooks
  - name: Company Bank Account Webhooks
  - name: Company Webhooks
  - name: Employee Status Webhooks
paths:
  /adminPortal/deleteUser:
    delete:
      tags:
        - Admin Portal
      summary: deleteUser
      description: >-
        Deletes employee/user data for the provided companyId and userId.


        ### When to use:

        - Whan an employee was added by mistake and is still in `Hiring and
        Onboarding`

        - When an employee is incorrectly added as W2 or 1099-NEC and needs to
        be re-onboarded with the correct userType


        ### Notes:

        - Deletion is only supported when the employee status is `Invite Sent`
        or `Add Wage`.

        - To remove an employee who is active they must be dectivated or
        terminated
      operationId: deleteUser
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                companyId:
                  type: string
                userId:
                  type: string
              required:
                - method
                - companyId
                - userId
            examples:
              deleteUserRequest:
                value:
                  method: deleteUser
                  companyId: ECF1B47E-108F-45C0-A520-6A128A727B04
                  userId: 33820169-85C2-482A-BCCF-B2281419E96E
                summary: Delete terminated/deactivated employee
        required: true
      responses:
        '200':
          description: User delete completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
              examples:
                success:
                  summary: success
                  value:
                    success: true
                    message: User deleted successfully
          headers: {}
        '400':
          description: Validation or business rule failure
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
              examples:
                missingCompanyId:
                  summary: Missing companyId
                  value:
                    error:
                      code: 400
                      message: companyId is required
                missingUserId:
                  summary: Missing userId
                  value:
                    error:
                      code: 400
                      message: userId is required
                wrongCompanyForUser:
                  summary: Employee not in company
                  value:
                    error:
                      code: 400
                      message: Employee does not belong to the specified company
                activeStatusBlocked:
                  summary: Active employee cannot be deleted
                  value:
                    error:
                      code: 400
                      message: Cannot delete user with active employee status
                invalidCompanyId:
                  summary: Invalid companyId format
                  value:
                    error:
                      code: 400
                      message: Invalid companyId.
                invalidUserId:
                  summary: Invalid userId format
                  value:
                    error:
                      code: 400
                      message: Invalid userId.
          headers: {}
      deprecated: false
      security: []

````