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

# Import user locations

> Create user locations in batch from a CSV file.

**Please note that once launched, imports cannot be undone.**

You may test out your CSV file first, through setting the `create` query parameter to `false`. [Refer to the guide](../guides/import-and-create-user-locations) for further explanations.




## OpenAPI

````yaml /openapi-specs/timmi-office.yaml post /work-locations/public/api/imports/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/imports/user-locations:
    parameters:
      - $ref: '#/components/parameters/Authorization'
    post:
      tags:
        - Imports
      summary: Import user locations
      description: >
        Create user locations in batch from a CSV file.


        **Please note that once launched, imports cannot be undone.**


        You may test out your CSV file first, through setting the `create` query
        parameter to `false`. [Refer to the
        guide](../guides/import-and-create-user-locations) for further
        explanations.
      operationId: post-office-api-imports-userLocations
      parameters:
        - schema:
            type: string
          in: header
          name: Content-Type
          required: true
          example: multipart/form-data; boundary=myBoundary
          description: Multipart boundary **MUST** be set in the Content-Type header.
        - schema:
            type: boolean
          in: query
          name: create
          required: true
          description: >-
            Use `false` to simulate the import and `true` to create the User
            Locations. If you simulate you will be able to use analysis and if
            you create, you could use results.
        - schema:
            type: boolean
          in: query
          name: overrideUserLocations
          required: true
          description: >-
            Use `true` to replace current User Locations with new one. Use
            `false` to create/simulate User Locations just for day without
            UserLocations.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
            encoding:
              files:
                contentType: text/csv
        description: >
          Content of the CSV file to import. Divided by the 'boundary' string

          set in the Content-Type HTTP header.


          Example of a single file request body:

          ```

          --myBoundary

          Content-Disposition: form-data; name="office-import.csv";
          filename="office-import.csv"

          Content-Type: multipart/form-data


          login;workLocationName;areaName;date;position;comment;isDeletion

          jdupont;Paris;Service Client;2025/09/18;FullDay;;false

          mlefevre;Nantes;B1;2025/09/19;SecondHalf;this is a comment;false

          --myBoundary--

          ```
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  summaryId:
                    type: string
                    example: 51564472-08cc-4410-94cc-a2b67f77f980
                    format: uuid
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

````