# Update time-off request

PATCH https://api.letsdeel.com/rest/v2/time_offs/{time_off_id}
Content-Type: application/json

Update time-off request
 **Token scopes**: `time-off:write`, `worker:write`

Reference: https://developer.deel.com/api/endpoints/time-off/update-time-off-request

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /time_offs/{time_off_id}:
    patch:
      operationId: update-time-off-request
      summary: Update time-off request
      description: |-
        Update time-off request
         **Token scopes**: `time-off:write`, `worker:write`
      tags:
        - subpackage_timeOff
      parameters:
        - name: time_off_id
          in: path
          description: Time off request id
          required: true
          schema:
            type: string
            format: uuid
        - name: Authorization
          in: header
          description: >
            ## Authentication

            The Deel API uses bearer tokens to authenticate requests. All API
            calls must be made over HTTPS — calls over plain HTTP or without
            authentication will fail.


            ```curl

            curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
              -H 'Authorization: Bearer YOUR-TOKEN-HERE'
            ```


            [Learn more about authentication](/api/authentication)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Time off updated
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/time-off_updateTimeOffRequest_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UpdateTimeOffRequestRequestBadRequestError
        '401':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '403':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '404':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '500':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
      requestBody:
        description: Time off update request data
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  $ref: >-
                    #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaData
                  description: Time off update request data
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDate:
      oneOf:
        - type: string
          format: date
        - type: string
          format: date-time
      description: An specific date in the time-off request
      title: >-
        TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDate
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDayType:
      type: string
      enum:
        - HALF_DAY
        - FULL_DAY
        - PERCENTAGE
        - HOURLY
      description: >-
        The type of day for the time off request. All dates must follow the same
        type.
      title: >-
        TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDayType
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItems:
      type: object
      properties:
        date:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDate
          description: An specific date in the time-off request
        hours:
          type: number
          format: double
          description: >-
            The amount taken in hours during this specific date. It can not
            exceed the maximum allowed hours for the date.
        amount:
          type: number
          format: double
          description: >-
            The amount of time off requested for the date. It must be in the
            same time unit as in the total amount for the time off request.
        day_type:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItemsDayType
          description: >-
            The type of day for the time off request. All dates must follow the
            same type.
      required:
        - date
      description: The dates breakdown for the time off request.
      title: >-
        TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItems
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEndDate:
      oneOf:
        - type: string
          format: date
        - type: string
          format: date-time
      description: >-
        End date of the time off request. This is the date when the time off
        ends. For example, if you take 2 days off, this will be the end date of
        the second day.
      title: TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEndDate
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataStartDate:
      oneOf:
        - type: string
          format: date
        - type: string
          format: date-time
      description: >-
        Start date of the time off request. This is the date when the time off
        starts. For example, if you take 2 days off, this will be the start date
        of the first day.
      title: >-
        TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataStartDate
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEventDetails:
      type: object
      properties:
        birth_date:
          type: string
          format: date
          description: >-
            The birth date of the child. This is used for parental leave
            requests.
        adoption_date:
          type: string
          format: date
          description: The date of adoption. This is used for parental leave requests.
        is_confirmation:
          type: boolean
          description: >-
            Whether the event date are a confirmed or not. This is used for
            parental leave requests when either the birth date or adoption date
            are not estimated anymore but actually confirmed.
        was_premature_birth:
          type: boolean
          description: >-
            Whether the birth was premature or not. This is used for parental
            leave requests.
        had_multiple_children:
          type: boolean
          description: >-
            Whether the birth was multiple or not. This is used for parental
            leave requests.
      required:
        - birth_date
        - was_premature_birth
        - had_multiple_children
      description: >-
        Details of the event associated with the time off request. Required for
        event based policies such as parental leave.
      title: >-
        TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEventDetails
    TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        dates:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataDatesItems
          description: The dates breakdown for the time off request.
        reason:
          type:
            - string
            - 'null'
          description: >-
            Reason for taking time off. This is complementary information for
            the time-off description. Useful to provide sub categories for the
            same policy.
        is_paid:
          type: boolean
          description: >-
            Whether the time off is paid or unpaid. By default it follows the
            policy configuration.
        end_date:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEndDate
          description: >-
            End date of the time off request. This is the date when the time off
            ends. For example, if you take 2 days off, this will be the end date
            of the second day.
        policy_id:
          type: string
          format: uuid
          description: The time off policy id. Can be used in place of time_off_type_id
        start_date:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataStartDate
          description: >-
            Start date of the time off request. This is the date when the time
            off starts. For example, if you take 2 days off, this will be the
            start date of the first day.
        description:
          type:
            - string
            - 'null'
          description: >-
            Description of the time off request. Some policies require that a
            description is provided.
        contract_oid:
          type:
            - string
            - 'null'
          description: >-
            Contract id. This is the id of the contract associated with the time
            off request.
        event_details:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaDataEventDetails
          description: >-
            Details of the event associated with the time off request. Required
            for event based policies such as parental leave.
        deduction_amount:
          type:
            - number
            - 'null'
          format: double
          description: Deduction amount. Available for independent contractor's policies
        time_off_type_id:
          type: string
          format: uuid
          description: The time off type id. Required when policy_id is not provided
        time_off_event_id:
          type: string
          format: uuid
          description: >-
            The time off event id. This is used to link the time off request to
            an event.
        time_off_percentage:
          type:
            - number
            - 'null'
          format: double
          description: >-
            This is the percentage of time off taken. This is used when the time
            off request is a percentage.
        recipient_profile_id:
          type: string
          format: uuid
          description: The hris profile id of the recipient
        other_type_description:
          type:
            - string
            - 'null'
          description: >-
            Description of the time off type. This is used when the policy is
            OTHER.
      required:
        - end_date
        - start_date
        - recipient_profile_id
      description: Time off update request data
      title: TimeOffsTimeOffIdPatchRequestBodyContentApplicationJsonSchemaData
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffStatus:
      type: string
      enum:
        - REQUESTED
        - APPROVED
        - REJECTED
        - USED
        - CANCELED
      description: >-
        Status of the time off request. Can be REQUESTED, APPROVED, REJECTED,
        USED or CANCELED.
      title: TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffStatus
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffAttachmentsItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Attachment id
        filename:
          type: string
          description: Filename of the attachment
        created_at:
          type: string
          format: date-time
          description: This is the date when the attachment was created in the database.
        updated_at:
          type: string
          format: date-time
          description: >-
            This is the date when the attachment was last updated in the
            database.
      required:
        - id
        - filename
        - created_at
        - updated_at
      description: An attachment associated with the time off request.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffAttachmentsItems
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicyPolicyType:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Policy type id
        name:
          type: string
          description: Depicts the type of policy, like VACATION, SICK etc
      required:
        - id
        - name
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicyPolicyType
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicy:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Policy id
        name:
          type: string
          description: The custom name given to policy during policy creation.
        policy_type:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicyPolicyType
      required:
        - id
        - name
        - policy_type
      description: The policy associated with the time off type.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicy
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffType:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Time off type id.
        name:
          type: string
          description: >-
            Time off type name. Basically the reason or category of time-off
            taken. For SICK leave, it can be doctor appointment, surgery etc.
        policy:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffTypePolicy
          description: The policy associated with the time off type.
      required:
        - id
        - name
      description: The type of time off taken.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffType
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventType:
      type: string
      enum:
        - PARENTAL_LEAVE
      description: The type of the time off event.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventType
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventEventDetails:
      type: object
      properties:
        birth_date:
          type: string
          format: date
          description: >-
            The birth date of the child. This is used for parental leave
            requests.
        adoption_date:
          type: string
          format: date
          description: The date of adoption. This is used for parental leave requests.
        was_premature_birth:
          type: boolean
          description: >-
            Whether the birth was premature or not. This is used for parental
            leave requests.
        estimated_birth_date:
          type: string
          format: date
          description: >-
            The estimated birth date of the child. Birth is estimated when the
            birth date has not been confirmed yet.
        had_multiple_children:
          type: boolean
          description: >-
            Whether the birth was multiple or not. This is used for parental
            leave requests.
        estimated_adoption_date:
          type: string
          format: date
          description: >-
            The estimated adoption date of the child. Birth is estimated when
            the adoption date has not been confirmed yet.
      required:
        - was_premature_birth
        - had_multiple_children
      description: >-
        Details of the event associated with the time off request. Required for
        event based policies such as parental leave.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventEventDetails
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEvent:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The time off event id. This is used to link the time off request to
            an event.
        type:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventType
          description: The type of the time off event.
        policy_id:
          type: string
          format: uuid
          description: >-
            The policy id associated with the time off event. Same as the
            policy_id in the time off type.
        created_at:
          type: string
          format: date-time
          description: The date when the time off event was created in the database.
        updated_at:
          type: string
          format: date-time
          description: The date when the time off event was last updated in the database.
        event_details:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEventEventDetails
          description: >-
            Details of the event associated with the time off request. Required
            for event based policies such as parental leave.
        hris_profile_id:
          type: string
          format: uuid
          description: >-
            The HRIS profile id of the worker associated with the time off
            event. Same as the hris_profile_id in the recipient_profile.
        time_off_type_id:
          type: string
          format: uuid
          description: >-
            The time off type id associated with the time off event. Same as the
            time_off_type_id in the time off request.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEvent
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffEntitlementUnit:
      type: string
      enum:
        - HOUR
        - BUSINESS_DAY
        - CALENDAR_DAY
        - WEEK
        - MONTH
        - YEAR
      description: The unit in which the time off usage and entitlement are calculated.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffEntitlementUnit
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItemsType:
      type: string
      enum:
        - WORKING_DAY
        - NON_WORKING_DAY
        - HOLIDAY
      description: >-
        Type of the time off daily. Can be WORKING_DAY, NON_WORKING_DAY or
        HOLIDAY.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItemsType
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Time off daily id
        date:
          type: string
          format: date
          description: >-
            Date of the time off daily. This is the date when the time off was
            taken.
        type:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItemsType
          description: >-
            Type of the time off daily. Can be WORKING_DAY, NON_WORKING_DAY or
            HOLIDAY.
        amount:
          type: number
          format: double
          description: Amount of time off taken in this specific date.
        created_at:
          type: string
          format: date-time
          description: >-
            This is the date when the time off daily was created in the
            database.
        updated_at:
          type: string
          format: date-time
          description: >-
            This is the date when the time off daily was last updated in the
            database.
        description:
          type:
            - string
            - 'null'
          description: >-
            Description of the time off daily. When it is a HOLIDAY this is the
            holiday name.
        time_off_id:
          type: string
          format: uuid
          description: >-
            Time off id. This is the id of the time off request associated with
            the time off daily.
      required:
        - id
        - date
        - type
        - amount
        - created_at
        - updated_at
        - time_off_id
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItems
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRecipientProfile:
      type: object
      properties:
        hris_profile_id:
          type: string
          format: uuid
          description: The worker HRIS profile id in the given organization.
        organization_id:
          type: string
          format: uuid
          description: Id of the organization the profile belongs to.
      required:
        - hris_profile_id
        - organization_id
      description: >-
        The time off profile of the recipient of the time off request. Must be a
        worker profile.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRecipientProfile
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRequesterProfile:
      type: object
      properties:
        hris_profile_id:
          type: string
          format: uuid
          description: >-
            The worker HRIS profile id in the given organization. Available when
            the requester is a worker.
        organization_id:
          type: string
          format: uuid
          description: Id of the organization the profile belongs to.
        client_profile_id:
          type: string
          format: uuid
          description: Id of the client profile. Available when the requester is a client.
      required:
        - organization_id
      description: >-
        The time off profile of the requester of the time off request. Can be
        either a client or worker profile.
      title: >-
        TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRequesterProfile
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOff:
      type: object
      properties:
        amount:
          type: number
          format: double
          description: >-
            Amount of time off taken. This is the total amount of time off
            taken. For example, if you take 2 days off, this will be 2. If you
            take 1 day off, this will be 1.
        reason:
          type: string
          description: >-
            Reason for taking time off. This is complementary information for
            the time-off description. Useful to provide sub categories for the
            same policy.
        status:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffStatus
          description: >-
            Status of the time off request. Can be REQUESTED, APPROVED,
            REJECTED, USED or CANCELED.
        is_paid:
          type: boolean
          description: Whether the time off is paid or unpaid.
        end_date:
          type: string
          format: date
          description: >-
            End date of the time off request. This is the date when the time off
            ends. For example, if you take 2 days off, this will be the end date
            of the second day.
        created_at:
          type: string
          format: date-time
          description: >-
            This is the date when the time off request was created in the
            database.
        start_date:
          type: string
          format: date
          description: >-
            Start date of the time off request. This is the date when the time
            off starts. For example, if you take 2 days off, this will be the
            start date of the first day.
        updated_at:
          type: string
          format: date-time
          description: >-
            This is the date when the time off request was last updated in the
            database.
        approved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            This is the date when the time off request was approved. This will
            be null if the time off request is not approved yet.
        attachments:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffAttachmentsItems
          description: List of attachments associated with the time off request.
        description:
          type: string
          description: >-
            Description of the time off request. Some policies require that a
            description is provided.
        contract_oid:
          type: string
          description: >-
            Contract id. This is the id of the contract associated with the time
            off request.
        requested_at:
          type: string
          format: date
          description: This is the date when the time off request was made.
        half_end_date:
          type: boolean
          description: Whether the end date is a half day or not.
        time_off_type:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffType
          description: The type of time off taken.
        time_off_event:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffEvent
        half_start_date:
          type: boolean
          description: Whether the start date is a half day or not.
        deduction_amount:
          type: number
          format: double
          description: Deduction amount. Available for independent contractor's policies
        entitlement_unit:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffEntitlementUnit
          description: The unit in which the time off usage and entitlement are calculated.
        time_off_dailies:
          type: array
          items:
            $ref: >-
              #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffTimeOffDailiesItems
          description: >-
            Used to break down the time off request into daily records. Each
            entry represents a single day within the time off period, allowing
            for detailed tracking of working days, non-working days, and
            holidays included in the request.
        time_off_type_id:
          type: string
          format: uuid
          description: >-
            Time off type id. This is the id of the time off type associated
            with the time off request.
        recipient_profile:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRecipientProfile
          description: >-
            The time off profile of the recipient of the time off request. Must
            be a worker profile.
        requester_profile:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOffRequesterProfile
          description: >-
            The time off profile of the requester of the time off request. Can
            be either a client or worker profile.
        time_off_percentage:
          type: number
          format: double
          description: >-
            Used to specify the percentage of time off taken relative to
            full-time employment. This value ranges from 0 to 1, where 1
            represents full-time (100%) and 0.5 represents part-time (50%). This
            is useful for part-time workers or when taking partial time off.
        is_end_date_estimated:
          type: boolean
          description: >-
            Used to indicate if the end date is an estimate rather than a
            confirmed date. This is particularly important for event-based
            policies such as Parental Leave, where the actual end date may
            depend on the actual birth or adoption date, which may not be known
            at the time of request submission.
        other_type_description:
          type: string
          description: >-
            Used to provide a custom description when the time off type is
            categorized as 'OTHER'. This allows users to specify the nature of
            time off that doesn't fit into standard categories, providing
            flexibility for unique or organization-specific time off types.
      required:
        - amount
        - is_paid
        - end_date
        - created_at
        - start_date
        - updated_at
        - requested_at
        - half_end_date
        - half_start_date
        - entitlement_unit
        - time_off_type_id
      description: >-
        Used to return the updated time off request after modification. Contains
        all the time off details including status, dates, amounts, and
        associated metadata.
      title: TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOff
    time-off_updateTimeOffRequest_Response_200:
      type: object
      properties:
        time_off:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaTimeOff
          description: >-
            Used to return the updated time off request after modification.
            Contains all the time off details including status, dates, amounts,
            and associated metadata.
      required:
        - time_off
      description: Time off data to be updated
      title: time-off_updateTimeOffRequest_Response_200
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaErrors:
      type: object
      properties:
        message:
          type: string
          description: Error message describing what went wrong
      description: Error details
      title: TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaErrors
    TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaRequest:
      type: object
      properties:
        url:
          type: string
          description: Request URL path
        docs:
          type: string
          description: Documentation reference
        method:
          type: string
          description: HTTP method
        source:
          type: string
          description: Request source
        status:
          type: integer
          description: HTTP status code
        api_req_id:
          type: string
          description: Unique API request identifier
      description: Request metadata
      title: TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaRequest
    UpdateTimeOffRequestRequestBadRequestError:
      type: object
      properties:
        errors:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaErrors
          description: Error details
        request:
          $ref: >-
            #/components/schemas/TimeOffsTimeOffIdPatchResponsesContentApplicationJsonSchemaRequest
          description: Request metadata
      title: UpdateTimeOffRequestRequestBadRequestError
    ApiErrorRequest:
      type: object
      properties:
        method:
          type: string
          description: The HTTP method of the failed request
        url:
          type: string
          description: The relative URL of the failed request
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        source:
          type: string
          description: The source handler which produced the returned error
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
      title: ApiErrorRequest
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: A description of the returned error
        path:
          type: string
          description: The JSON path where input validation failed
      title: ApiError
    ApiErrorContainer:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/ApiErrorRequest'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      title: ApiErrorContainer
  securitySchemes:
    deelToken:
      type: http
      scheme: bearer
      description: >
        ## Authentication

        The Deel API uses bearer tokens to authenticate requests. All API calls
        must be made over HTTPS — calls over plain HTTP or without
        authentication will fail.


        ```curl

        curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
          -H 'Authorization: Bearer YOUR-TOKEN-HERE'
        ```


        [Learn more about authentication](/api/authentication)
    oauth2:
      type: http
      scheme: bearer
      description: >-
        Standard OAuth2 security scheme based on
        https://swagger.io/docs/specification/authentication/

