> ## 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 work-contract

> Retrieve a single work-contract by its ID.

<Warning>
  This legacy endpoint has its equivalent in the **Lucca API** (currently in beta): [`GET /lucca-api/employments/{id}`](/api-reference/latest/get-employment).

  Career data (department, manager, job title) is now tracked separately through the [job-position](/api-reference/latest/employments/job-position) resource.
</Warning>


## OpenAPI

````yaml /openapi-specs/directory-v3.yaml get /directory/api/4.0/work-contracts/{id}
openapi: 3.1.0
info:
  title: Directory-v3
  version: '1.0'
  description: |
    Welcome on the documentation for the Directory v3 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: Users
    description: Users or employees.
  - name: Work-Contracts
    description: Work-contracts.
paths:
  /directory/api/4.0/work-contracts/{id}:
    parameters:
      - $ref: '#/components/parameters/Authorization'
      - name: id
        in: path
        required: true
        description: Identifier of the work-contract to retrieve.
        schema:
          type: integer
          minimum: 1
    get:
      tags:
        - Work-Contracts
      summary: Retrieve a work-contract
      description: Retrieve a single work-contract by its ID.
      operationId: get-work-contract
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/work-contract'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Unexpected Error
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:
    work-contract:
      title: work-contract
      type: object
      properties:
        id:
          type: integer
          minimum: 1
          readOnly: true
          description: Unique identifier of this work-contract.
        ownerId:
          type: integer
          minimum: 1
          description: Unique identifier of the employee this work-contract belongs to.
        externalId:
          type:
            - string
            - 'null'
          description: Third-party identifier of this work-contract. May be not unique.
        typeId:
          type: integer
          description: >-
            Identifier of the work-contract template this work-contract conforms
            to. Determines whether certain optional properties are required.
        startsOn:
          type: string
          format: date
          description: 'Start date of this work-contract. Format: `YYYY-mm-DD`.'
        isApplicable:
          type: boolean
          readOnly: true
          description: >-
            **Readonly**. Whether this work-contract applies to the employee at
            this very moment.


            A work-contract is considered "applicable" if: 
              1. It is the ongoing work-contract as of today;
              2. If there is none, then it is the first upcoming work-contract;
              3. If not, then it is the last work-contract this employee had.
        establishmentId:
          type: integer
          description: Identifier of the establishment the employee works for.
        spcId:
          type:
            - integer
            - 'null'
          description: >-
            Identifier of the socio-professional category.


            Refer to the API endpoint:
            `/organization/structure/api/occupation-categories`.
        hiringTypeId:
          type:
            - integer
            - 'null'
          description: >-
            Identifier of a hiring reason type.


            Refer to the API endpoint:
            `/directory/api/work-contract-hiring-types`.
        trialPeriodDays:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Number of days of the initial trial period.
        renewedTrialPeriodDays:
          type:
            - integer
            - 'null'
          minimum: 0
          description: >-
            Number of days of renewed trial period (equal to the length of the
            initial period, plus the renewal period).
        trialPeriodEndDate:
          type:
            - string
            - 'null'
          format: date
          description: 'Initial trial period end date. Format: `YYYY-mm-DD`.'
        trialPeriodEndDate2:
          type:
            - string
            - 'null'
          format: date
          description: 'Renewed trial period end date. Format: `YYYY-mm-DD`.'
        temporaryContractGroundId:
          type:
            - integer
            - 'null'
          description: >-
            Identifier of the temporary contract ground.


            Refer to the API endpoint:
            `/directory/api/work-contract-temporary-contract-grounds`.
        internshipSupervisorId:
          type:
            - integer
            - 'null'
          description: Identifier of the employee/user that acts as internship supervisor.
        endsOn:
          type:
            - string
            - 'null'
          format: date
          description: >-
            End date of this work-contract. Leave `null` if not (yet) known.
            Format: `YYYY-mm-DD`.
        terminationReasonId:
          type:
            - integer
            - 'null'
          description: >-
            Identifier of the termination reason.


            Refer to the API endpoint:
            `/directory/api/work-contract-termination-reasons`.
        authorId:
          type: integer
          readOnly: true
          description: >-
            **Read-only**. Identifier of the user who created this
            work-contract.
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: >-
            **Read-only**. Timestamp of the moment this work-contract was
            created.
        lastModifierId:
          type: integer
          readOnly: true
          description: >-
            **Read-only**. Identifier of the user who last modified this
            work-contract.
        lastModifiedAt:
          type: string
          format: date-time
          readOnly: true
          description: >-
            **Read-only**. Timestamp of the moment this work-contract was last
            updated.
      example:
        id: 514
        ownerId: 416
        startsOn: '2021-01-01'
        endsOn: null
        isApplicable: true
        establishmentId: 13
        spcId: 1
        typeId: 1
        hiringTypeId: 3
        terminationReasonId: null
        trialPeriodDays: 120
        renewedTrialPeriodDays: null
        trialPeriodEndDate: '2021-05-01'
        trialPeriodEndDate2: null
        authorId: 45
        lastModifierId: 45
        createdAt: '2021-11-08T17:48:18.12'
        lastModifiedAt: '2024-01-10T12:27:02.22'

````