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

# List UserDates.

> Retrieve a list of UserDates.

### Performance
In order to keep satisfactory response times and performance, please filter the request on a limited set of OwnerId[] and reduce the period  `date=between,{start},{end}`.

As a rule of thumb, do not request for more than ~10 owners over a whole month.

### Format
The `date` query parameter should match the form `?date=between,{start},{includedEnd}`.



## OpenAPI

````yaml /openapi-specs/schedule.yaml get /api/v3/userdates
openapi: 3.1.0
info:
  title: Time Settings API
  version: '1.0'
  description: |
    Welcome on the documentation for the Time Settings API.
  contact:
    name: API Support
    url: https://support.lucca.fr
    email: contact@luccasoftware.com
  license:
    name: Unlicensed
    url: https://www.luccasoftware.com
servers:
  - url: https://{host}
    description: Your Lucca account URL.
    variables:
      host:
        default: example.ilucca.net
        description: >-
          The URL of your dedicated Lucca account: `{account}.{env}.{region}`.


          Account reflects your company name. Env indicates the environment.
          Region depends on your server location.


          **Please, use your test or sandbox environments (and not your
          production env.) for testing purposes.**


          Environments:

          - `ilucca`: production environment for customers.

          - `ilucca-test`: test environment for customers.

          - `ilucca-demo`: demo environment for prospects.


          Regions:

          - `.ch` for Swiss located accounts.

          - `.net` for the others.


          Regarding sandboxes, the pattern differs:
          `https://{account}-{sandboxName}.sandbox.{server}.luccasoftware.com`,
          where:

          - `{sandboxName}` is automatically generated upon creation.

          - `{server}` may be "eu1", "eu2" or "ch1".
security: []
tags:
  - name: UserDates
    description: Aggregates work schedule events.
  - name: WorkCycleExceptions
    description: Override an employee's theoretical working hours.
  - name: Working Time Arrangements
    description: Employees recurring working hours.
  - name: Collective Schedules
    description: Describes the working hours pattern of a working-time-arrangement.
  - name: employee-assignments
    description: Assignations of employees to working time arrangements.
paths:
  /api/v3/userdates:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    get:
      tags:
        - UserDates
      summary: List UserDates.
      description: >-
        Retrieve a list of UserDates.


        ### Performance

        In order to keep satisfactory response times and performance, please
        filter the request on a limited set of OwnerId[] and reduce the period 
        `date=between,{start},{end}`.


        As a rule of thumb, do not request for more than ~10 owners over a whole
        month.


        ### Format

        The `date` query parameter should match the form
        `?date=between,{start},{includedEnd}`.
      operationId: get-api-v3-userdates
      parameters:
        - name: ownerId
          in: query
          description: User's identifiers.
          required: true
          schema:
            type: array
            items:
              type: integer
              minimum: 1
        - name: date
          in: query
          description: >-
            The period over which working hours should be returned for given
            Users. Format: 'between,{start},{includedEnd}'.
          required: true
          schema:
            type: string
            example: between,2021-01-01,2021-02-01
        - name: fields
          in: query
          description: |
            List of all fields to be returned by the server.
            Example: `?fields=ownerId,date,dtt,drt,draj,
            items[startsAt,duration,type,timeline`
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/UserDate'
        '400':
          $ref: '#/components/responses/ResponseProblem'
        '401':
          $ref: '#/components/responses/ResponseProblem'
        '404':
          $ref: '#/components/responses/ResponseProblem'
        '500':
          $ref: '#/components/responses/ResponseProblem'
components:
  parameters:
    Authorization:
      name: Authorization
      required: true
      description: 'API key. Value must be formatted like so: `lucca application={api_key}`.'
      in: header
      schema:
        type: string
  schemas:
    UserDate:
      title: The UserDate resource
      x-tags:
        - UserDates
      description: >
        Userdates are a resource that aggregate all events related

        to the working schedule of an employee. There are two types 

        of events: (1) those related to the theoretical working hours

        of the employee (workcycle, holidays, workcycleExceptions) and (2)

        those related to the actual working hours of the employee (leaves,

        time-entries).


        A Userdate aggregates:

        - theoretical hours indicated by the employee's workcycle.

        - overrides to the workcycle indicated by the holidays calendar
          given to the employee.
        - overrides to the workcycle indicated by workcycleExceptions.

        - actual hours from Lucca Timesheet.

        - leaves taken in Lucca Absences.


        #### About durations

        The interpretation of durations depends on the time unit applicable to
        the User.


        For instance, '12:00:00' means:
          - A half-day (or 0.5 d) in `days` unit.
          - 12 hours in `hours` or `time` units.
          
        The applicable unit is set on the User's WorkCycle.
      allOf:
        - $ref: '#/components/schemas/IUserDate'
        - type: object
          properties:
            am:
              $ref: '#/components/schemas/IUserDate'
              description: Description of the first half of the day.
            pm:
              $ref: '#/components/schemas/IUserDate'
              description: Description of the second half of this day.
    IUserDate:
      title: IUserDate
      type: object
      properties:
        source:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 5
            - 6
          description: |-
            - 1: WorkCycle
            - 2: Public Holidays
            - 3: WorkCycle Exception
            - 5: Leave (from Lucca Absences)
            - 6: Entry (from Lucca Timesheet)
        dtt:
          type: string
          format: time
          example: '07:00:00'
          description: >-
            Theoretical working time. The work duration the User should comply
            with on this day. It is the result of the workcycle, minus the
            potential public holidays, delta potential workcycle exception
            overrides.
        drt:
          type: string
          format: time
          example: '04:15:00'
          description: >-
            Actual working time. The actual time the User spent working on this
            day. Results from the time-entries entered in Lucca Timesheet. If no
            time-entry has been entered, then defaults to the DTT value.
        draj:
          type: string
          format: time
          example: '03:30:00'
          description: Leave duration.
        isHoliday:
          type: boolean
          description: Is this day a holiday in the User's holidays calendar?
        isWeeklyRest:
          type: boolean
          description: >-
            Is this the weekly rest day (most often, Sundays) in the User's
            workcycle?
        items:
          type: array
          description: All events for this day and User.
          items:
            $ref: '#/components/schemas/UserDateItem'
    UserDateItem:
      title: UserDateItem
      type: object
      properties:
        type:
          type: string
          enum:
            - ptt
            - prt
            - praj
          description: >-
            Type of event:

            - `ptt`: Theoretical working hours, eg "What the User should be
            working".

            - `prt`: Actual working hours, eg "What the User actually did". If
            nothing was entered in Lucca Timesheet nor Lucca Absences, then ptt
            are duplicated as prt.

            - `praj`: Leave of absences.
        startsAt:
          type: string
          format: date-time
          description: Start of the event.
        duration:
          type: string
          format: time
          description: Duration of the event.
        timeline:
          type: string
          enum:
            - WorkCycle
            - PublicHoliday
            - Exception
            - Leave
            - Entry
          description: The source from which this event was pushed.
  responses:
    ResponseProblem:
      description: Problem
      content:
        application/json:
          schema:
            type: object
            properties:
              Status:
                type: integer
                description: HTTP status code.
                example: 401
              Message:
                type: string
                description: Human readable error message.
                example: Unauthorized

````