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

# addTimeTrackingPolicyAssignments

> The `addTimeTrackingPolicyAssignments` API adds a batch of employees to an active time tracking policy for a company

### What it does:
- Creates an assignment record for each employee assigned to time tracking
- Generates a timecard for each employee in their respective open pay period (for both W2 and 1099 users)

### Note:
- Employees must have an active policy assignment to participate in time tracking
- Employees cannot be already assigned to the timeTracking Policy
- Only Active employees can be added to the company's policy. Employees may be added before their **dateOfJoin** but will be ineligble to insert entries or clock in until the date lapses




## OpenAPI

````yaml post /adminPortal/addTimeTrackingPolicyAssignments
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: TimeOff Admin
  - name: TimeTracking Admin
  - name: TimeOff User
  - name: TimeTracking User
  - name: TimeTracking Reports
  - name: TimeOff Reports
  - 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/addTimeTrackingPolicyAssignments:
    post:
      tags:
        - TimeTracking Admin
      summary: addTimeTrackingPolicyAssignments
      description: >
        The `addTimeTrackingPolicyAssignments` API adds a batch of employees to
        an active time tracking policy for a company


        ### What it does:

        - Creates an assignment record for each employee assigned to time
        tracking

        - Generates a timecard for each employee in their respective open pay
        period (for both W2 and 1099 users)


        ### Note:

        - Employees must have an active policy assignment to participate in time
        tracking

        - Employees cannot be already assigned to the timeTracking Policy

        - Only Active employees can be added to the company's policy. Employees
        may be added before their **dateOfJoin** but will be ineligble to insert
        entries or clock in until the date lapses
      operationId: addTimeTrackingPolicyAssignments
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                companyId:
                  type: string
                timeTrackingPolicyId:
                  type: string
                userIds:
                  type: array
                  items:
                    type: string
              required:
                - method
                - companyId
                - timeTrackingPolicyId
                - userIds
            example:
              method: addTimeTrackingPolicyAssignments
              companyId: 5221FFCF-E84B-4690-B7DC-DE29D549096B
              timeTrackingPolicyId: 45C67A2B-4D64-47D2-B473-B7B5FD1CB80E
              userIds:
                - C4CA148F-F2C6-4E70-8349-57CC6DFC1C2B
      responses:
        '200':
          description: Assignments updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  assignments:
                    type: array
                    items:
                      type: object
                      properties:
                        userId:
                          type: string
                        success:
                          type: boolean
                        message:
                          type: string
                required:
                  - assignments
              example:
                assignments:
                  - userId: C4CA148F-F2C6-4E70-8349-57CC6DFC1C2B
                    success: true
                    message: Employee assigned successfully.
          headers: {}
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
              example:
                assignments:
                  - userId: C4CA148F-F2C6-4E70-8349-57CC6DFC1C2B
                    success: false
                    error:
                      code: 400
                      message: Employee already has an active assignment.
          headers: {}
      deprecated: false
      security: []

````