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

# addFormerUser

> The `addFormerUser` API adds a terminated user to the system.

### Use when:
- `formerPaidThisYear` = true during onboarding
- You have an employee that has been paid this year but is no longer at the company at the point of onboarding

### Notes:
- used to maintain compliance for payroll and to calculate accurate employer taxes




## OpenAPI

````yaml post /adminPortal#addFormerUser
openapi: 3.0.1
info:
  title: Default module
  description: ''
  version: 1.0.0
servers: []
security:
  - basic: []
tags: []
paths:
  /adminPortal#addFormerUser:
    post:
      tags: []
      summary: addFormerUser
      description: >
        The `addFormerUser` API adds a terminated user to the system.


        ### Use when:

        - `formerPaidThisYear` = true during onboarding

        - You have an employee that has been paid this year but is no longer at
        the company at the point of onboarding


        ### Notes:

        - used to maintain compliance for payroll and to calculate accurate
        employer taxes
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  title: addUser
                user:
                  type: object
                  properties:
                    companyId:
                      type: string
                    firstName:
                      type: string
                    middleName:
                      type: string
                    lastName:
                      type: string
                    email:
                      type: string
                    phoneNumber:
                      type: string
                      title: Must be 10 digits
                    dateOfJoin:
                      type: string
                    workerType:
                      type: string
                      title: Enum
                    jobTitle:
                      type: string
                    companyLocationCategory:
                      type: string
                    stateCode:
                      type: string
                    companyLocationId:
                      type: string
                      title: Need to be added when CompanyLocationCategory is Office
                  required:
                    - companyId
                    - firstName
                    - lastName
                    - email
                    - phoneNumber
                    - dateOfJoin
                    - workerType
                    - jobTitle
                    - companyLocationCategory
              required:
                - method
                - user
            example:
              method: addUser
              user:
                companyId: 33A04AFB-4317-464A-B1E0-BAB610086174
                firstName: Marcus
                middleName: Austin
                lastName: Steve
                email: mar@sto.com
                phoneNumber: '9889890989'
                dateOfJoin: '2000-01-01'
                workerType: W2
                jobTitle: Manager
                companyLocationCategory: Remote
                stateCode: FL
                companyLocationId: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      userId:
                        type: string
                      status:
                        type: string
                      message:
                        type: string
                    required:
                      - userId
                      - status
                    x--orders:
                      - EmployeeID
                      - Status
                      - Message
                required:
                  - user
                x--orders:
                  - Employee
              examples:
                '1':
                  summary: Success
                  value:
                    user:
                      userId: E7B3731C-20F4-4432-A3BE-DDD83D877EAD
                      status: KYC Pending
                      message: >-
                        Marcus Steve has been successfully added as Employee in
                        Test Ltd.
                '2':
                  summary: Exception
                  value:
                    error:
                      code: 400
                      message: First Name is mandatory and cannot be empty.
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
              example:
                error:
                  code: 400
                  message: Invalid company ID. Company does not exist.
          headers: {}
      deprecated: false
      security:
        - basic: []
components:
  securitySchemes:
    basic:
      type: http
      scheme: basic

````