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

# Update User Leave

> Updates an existing user leave. Dates must be in UTC format.



## OpenAPI

````yaml /api-reference/openapi.json put /user/leaves/{licenseId}
openapi: 3.1.0
info:
  title: COR API
  description: >-
    The COR API lets you integrate with projectcor.com applications using simple
    HTTP methods, in either XML or JSON formats, making this an ideal API for
    developing integrations with other softwares, external clients or mobile
    applications
  version: 1.0.0
servers:
  - url: https://api.projectcor.com/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /user/leaves/{licenseId}:
    put:
      tags:
        - User Leaves
      summary: Update User Leave
      description: Updates an existing user leave. Dates must be in UTC format.
      parameters:
        - name: licenseId
          in: path
          required: true
          schema:
            type: integer
          description: User Leave ID to update
          example: 16332
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeaveUpdateInput'
            example:
              userId: 8555
              leaveTypeId: 12
              start: '2024-11-18T03:00:00Z'
              end: '2024-11-19T05:00:00Z'
      responses:
        '200':
          description: Leave updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Leave'
              example:
                id: 16332
                user_id: 8555
                company_id: 2336
                leave_type_id: 12
                start: '2024-11-18T03:00:00Z'
                end: '2024-11-19T05:00:00Z'
                created_at: '2024-11-07 22:11:30'
                updated_at: '2024-11-07 22:20:48'
                deleted_at: null
                all_day: false
components:
  schemas:
    LeaveUpdateInput:
      type: object
      required:
        - userId
        - leaveTypeId
        - start
        - end
      properties:
        userId:
          type: integer
          description: User ID
        leaveTypeId:
          type: integer
          description: Leave type ID
        start:
          type: string
          format: date-time
          description: Start date in UTC format
        end:
          type: string
          format: date-time
          description: End date in UTC format
    Leave:
      type: object
      properties:
        id:
          type: integer
        user_id:
          type: integer
        company_id:
          type: integer
        leave_type_id:
          type: integer
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
        all_day:
          type: boolean
        leaveType:
          $ref: '#/components/schemas/LeaveType'
    LeaveType:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type_code:
          type: string
        company_id:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
        icon_name:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````