> ## 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 training-demands

> Retrieve a paginated list of training-demands that satisfy the query filters.

The training-demand represents a training request for a given employee. It may be emitted from the employee or from management. 

It is subject to a prioritization process, during which management gives it a priority level (high, medium, low) in regards to its conformance to business goals, compliance with safety rules, 
cost, etc... 

Then HR admins analyze the training request and depending on the training managment policy and the budget accept or refuse the request. Accepting the request means adding the request to a training plan which contains training sessions. 

Registering an employee on a training-session is represented through setting the relationship between the training-demand and a training-session (c.f. `session` and `registeredOn` properties).

Once the training session is complete and the HR admins have confirmed the employee's attendance, then a realized-training resource appears in the corresponding endpoint.




## OpenAPI

````yaml /openapi-specs/poplee-training.yaml get /talent-training/api/v2/training-demands
openapi: 3.1.0
info:
  title: Lucca Training
  version: '1.0'
  description: |
    Welcome on the documentation for the Lucca Training 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: Trainings
    description: Trainings in catalog
  - name: Training-demands
    description: Requests for a training session for an employee.
  - name: Realized-trainings
    description: Past realized training sessions.
paths:
  /talent-training/api/v2/training-demands:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    get:
      tags:
        - Training-demands
      summary: List training-demands
      description: >
        Retrieve a paginated list of training-demands that satisfy the query
        filters.


        The training-demand represents a training request for a given employee.
        It may be emitted from the employee or from management. 


        It is subject to a prioritization process, during which management gives
        it a priority level (high, medium, low) in regards to its conformance to
        business goals, compliance with safety rules, 

        cost, etc... 


        Then HR admins analyze the training request and depending on the
        training managment policy and the budget accept or refuse the request.
        Accepting the request means adding the request to a training plan which
        contains training sessions. 


        Registering an employee on a training-session is represented through
        setting the relationship between the training-demand and a
        training-session (c.f. `session` and `registeredOn` properties).


        Once the training session is complete and the HR admins have confirmed
        the employee's attendance, then a realized-training resource appears in
        the corresponding endpoint.
      operationId: list-training-demands
      parameters:
        - name: ownerId
          description: |
            Identifier of the employee that should attend 
            this training session.
          in: query
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: sessionId
          in: query
          description: Identifier of the training session
          schema:
            type: integer
            format: int32
            minimum: 1
        - name: states
          description: Only retrieve training-demands at one of the given states.
          in: query
          style: form
          explode: false
          schema:
            type: array
            minItems: 1
            maxItems: 4
            uniqueItems: true
            items:
              $ref: '#/components/schemas/TrainingDemandState'
        - name: trainingId
          in: query
          description: Identifier of the training.
          schema:
            type: integer
            format: int32
        - name: hasSession
          in: query
          description: |
            A session is planned for this training. 
            Omit this parameter in order to retrieve 
            all training demands, whether a session 
            is planned or not.
          schema:
            type: boolean
        - name: ownerDepartmentId
          in: query
          description: >-
            Only retrieve training-demands for employeesthat currently belong to
            one of the liste of departments IDs.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
              format: int32
              minimum: 0
        - name: ownerEstablishmentId
          in: query
          description: >-
            Only retrieve training-demands for employeesthat currently have a
            work-contract with one of the listed establishment IDs.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
              format: int32
              minimum: 0
        - name: priorizationLevel
          in: query
          description: >-
            Only retrieve training-demands that were given one of the listed
            priority levels.
          schema:
            type: array
            minItems: 1
            maxItems: 5
            items:
              type: integer
              format: int32
              minimum: 0
              maximum: 4
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/fields.root'
        - name: sort
          in: query
          description: >
            Sort items by one of their property.

            Syntax is:

            ```

            <sort>                  ::= '-|+'? <property> ( ',' <property> )*

            <property>              ::= <strictString> ( '.' <strictString> )*

            <strictString>          ::= ( <char> | <digit> | '_' | '-'
            )+            

            ```
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              enum:
                - prioritization.level
                - '-prioritization.level'
                - createdAt
                - '-createdAt'
            example:
              - '-prioritization.level'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/v2.Collection'
                  - type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/TrainingDemand'
              examples:
                training-demands:
                  summary: List of training-demands
                  value:
                    items:
                      - id: 410
                        training:
                          id: 15
                          title: Angular (advanced)
                          level: Middle
                        provider:
                          id: 9
                          name: Google
                          url: https://google.com
                        author:
                          id: 416
                          firstName: John
                          lastName: Doe
                          type: Owner
                        owner:
                          id: 416
                          firstName: John
                          lastName: Doe
                          establishmentId: 1
                          departmentId: 12
                          picture:
                            id: a41832b8-9734-493c-9185-b5ccf50ec42b
                            href: >-
                              https://example.ilucca.net/getFile.ashx?id=a41832b8-9734-493c-9185-b5ccf50ec42b
                          manager:
                            id: 521
                            firstName: Matt
                            lastName: Bawss
                        plan:
                          id: 2
                          name: 2024 Plan
                          startOn: '2024-01-01'
                        createdAt: '2023-01-01T09:34:43.6529455+00:00'
                        session:
                          id: 169
                          durationInHours: 21
                          location:
                            isOnSite: false
                            isRemote: false
                            address: ''
                        prioritization:
                          id: 2
                          name: High
                          level: High
                          lastModifiedAt: '2023-04-19T08:17:29.4241633+00:00'
                        state: Requested
                        status: PendingRegistration
                    count: 234
                    prev: ~SGlnaA|LYJ77Z9Zqz|q6
                    next: '!SGlnaA|A1kVrwDKrz|th'
        '400':
          $ref: '#/components/responses/Problem'
        '401':
          $ref: '#/components/responses/Problem'
        '500':
          $ref: '#/components/responses/Problem'
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
    limit:
      name: limit
      in: query
      description: |
        Pagination: number of items per page.
      schema:
        type: integer
        minimum: 0
        maximum: 100
        default: 20
    page:
      name: page
      in: query
      description: |
        Page to retrieve. Either the page index <int>
        or the page cursor <string>.
      schema:
        oneOf:
          - type: integer
            format: int32
            minimum: 0
          - type: string
    fields.root:
      name: fields.root
      in: query
      description: >
        Include the total number of items across all pages, as well as pointers
        to the previous and next pages.
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
          enum:
            - prev
            - next
            - count
  schemas:
    TrainingDemandState:
      title: TrainingDemandState
      type: string
      description: >
        State the training-demand is in.

        - `Invalid`: Training-demand is invalid.

        - `Requested`: Training-demand was made, is valid and registration
        pending.

        - `Registered`: Employee was registered on a training-session for this
        training.

        - `Realized`: Employee attended the training-session he was registered
        on.
      x-enumDescriptions:
        Invalid: Request is invalid.
        Requested: Request made, registration pending.
        Registered: Employee was registered on this training.
        Realized: Employee attended the training.
      enum:
        - Invalid
        - Requested
        - Registered
        - Realized
    v2.Collection:
      type: object
      properties:
        count:
          description: >
            Total number of items across all pages. You need to include
            ?fields.root=count to your request to retrieve this.
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        prev:
          description: |
            Cursor to the previous page. You need to include
            ?fields.root=prev in order to retrieve this.
          type:
            - string
            - 'null'
        next:
          description: |
            Cursor to the next page. You need to include
            ?fields.root=next in order to retrieve this.
          type:
            - string
            - 'null'
    TrainingDemand:
      title: The training-demand resource
      description: >-
        The training-demand represents a training request for a given employee. 

        It may be emitted from the employee or from management. 


        It is subject to a prioritization process, during which management gives
        it a priority level (high, medium, low) in regards to its conformance to
        business goals, compliance with safety rules, 

        cost, etc... 


        Then HR admins analyze the training request and depending on the
        training managment policy and the budget accept or refuse the request.
        Accepting the request means adding the request to a training plan which
        contains training sessions. 


        The training-demand resource represents afdterward also the registration
        to a training session.

        When the training session is completed and the attendance has been
        entered by HR admins. The completed training is represented by the
        realized-training resource.
      x-tags:
        - Training-demands
      type: object
      examples:
        - id: 0
          reason: >-
            Following my new missions, I have to hold more and more meetings in
            English. So I need to improve.
          training:
            id: 20
            title: Intensive English courses
            level: Middle
          trainingProposalId: 0
          provider:
            id: 0
            name: Berlitz
            url: https://www.berlitz.com
          owner:
            id: 1
            firstName: Valentin
            lastName: Bresnier
            picture:
              id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
              href: http://example.com
            establishmentId: 1
            departmentId: 1
            manager:
              id: 2
              firstName: Marie
              lastName: Bragoulet
              picture:
                id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
                href: http://example.com
          plan:
            id: 1
            name: string
            startOn: '2019-08-24'
          prioritization:
            id: 0
            name: string
            level: Invalid
            lastModifiedAt: '2019-08-24T14:15:22Z'
          state: Invalid
          status: Invalid
          registeredOn: '2019-08-24'
          session:
            id: 0
            startOn: '2019-08-24'
            endOn: '2019-08-24'
            durationInHours: 0
            location:
              isOnSite: true
              isRemote: true
              address: string
              remoteUrl: http://example.com
          author:
            id: 1
            firstName: string
            lastName: string
            picture:
              id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
              href: http://example.com
            type: Invalid
          createdAt: '2019-08-24T14:15:22Z'
      properties:
        id:
          type: integer
          format: int32
          readOnly: true
        reason:
          description: The reason why this training-demand is needed.
          type:
            - string
            - 'null'
          minLength: 1
        training:
          title: training
          description: |
            Reference to the training course this employee needs 
            to attend.
          type: object
          required:
            - id
            - title
            - level
          properties:
            id:
              type: integer
              format: int32
              minimum: 0
              description: reference to the training the employee would like to attend
            title:
              type: string
              minLength: 0
              description: training course title
              readOnly: true
            level:
              description: 'Expertise level of this training: beginner, middle or expert'
              type: string
              enum:
                - Invalid
                - Beginner
                - Middle
                - Expert
        provider:
          description: |
            Company that provides this training course.
          type: object
          properties:
            id:
              type: integer
              format: int32
              minimum: 0
              description: reference to the provider of the training course
            name:
              type: string
              description: Name of the company that provided the training session.
            url:
              type: string
              format: uri
              description: |
                Link to the website of the company that provided the training 
                session.
          readOnly: true
        author:
          allOf:
            - $ref: '#/components/schemas/UserEmbedded'
            - type: object
              description: Reference of the user who created this training-demand.
              properties:
                type:
                  description: |
                    Type of user who created this training-demand.
                  type: string
                  enum:
                    - Invalid
                    - Manager
                    - Owner
                    - Other
        owner:
          allOf:
            - $ref: '#/components/schemas/UserEmbedded'
            - type: object
              description: |
                The employee that is subject to this training-demand.
              properties:
                picture:
                  type: object
                  description: URL of this employee's picture file.
                  readOnly: true
                  properties:
                    id:
                      type: string
                      format: uuid
                    href:
                      type: string
                      format: uri
                establishmentId:
                  description: >-
                    Current establishment this employee has a work-contract
                    with.
                  type: integer
                  format: int32
                  minimum: 0
                departmentId:
                  description: Department this employee currently belongs to.
                manager:
                  $ref: '#/components/schemas/UserEmbedded'
                  description: the current manager of the employee
        plan:
          title: training-plan
          description: |
            The training plan sets out the budget, timeframe, 
            and objectives for training your employees.
          type: object
          properties:
            id:
              description: |
                Identifier of the training plan.
              type: integer
              format: int32
              minimum: 0
            name:
              type: string
              description: Name of the training plan
            startOn:
              type: string
              format: date
              description: Start date of the training plan
        createdAt:
          type: string
          format: date-time
          description: |
            Timestamp of the moment when this training-demand was created.
        registeredOn:
          type: string
          format: date
          description: Date of the day this training-demand was registered (c.f. "state").
        session:
          type:
            - object
            - 'null'
          description: |
            Reference of the training-session the employee was registered on 
            regarding this training-request.
            Is `null` while employee stil hasn't been registered on a session.
          properties:
            id:
              type: integer
              description: Identifier of the training-session.
              format: int32
              minimum: 0
            startOn:
              type:
                - string
                - 'null'
              format: date
              description: Date of the first day of this training-session.
            endOn:
              type:
                - string
                - 'null'
              format: date
              description: Date of the last day (included) of this training-session.
            durationInHours:
              type:
                - integer
                - 'null'
              format: int32
              description: Duration, in hours, of the training-session.
            location:
              type: object
              description: Location where this training-session takes place.
              required:
                - isOnSite
                - isRemote
                - address
              properties:
                isOnSite:
                  type: boolean
                isRemote:
                  type: boolean
                address:
                  type:
                    - string
                    - 'null'
                  minLength: 0
                  description: |
                    Postal address of the location where this training-session
                    takes place.
                remoteUrl:
                  type:
                    - string
                    - 'null'
                  format: uri
                  description: Link to the video-conference / webinar.
        prioritization:
          type: object
          description: >
            The prioritization policy is a set of guidelines to help managers
            objectively define the prioritization of a request for their
            supervised employees. It allow the entire company to align on the
            same standard.
          properties:
            id:
              type: integer
              format: int32
              minimum: 0
            name:
              type: string
              minLength: 0
            level:
              $ref: '#/components/schemas/PrioritizationLevel'
            lastModifiedAt:
              type: string
              format: date-time
              readOnly: true
          required:
            - id
            - name
            - level
            - lastModifiedAt
          readOnly: true
        state:
          $ref: '#/components/schemas/TrainingDemandState'
        status:
          $ref: '#/components/schemas/TrainingDemandStatus'
      required:
        - id
        - training
        - provider
        - owner
        - state
        - author
        - createdAt
    UserEmbedded:
      title: UserEmbedded
      type: object
      properties:
        id:
          type: integer
          format: int32
          minimum: 1
        firstName:
          type: string
          readOnly: true
          description: The employee's first name.
        lastName:
          type: string
          readOnly: true
          description: The employee's last name.
    PrioritizationLevel:
      title: prioritization-level
      description: |
        Level of priority that was given to this training-demand.
      type: string
      enum:
        - Invalid
        - Low
        - Medium
        - High
    TrainingDemandStatus:
      title: TrainingDemandStatus
      type: string
      description: >
        Status of the training-demand.

        - `Invalid`: error

        - `PendingPrioritization`: This training-demand still hasn't been
        prioritized by the owner's manager.

        - `PendingProcessing`: This training-demand still needs to be processed
        by HR.

        - `PendingRegistration`: The employee still needs to be registered on a
        training-session.

        - `TrainingToStart`: The training-session is planned in the future.

        - `TrainingInProgress`: The training-session is currently taking place.
      enum:
        - Invalid
        - PendingPrioritization
        - PendingProcessing
        - PendingRegistration
        - TrainingToStart
        - TrainingInProgress
      x-enumDescriptions:
        Invalid: Error
        PendingPrioritization: >-
          This training-demand still hasn't been prioritized by the owner's
          manager.
        PendingProcessing: This training-demand still needs to be processed by HR.
        PendingRegistration: The employee still needs to be registered on a training-session.
        TrainingToStart: The training-session is planned in the future.
        TrainingInProgress: The training-session is currently taking place.
  responses:
    Problem:
      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

````