> ## 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 Departement by id (v3)

> Retrieve a single Department by its unique identifier.



## OpenAPI

````yaml /openapi-specs/organization-v3.yaml get /api/v3/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:
  /api/v3/departments/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - schema:
          type: integer
        name: id
        description: ID of the department.
        in: path
        required: true
    get:
      tags:
        - Departments
      summary: Get Departement by id (v3)
      description: Retrieve a single Department by its unique identifier.
      operationId: get-api-v3-departments-departmentId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Department'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
      deprecated: true
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:
    Department:
      deprecated: true
      type: object
      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.
      examples:
        - id: 2
          name: Administration
          code: Administration
          hierarchy: /1.0/
          parentId: /
          position: 10000000000000000000
          sortOrder: 1
          level: 1
          isActive: true
          headID: null
          head: null
          users:
            - id: 11
              name: Daniel Hernandez
              url: https://sandbox.ilucca-demo.net/api/v3/users/11
            - id: 36
              name: henri paul
              url: https://sandbox.ilucca-demo.net/api/v3/users/36
          currentUsers:
            - id: 11
              name: Daniel Hernandez
              url: https://sandbox.ilucca-demo.net/api/v3/users/11
            - id: 36
              name: henri paul
              url: https://sandbox.ilucca-demo.net/api/v3/users/36
          url: https://sandbox.ilucca-demo.net/api/v3/departments/2
      title: The Department resource
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        code:
          type: string
          maxLength: 255
        hierarchy:
          type: string
          description: Position of the departement in the hierarchical tree
        parentId:
          type: string
          description: Position of the parent department in the hierarchical tree
          pattern: \/[0-9]\/
        isActive:
          type: boolean
        position:
          type: integer
          description: Department's general position in the hierarchy
          minimum: 10000000000000000000
          maximum: 100000000000000000000
        level:
          type: integer
          description: level of the Department. Deduce from Position.
        sortOrder:
          type: integer
          description: >-
            Order of the current Department among the children of the Parent
            Department
          minimum: 1
        headID:
          type: integer
          description: ID of the User who is the head of the department
        head:
          $ref: '#/components/schemas/SimpleUser'
        users:
          type: array
          description: Users of the department, including inactive users.
          items:
            $ref: '#/components/schemas/SimpleUser'
        currentUsers:
          type: array
          description: Only active users of the department
          items:
            $ref: '#/components/schemas/SimpleUser'
        currentUsersCount:
          type: integer
          minimum: 0
          description: Number of active users in the department
          readOnly: true
      required:
        - name
        - code
      x-tags:
        - Departments
    SimpleUser:
      title: User
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        url:
          type: string
          format: uri
  responses:
    Error:
      description: Generique error message response
      content:
        application/json:
          schema:
            type: object
            properties:
              Status:
                type: integer
              Message:
                type: string
            x-examples:
              example-1:
                Status: 404
                Message: Resource Department with ID 13651 not found

````