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

> Query employees work locations



## OpenAPI

````yaml /openapi-specs/timmi-office.yaml get /work-locations/public/api/user-locations
openapi: 3.1.0
info:
  title: Lucca Office
  version: '1.0'
  description: >
    Welcome on the documentation for the Lucca Office API.


    Lucca Office indicates where the teams are, whether they are in the office,
    visiting a client or at home.

    This API allows you to retrieve this information, using 2 resources:

    * The WorkLocations, which describe possible work locations. These locations
    can be physical, like an office, but also abstract like remote work or
    travel.

    * The UserLocations, which inform the associated workLocation for an
    employee and a date.


    Currently it only supports GET methods to retrieve information.

    If you have any additional needs, you can address them to the Lucca support
    team, and we will review them.


    It is not conforming to the "v3 API" constraints. Main differences are:

    - All available fields are systematically returned. Fields sets may be
    differente between endpoints for resources collections and single resources.

    - Paging is controlled through page token and limit parameter.
  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: UserLocations
    description: Indicates where an employee is on a given date.
  - name: WorkLocations
    description: >-
      Represents the different types of work-locations an employee can work
      from.
  - name: Imports
    description: Imports useful for Office
paths:
  /work-locations/public/api/user-locations:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    get:
      tags:
        - UserLocations
      summary: List userLocations
      description: Query employees work locations
      operationId: get-user-locations
      parameters:
        - name: from
          in: query
          schema:
            type: string
            format: date
          description: Start date of the period to retrieve, format YYYY-MM-DD
        - name: to
          in: query
          schema:
            type: string
            format: date
          description: End date of the period to retrieve, format YYYY-MM-DD
        - name: workLocationId
          in: query
          schema:
            type: string
            pattern: ^(\d+(,\d+)*)?$
          description: >-
            Identifier of the work location. One or more integers separated by
            commas.
        - name: ownerId
          in: query
          schema:
            type: string
            pattern: ^(\d+(,\d+)*)?$
          description: Identifier of the owner. One or more integers separated by commas.
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/FieldsRoot'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Page'
                  - type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/UserLocation'
        '401':
          description: Unauthorized
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
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        default: 1
        minimum: 1
      description: Page number
    Limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        default: 10
        maximum: 1000
        minimum: 1
      description: Page size
    FieldsRoot:
      name: fields.root
      in: query
      required: false
      description: Return total items count (across all pages).
      schema:
        type: string
        enum:
          - count
  schemas:
    Page:
      title: Page
      type: object
      properties:
        count:
          type: integer
    UserLocation:
      title: The UserLocation resource
      type: object
      description: >-
        Represents the association of an employee and a workLocation on a given
        date and position in the day.
      x-tags:
        - UserLocations
      properties:
        id:
          type: integer
          description: The unique id of the userLocation.
        ownerId:
          type: integer
          description: The id of the employee.
        workLocationId:
          type: integer
          description: The id of the WorkLocation.
        areaId:
          type:
            - integer
            - 'null'
          description: >-
            The id of the specific area in the office. Left null whenever the
            Work Location has no areas.
        date:
          type: string
          format: date
          description: Date on which the employee works at this location.
        position:
          type: string
          description: Specify the day period this userLocation is effective.
          enum:
            - FullDay
            - FirstHalf
            - SecondHalf
        status:
          type: string
          description: The status of this userLocation.
          enum:
            - Pending
            - Deleted
            - Approved
            - Denied
            - Confirmed
        createdAt:
          type: string
          format: date-time
          description: Date at which the UserLocation was created.
          readOnly: true
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Date at which the UserLocation was deleted.
          readOnly: true
      required:
        - id
        - ownerId
        - workLocationId
        - date
        - position
        - status

````