```

## SDK Code Examples

```python
import requests

url = "https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851"

payload = { "data": {
        "end_date": "2021-04-30",
        "start_date": "2021-04-01",
        "recipient_profile_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
        "reason": "Vacation",
        "is_paid": True,
        "time_off_type_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"data":{"end_date":"2021-04-30","start_date":"2021-04-01","recipient_profile_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","reason":"Vacation","is_paid":true,"time_off_type_id":"d290f1ee-6c54-4b01-90e6-d701748f0851"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851"

	payload := strings.NewReader("{\n  \"data\": {\n    \"end_date\": \"2021-04-30\",\n    \"start_date\": \"2021-04-01\",\n    \"recipient_profile_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n    \"reason\": \"Vacation\",\n    \"is_paid\": true,\n    \"time_off_type_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"end_date\": \"2021-04-30\",\n    \"start_date\": \"2021-04-01\",\n    \"recipient_profile_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n    \"reason\": \"Vacation\",\n    \"is_paid\": true,\n    \"time_off_type_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"end_date\": \"2021-04-30\",\n    \"start_date\": \"2021-04-01\",\n    \"recipient_profile_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n    \"reason\": \"Vacation\",\n    \"is_paid\": true,\n    \"time_off_type_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851', [
  'body' => '{
  "data": {
    "end_date": "2021-04-30",
    "start_date": "2021-04-01",
    "recipient_profile_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "reason": "Vacation",
    "is_paid": true,
    "time_off_type_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"end_date\": \"2021-04-30\",\n    \"start_date\": \"2021-04-01\",\n    \"recipient_profile_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n    \"reason\": \"Vacation\",\n    \"is_paid\": true,\n    \"time_off_type_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["data": [
    "end_date": "2021-04-30",
    "start_date": "2021-04-01",
    "recipient_profile_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "reason": "Vacation",
    "is_paid": true,
    "time_off_type_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/time_offs/d290f1ee-6c54-4b01-90e6-d701748f0851")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```