> ## 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.

# addTimeOffRequest

> The `addTimeOffRequest` API is used to create a new time off request for manager approval

### Important:
- A user must be assigned to a time off policy, and be active in that policy (after affectiveStartDate) before they can submit a request.
- To add a user to a time off policy to make them request-eligible use the `addTimeOffPolicyAssignment` API

### Notes:
- Users can determine when their time off hours are applied in between their PTO dates using timeOffLineItems
- timeOffLineItems must fall in between the dates specified and must sum to the total requestHours
- timeOffLineItems determine which PTO hours are added to each payperiod
- when a timeOffRequest is created it is "Pending"



## OpenAPI

````yaml post /userPortal/addTimeOffRequest
openapi: 3.0.1
info:
  title: Default module
  description: ''
  version: 1.0.0
servers: []
security:
  - basic: []
tags: []
paths:
  /userPortal/addTimeOffRequest:
    post:
      tags: []
      summary: addTimeOffRequest
      description: >-
        The `addTimeOffRequest` API is used to create a new time off request for
        manager approval


        ### Important:

        - A user must be assigned to a time off policy, and be active in that
        policy (after affectiveStartDate) before they can submit a request.

        - To add a user to a time off policy to make them request-eligible use
        the `addTimeOffPolicyAssignment` API


        ### Notes:

        - Users can determine when their time off hours are applied in between
        their PTO dates using timeOffLineItems

        - timeOffLineItems must fall in between the dates specified and must sum
        to the total requestHours

        - timeOffLineItems determine which PTO hours are added to each payperiod

        - when a timeOffRequest is created it is "Pending"
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  title: addUserBankAccount
                timeOffRequest:
                  type: object
                  properties:
                    companyId:
                      type: string
                    employeeId:
                      type: string
                    timeOffPolicyId:
                      type: string
                    timeOffPolicyAssignmentId:
                      type: string
                    requestHours:
                      type: integer
                    requestStartDate:
                      type: string
                    requestEndDate:
                      type: string
                    timeOffLineItems:
                      type: object
                      properties:
                        date:
                          type: string
                        requestHours:
                          type: integer
                      required:
                        - date
                        - requestHours
                  required:
                    - companyId
                    - employeeId
                    - timeOffPolicyId
                    - timeOffPolicyAssignmentId
                    - requestHours
                    - requestStartDate
                    - requestEndDate
                    - timeOffLineItems
              required:
                - method
                - timeOffRequest
            example:
              method: addTimeOffRequest
              timeOffRequest:
                companyId: 21DA3F1A-E593-42EE-95F5-A22EDF6382F0
                employeeId: 1755E872-9092-4ECE-8386-860531D492D3
                timeOffPolicyAssignmentId: FB76A153-8358-4C2C-AD5A-60771C69EAD8
                timeOffPolicyId: 1BD5AB2B-AEEC-46CD-A93B-D1A68FB90C3A
                requestHours: 12
                requestStartDate: '2025-10-30'
                requestEndDate: '2025-11-04'
                timeOffLineItems:
                  - date: '2025-10-30'
                    requestHours: 4
                  - date: '2025-10-31'
                    requestHours: 4
                  - date: '2025-11-02'
                    requestHours: 2
                  - date: '2025-11-03'
                    requestHours: 2
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  timeOffRequest:
                    type: object
                    properties:
                      timeOffRequestId:
                        type: string
                      status:
                        type: string
                      message:
                        type: string
                    required:
                      - timeOffRequestId
                      - status
                      - message
                required:
                  - timeOffRequest
              examples:
                '1':
                  summary: Example 1
                  value:
                    timeOffRequest:
                      timeOffRequestId: 4957449B-E7D7-4848-9D40-BCEB6CEA6595
                      status: Pending
                      message: Time off request created successfully
                '2':
                  summary: Exception
                  value:
                    error:
                      code: 400
                      message: Invalid companyId
          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: requestStartDate cannot be after requestEndDate.
          headers: {}
      deprecated: false
      security:
        - basic: []
components:
  securitySchemes:
    basic:
      type: http
      scheme: basic

````