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

> Retrieve a department by its ID.



## OpenAPI

````yaml /openapi-specs/organization-v3.yaml get /organization/structure/api/departments/{id}
openapi: 3.1.0
info:
  title: Organization structure API
  version: '1.0'
  description: |
    Welcome on the documentation for the Organization Structure 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: Legal-Units
    description: Structure > Legal-units
  - name: Establishments
    description: Structure > Establishments
  - name: Departments
    description: Structure > Departments
  - name: Axis-sections
    description: Structure > Axes & Axis-sections
paths:
  /organization/structure/api/departments/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        in: path
        required: true
        description: ID of the department.
        schema:
          type: integer
          minimum: 1
    get:
      tags:
        - Departments
      summary: Retrieve a department
      description: Retrieve a department by its ID.
      operationId: V4.get-department
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4.department'
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:
    V4.department:
      title: Department (v4)
      description: >-
        Departments, to which users must be attached, are used by the different
        Lucca solutions for different purposes:


        * Define access scopes: for example to restrict the visibility of
        absences in the Lucca Absences schedule.

        * Filtering data in a report: our different reports generally allow to
        filter data according to the legal entity, the SSC, but also the
        department of the user.

        * Build the organization chart in Lucca Core HR.

        The departments are represented as a hierarchical tree with a
        parent/child relationship.


        *NB:* You can have up to 9 levels of departments, and up to 99
        departments under a single parent department. However, limiting the
        number of levels to 7 is recommended.
      type: object
      properties:
        id:
          type: integer
          format: int32
          minimum: 1
          readOnly: true
        name:
          type: string
          minLength: 1
        code:
          description: Unique code of this department.
          type: string
          minLength: 1
        description:
          description: Optional description of the department.
          type:
            - 'null'
            - string
        parentId:
          description: >-
            Hierarchy ID of the parent department. Null if this department is at
            root-level.
          type: string
        parentLuccaId:
          type:
            - 'null'
            - integer
        hierarchy:
          description: >-
            A value that describes where a department sits in the organization
            tree. It encodes the department’s position and parent/child
            relationships, allowing the system to determine ancestors,
            descendants, and ordering within the hierarchy.


            You may refer to the Microsoft documentation about
            [hierarchyid](https://learn.microsoft.com/en-us/sql/relational-databases/hierarchical-data-sql-server)
            for more information.


            You should treat it as an opaque hierarchical path value—use it only
            for storage, comparison, and API calls, and do not attempt to parse
            or construct it yourself.


            Example `hierarchyId` values:

            - '/1/'
              - '/1/1/'
                - '/1/1/2/'
                - '/1/1/2.5/'
                - '/1/1/3/'
              - '/1/3/'
          type: string
        isActive:
          description: When false, then the department should no longer be used.
          type: boolean
          default: true
        headId:
          description: ID of the employee at the head of this department.
          type:
            - 'null'
            - integer
        createdAt:
          description: Timestamp (with offset) of the moment this department was created.
          type: string
          format: date-time
          readOnly: true
        lastModifiedAt:
          description: >-
            Timestamp (with offset) of the moment this department was last
            modified.
          type: string
          format: date-time
          readOnly: true
        sortOrderInSiblings:
          type:
            - 'null'
            - integer
          minimum: 0
          maximum: 99
      example:
        id: 48
        name: IT
        code: IT
        description: null
        parentId: /1/2/
        parentLuccaId: null
        hierarchy: /1/2/2/
        isActive: true
        headId: 1080
        createdAt: '2000-01-01T00:00:00+00:00'
        lastModifiedAt: '2000-01-01T00:00:00+00:00'
        sortOrderInSiblings: null

````