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

# List all shifts

> The endpoint returns ongoing and completed work shifts. It includes time entries (clock in/clock out), the type of work, and earnings.



## OpenAPI

````yaml GET /v1/links/{link_id}/shifts/
openapi: 3.0.1
info:
  title: Truv API
  description: Truv API Documentation
  termsOfService: https://www.truv.com/legal/terms-of-use
  contact:
    email: support@truv.com
  version: v1
servers:
  - url: https://prod.truv.com
security:
  - ClientID: []
    AccessKey: []
tags:
  - name: Users
  - name: Bridge Token
  - name: Companies and Data Providers
  - name: Key Management
  - name: Account Links
  - name: Data Refresh
  - name: Customization Templates
  - name: Webhooks
  - name: Orders
  - name: Tasks
  - name: VOIE Reports
  - name: VOA Reports
  - name: Income Insights Reports
  - name: DDS Reports
  - name: Employment
  - name: Identity
  - name: Shifts
  - name: Pay Statements
  - name: Tax Documents
  - name: Parsed Documents
  - name: Reports
  - name: Uploaded Documents
  - name: Bank Accounts
  - name: Bank Statements
  - name: Deposit Switch Reports
  - name: Insurance Reports
  - name: Income Report
  - name: Scoring Attributes
  - name: Accounts
  - name: Transactions
  - name: Recurring Transactions
  - name: Document Collections
paths:
  /v1/links/{link_id}/shifts/:
    parameters:
      - name: link_id
        in: path
        description: Link ID
        required: true
        schema:
          type: string
        example: 24d7e80942ce4ad58a93f70ce4115f5c
    get:
      tags:
        - Shifts
      summary: List all shifts
      description: >-
        The endpoint returns ongoing and completed work shifts. It includes time
        entries (clock in/clock out), the type of work, and earnings.
      operationId: link-shifts
      parameters:
        - name: start_date_from
          in: query
          description: Filter `start_date` greater than or equal (ISO-8601)
          required: false
          schema:
            type: string
            example: '2022-06-01T00:00:00.000Z'
        - name: start_date_to
          in: query
          description: Filter `start_date` less than or equal (ISO-8601)
          required: false
          schema:
            type: string
            example: '2022-06-01T00:00:00.000Z'
        - name: page
          in: query
          description: Page number from the shift list
          required: false
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShiftsListResponse'
        '401':
          description: HTTP 401 Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: HTTP 403 Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
components:
  schemas:
    ShiftsListResponse:
      required:
        - count
        - next
        - previous
        - results
      type: object
      properties:
        count:
          description: Number of the results in total
          type: integer
          example: 100
        next:
          description: Link to the next page
          type: string
          nullable: true
          example: https://prod.truv.com/v1/link/0000000000/shifts?page=1
        previous:
          description: Link to the previous page
          type: string
          nullable: true
          example: https://prod.truv.com/v1/link/0000000000/shifts?page=1
        results:
          description: List of the Shifts
          type: array
          items:
            $ref: '#/components/schemas/Shift'
      description: Shift List
    Error401:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: authentication_failed
            message:
              description: ''
              type: string
              example: No such token
    Error403:
      description: ''
      type: object
      properties:
        error:
          description: ''
          type: object
          properties:
            code:
              description: ''
              type: string
              example: not_authenticated
            message:
              description: ''
              type: string
              example: Authentication credentials were not provided.
    Shift:
      required:
        - external_id
        - start_date
        - end_date
        - time_entries
        - type
      type: object
      properties:
        id:
          description: Shift ID
          type: string
          example: 48427a36d43c4d5aa6324bc06c692456
        external_id:
          description: Shift External ID
          type: string
          example: 48427a36d43c4d5aa6324bc06c692456
        created_at:
          description: Shift creation timestamp (ISO 8601)
          type: string
          example: '2022-06-07T15:00:00Z'
        updated_at:
          description: Shift update timestamp (ISO 8601)
          type: string
          example: '2022-06-07T15:00:00Z'
        start_date:
          description: Start date of the Shift. ISO 8601 format.
          type: string
          example: '2022-06-07'
        end_date:
          description: End date of the Shift. ISO 8601 format.
          type: string
          example: '2022-06-07'
        time_entries:
          description: List of TimeEntries related to the Shift
          type: array
          items:
            $ref: '#/components/schemas/TimeEntry'
        earnings:
          description: Aggregated earnings for the Shift
          type: array
          items:
            type: object
            properties:
              name:
                description: Name of earnings
                type: string
                example: Regular
              amount:
                description: Amount of earnings
                type: string
                format: decimal
                example: '1935.77'
              category:
                description: Category of earnings
                type: string
                enum:
                  - regular
                  - overtime
                  - bonus
                  - commission
                  - other_pay
                example: regular
              rate:
                description: Rate of earnings
                type: string
                format: decimal
              units:
                description: Units of earnings
                type: string
                format: decimal
            required:
              - name
              - amount
              - category
          example:
            - name: Regular
              amount: '1935.77'
              category: regular
              rate: null
              units: null
            - name: Overtime
              amount: '60.58'
              category: overtime
              rate: '30.29'
              units: '2'
        type:
          description: Type of the shift
          type: string
          enum:
            - other
            - delivery
            - rideshare
            - shift
          example: shift
      title: Shift
      description: Shift represents a period of time when person was planned to work
    TimeEntry:
      required:
        - external_id
        - entry_date
        - start
        - end
      type: object
      properties:
        id:
          description: TimeEntry ID
          type: string
          example: 48427a36d43c4d5aa6324bc06c692456
        external_id:
          description: TimeEntry External ID
          type: string
          example: 48427a36d43c4d5aa6324bc06c692456
        created_at:
          description: TimeEntry creation timestamp (ISO 8601)
          type: string
          example: '2022-06-07T15:00:00Z'
        updated_at:
          description: TimeEntry update timestamp (ISO 8601)
          type: string
          example: '2022-06-07T15:00:00Z'
        entry_date:
          description: Entry date of the event in the time tracking system.
          type: string
          example: '2022-06-07'
        start:
          description: Datetime when the work started (ISO 8601)
          type: string
          example: '2022-06-07T15:00:00Z'
        end:
          description: Datetime when the work ended (ISO 8601)
          type: string
          example: '2022-06-07T16:00:00Z'
      title: TimeEntry
      description: TimeEntry represents a period of time when a person worked
  securitySchemes:
    ClientID:
      type: apiKey
      description: Client ID
      name: X-Access-Client-Id
      in: header
    AccessKey:
      type: apiKey
      description: Client Access Key
      name: X-Access-Secret
      in: header

````