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

# Get a leave by id

> Retrieve a single Leave by its unique identifier.



## OpenAPI

````yaml /openapi-specs/timmi-absences-v3.yaml get /api/v3/leaves/{id}
openapi: 3.1.0
info:
  title: Lucca Absences API
  version: '1.0'
  description: Welcome on the documentation for Lucca Absences 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: Leaves
    description: Absences taken on a given day
  - name: Leave Requests
    description: Workflow object for submiting an absence.
  - name: Imports
    description: Absences imports
  - name: SickLeaveCertificates
    description: >-
      Complementary data for certain leave types in order to comply with French
      law.
paths:
  /api/v3/leaves/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Identifier of the leave.
    get:
      tags:
        - Leaves
      summary: Get a leave by id
      description: Retrieve a single Leave by its unique identifier.
      operationId: get-leaves-leaveId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Leave'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
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:
    Leave:
      title: The Leave resource
      type: object
      examples: []
      x-tags:
        - Leaves
      properties:
        id:
          type: string
          description: Unique identifier for the Leave
        date:
          type: string
          format: date
          description: Date of the leave in ISO format `yyyy-mm-dd`
        isAm:
          type: boolean
          description: Has the value `true` for morning or the value `false` for afternoon
        leaveAccountId:
          type: integer
          description: Unique identifier for the attached LeaveAccount
        leaveAccount:
          $ref: '#/components/schemas/LeaveAccount'
        leavePeriodId:
          type: integer
          description: Unique identifier for the attached LeavePeriod
        leavePeriod:
          $ref: '#/components/schemas/LeavePeriod'
        value:
          type:
            - string
            - 'null'
          format: duration
          description: Leave duration in hours
        creationDate:
          type: string
          format: date-time
          description: Time at which the object was created
        isActive:
          type: boolean
          description: >
            Has the value `true` when the Leave exists (for pending or confirmed
            LeavePeriods), or the value `false` when it has been deleted (for
            canceled or denied LeaveRequests).
        cancellationDate:
          type:
            - 'null'
            - string
          format: date-time
          description: Time at which the request was canceled
        cancellationUserId:
          type:
            - 'null'
            - integer
          default: null
          description: 'Unique identifier for the user who canceled the request '
        comment:
          type: string
          description: Comments
      required:
        - id
        - date
        - isAm
        - leaveAccountId
        - leavePeriodId
    LeaveAccount:
      title: The LeaveAccount resource
      x-tags:
        - Leaves
      type: object
      description: >-
        **LeaveAccounts** are the type of absences that can be selected by the
        user



        ## Fields
      examples: []
      properties:
        id:
          type: integer
          description: Unique identifier for the LeaveAccount
        name:
          type: string
          description: Name of the LeaveAccount
    LeavePeriod:
      title: The LeavePeriod resource
      type: object
      examples: []
      x-tags:
        - Leave Requests
      properties:
        id:
          type: number
          description: Unique identifier for the LeavePeriod
        ownerId:
          type: number
          description: 'Unique identifier for the user '
        isConfirmed:
          type: boolean
          description: >-
            Has the value `true` for approved LeavePeriod or the value `false`
            for LeavePeriod pending approval
        confirmationDate:
          type:
            - 'null'
            - string
          format: date-time
          description: Time at which the LeavePeriod was approved
        attachmentId:
          type:
            - 'null'
            - string
          description: Unique identifier for the attached document
        leaves:
          type: array
          items:
            type: object
            description: Leave objects
        logs:
          type: array
          items:
            $ref: '#/components/schemas/LeavePeriodLog'
    LeavePeriodLog:
      title: The LeavePeriodLog resource
      type: object
      description: '## Fields'
      properties:
        id:
          type: integer
        date:
          type: string
          format: date-time
        comment:
          type: string
        status:
          type: number
          enum:
            - 0
            - 2
            - 3
            - 4
            - 5
          description: |
            - 0 = PENDING_APPROVAL
            - 2 = APPROVED
            - 3 = DENIED
            - 4 = CANCELLED
            - 5 = CANCELLATION_PENDING

````