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

# Retrieve a WorkCycleException.

> Retrieve a single WorkCycleException by its ID.




## OpenAPI

````yaml /openapi-specs/schedule.yaml get /api/v3/workcycleExceptions/{id}
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/workcycleExceptions/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        in: path
        required: true
        description: ID of the workcycleException
        schema:
          type: integer
          format: int32
          minimum: 1
    get:
      tags:
        - WorkCycleExceptions
      summary: Retrieve a WorkCycleException.
      description: |
        Retrieve a single WorkCycleException by its ID.
      operationId: get-workcycle-exception
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorkCycleException'
        '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:
    WorkCycleException:
      title: The WorkCycleException resource
      x-tags:
        - WorkCycleExceptions
      description: >
        **Represents an override to the employee's WorkCycle.**


        **A workcycle is a setup object that indicates the working hours of one
        or 

        several employees with a recurring pattern (weekly, monthly, etc...).**


        Workcycles are the basis from where employee's expected working hours
        are

        calculated. On top of it, holidays are first added,then
        workcycleExceptions.


        WorkCycleExceptions are overrides to the workcycles.

        The semantics of a workcycleException is equivalent to "exceptionally,

        this employee is going to work a different number of hours on this given

        half-day". A workcycleException may set the work duration to zero, thus 

        indicating that the employee is not expected to work on this day.


        ❗**Note**: An employee may only have a **single** 

        `WorkCycleException` on any given half-day (indicated by the `startsAt`

        date and the `isAm` boolean).


        ❗**Note 2**: When using Lucca Timesheet, submitting a timesheet actually
        "locks"

        the theoretical working hours of the employee. This means that creating
        or deleting

        workcycleExceptions on a day that belongs to a submitted timesheet will
        automatically

        unapprove said timesheet.


        A `WorkCycleException` must be defined in one "unit" (days, hours or
        time).

        This unit must be conform to the one of the intersecting WorkCycle for
        the

        employee and the date.


        Examples:


        **"User #12, managed in "days" (`unit: 0`), will finally work on the
        afternoon of the 01/01/2023"**

        ```

        {"startsAt": "2023-01-01T12:00", "isAm": false, "duration": "12:00:00",
        "unit": 0}

        ```


        **"User #13, managed in "hours" (`unit: 1`), will finally work 3h30 on
        the morning of the 01/01/2023"**

        ```

        {"startsAt": "2023-01-01T00:00:00", "isAm": true, "duration":
        "03:30:00", "unit": 1}

        ```


        **"User #14, managed in "time" unit (`unit: 2`), will finally work
        between 09:00 and 12:30 on the morning of the 01/01/2023"**

        ```

        {"startsAt": "2023-01-01T09:00:00", "isAm": true, "duration":
        "03:30:00", "unit": 2}

        ```
      type: object
      required:
        - id
        - ownerId
        - isAm
        - unit
        - startsAt
        - duration
      properties:
        id:
          type: integer
          format: int32
          minimum: 1
          description: Identifier of this WorkCycleException.
          readOnly: true
        name:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        ownerId:
          type: integer
          format: int32
          minimum: 1
          description: |
            Identifier of the employee.
        owner:
          type: object
          readOnly: true
          properties:
            id:
              type: integer
              format: int32
              minimum: 1
            name:
              type: string
              description: Full name of the employee.
            url:
              type: string
              format: uri
              description: URL to the employee representation.
            firstName:
              type: string
              description: First name of the employee.
            lastName:
              type: string
              description: Last name of the employee.
        isAm:
          type: boolean
          description: |
            A work day is divided into two half-days. 
            Indicates whether the exception overrides the
            planned working hours of the first or the second
            half-day.
            - `true`: The exception overrides the first
              half-day (i.e. "morning").
            - `false`: The exception overrides the second
              half-day (i.e. "afternoon").
        unit:
          $ref: '#/components/schemas/EventUnit'
        startsAt:
          type: string
          format: date-time
        endsAt:
          type: string
          format: date-time
          readOnly: true
        durationInMinutes:
          type: integer
          format: int32
          minimum: 0
          readOnly: true
        duration:
          type: string
          format: time
        authorId:
          type: integer
          format: int32
          minimum: 0
          description: |
            The ID of the user who created this object.
            Equal to zero when created by an API key.
          readOnly: true
        createdAt:
          type: string
          format: date-time
          description: The timestamp of the moment this object was created.
          readOnly: true
        modifierId:
          type: integer
          format: int32
          minimum: 0
          description: |
            The ID of the user who last modified this object.
            Equal to zero when created by an API key.
          readOnly: true
        modifiedAt:
          type: string
          format: date-time
          description: The timestamp of the moment this object was last modified.
          readOnly: true
        deletedById:
          type: integer
          format: int32
          minimum: 0
          description: |
            The ID of the user who deleted this object.
            Equal to zero when created by an API key.
          readOnly: true
        deletedAt:
          type: string
          format: date-time
          description: The timestamp of the moment this object was deleted.
          readOnly: true
    EventUnit:
      title: Event Unit (enum)
      x-internal: true
      x-tags:
        - Core
      type: string
      enum:
        - day
        - hour
        - time
      description: |-
        An event can be set in:
        - Day: "I worked for a half day last Monday".
        - Hour: "I worked for 2 hours last Monday".
        - Time: "I worked between 10:00 AM and 12:00 AM last Monday".
  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

````