> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.sesametime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an employee leave

> Creates a new employee leave (baja) for the specified employee. The associated contract will be terminated.

**Required fields:**
- `endDate`: The leave effective date
- `leaveReasonId`: The reason for the leave
- `employeeLeaveTypeId`: The type of leave (voluntary/involuntary classification)
- `contractId`: The contract to terminate

**Optional fields:**
- `comment`: Additional notes



## OpenAPI

````yaml POST /contract/v1/employee-leave/employees/{employeeId}
openapi: 3.0.0
info:
  description: ''
  version: 3.0.0
  title: Sesame Public API
servers:
  - url: https://api-{region}.sesametime.com
    variables:
      region:
        default: eu1
security: []
tags: []
paths:
  /contract/v1/employee-leave/employees/{employeeId}:
    post:
      tags:
        - Contracts
      summary: Create an employee leave
      description: >-
        Creates a new employee leave (baja) for the specified employee. The
        associated contract will be terminated.


        **Required fields:**

        - `endDate`: The leave effective date

        - `leaveReasonId`: The reason for the leave

        - `employeeLeaveTypeId`: The type of leave (voluntary/involuntary
        classification)

        - `contractId`: The contract to terminate


        **Optional fields:**

        - `comment`: Additional notes
      operationId: CreateEmployeeLeave
      parameters:
        - name: employeeId
          in: path
          description: The employee ID
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - endDate
                - leaveReasonId
                - employeeLeaveTypeId
                - contractId
              properties:
                endDate:
                  type: string
                  format: date
                  description: Leave effective date (Y-m-d)
                  example: '2024-12-31'
                leaveReasonId:
                  type: string
                  format: uuid
                  description: Leave reason ID (required)
                employeeLeaveTypeId:
                  type: string
                  format: uuid
                  description: >-
                    Employee leave type ID (voluntary/involuntary
                    classification)
                comment:
                  type: string
                  nullable: true
                  description: Optional comment
                contractId:
                  type: string
                  format: uuid
                  description: Contract ID to terminate along with the leave
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Employee leave ID
                      employeeId:
                        type: string
                        format: uuid
                        description: Employee ID
                      endDate:
                        type: string
                        format: date
                        description: Leave end date (Y-m-d)
                        example: '2024-12-31'
                      employeeLeaveType:
                        nullable: true
                        description: The leave type associated with this leave
                        allOf:
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                description: Employee leave type ID
                              name:
                                type: string
                                description: Leave type name (translated)
                                example: Dismissal
                              reason:
                                type: string
                                enum:
                                  - entities.employeeLeaveType.reason.voluntary
                                  - >-
                                    entities.employeeLeaveType.reason.involuntary
                                description: >-
                                  Leave reason category: voluntary or
                                  involuntary
                              editable:
                                type: boolean
                                description: >-
                                  Whether this leave type can be modified (false
                                  for system defaults)
                              createdAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                              updatedAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                      leaveReason:
                        nullable: true
                        description: The leave reason associated with this leave
                        allOf:
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                description: Leave reason ID
                              name:
                                type: string
                                description: Leave reason name (translated)
                                example: Voluntary resignation
                              editable:
                                type: boolean
                                description: >-
                                  Whether this leave reason can be modified
                                  (false for system defaults)
                              createdAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                              updatedAt:
                                type: string
                                format: Y-m-dTH:i:sP
                                example: '2020-01-01T10:00:00+01:00'
                      comment:
                        type: string
                        nullable: true
                        description: Optional comment about the leave
                      status:
                        type: string
                        enum:
                          - active
                          - inactive
                        description: Leave status
                      contractId:
                        type: string
                        format: uuid
                        nullable: true
                        description: Associated contract ID (if contract termination)
                      createdAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                      updatedAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                  meta:
                    type: object
                    properties:
                      currentPage:
                        type: integer
                        example: 1
                      lastPage:
                        type: integer
                        example: 1
                      total:
                        type: integer
                        example: 1
                      perPage:
                        type: integer
                        example: 1
        '400':
          description: Bad Request - The request was invalid or cannot be served
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing what went wrong
                    example: Validation failed for the provided data
                  errors:
                    type: array
                    description: List of specific validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: The field that caused the error
                          example: questionId
                        message:
                          type: string
                          description: Specific error message for the field
                          example: This value is not a valid UUID.
              example:
                message: Validation failed
                errors:
                  - field: questionId
                    message: This value is not a valid UUID.
                  - field: answer
                    message: This field is required for text-based questions.
        '401':
          description: Unauthorized - Invalid or missing API Key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating authentication failure
                    example: Invalid or missing API Key
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: UNAUTHORIZED
              example:
                message: Invalid or missing API Key
                code: UNAUTHORIZED
        '404':
          description: Not Found - The requested resource could not be found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating the resource was not found
                    example: Evaluation not found
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: EVALUATION_NOT_FOUND
              example:
                message: >-
                  Evaluation with ID 123e4567-e89b-12d3-a456-426614174000 was
                  not found
                code: EVALUATION_NOT_FOUND
        '429':
          description: Too Many Requests - Rate limit exceeded
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````