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

# Update Optimization Strategy

> Update an existing optimization strategy. Only provided fields are updated. Supplying `optimization_schedules` replaces the existing schedules.



## OpenAPI

````yaml patch /v1/optimization-strategies/{id}
openapi: 3.1.0
info:
  title: Nash API
  version: 1.0.0
servers:
  - url: https://api.sandbox.usenash.com
    description: Sandbox API
  - url: https://api.sandbox.ap-southeast-2.usenash.com
    description: Sandbox API (Australia)
  - url: https://api.usenash.com
    description: Production API
  - url: https://api.ap-southeast-2.usenash.com
    description: Production API (Australia)
security: []
tags:
  - name: Notifications
    description: Notifications
    x-nash-topic: config
  - name: Annotate
    description: Annotate
    x-nash-topic: wismo
  - name: Notifications — Send
    description: One-off notification send without a NotificationTrigger.
    x-nash-topic: notifications
  - name: Shipping
    description: Shipping operations
    x-nash-topic: shipping
  - name: Workflow
    description: Workflow automation management
    x-nash-topic: scheduling
  - name: Workflow Execution
    description: Workflow execution history and monitoring
    x-nash-topic: scheduling
  - name: Optimization Strategies
    description: Create, read, update, and delete route optimization strategies.
    x-nash-topic: scheduling
  - name: AI Agents
    description: AI agent management — create, read, update, and delete agents
    x-nash-topic: config
  - name: AI Functions
    description: LLM-backed domain tools
    x-nash-topic: ai
  - name: Webhooks
    description: Webhook delivery inspection
    x-nash-topic: webhooks
  - name: Miscellaneous
    description: Miscellaneous
  - name: Job
    description: Job
    x-nash-topic: wismo
  - name: Batch Job
    description: Batch Job
    x-nash-topic: wismo
  - name: Order
    description: Order
    x-nash-topic: wismo
  - name: Route
    description: Route
    x-nash-topic: scheduling
  - name: Provider
    description: Provider
    x-nash-topic: provider
  - name: Dispatch Strategies
    description: Dispatch Strategies
    x-nash-topic: scheduling
  - name: Store Locations
    description: Store Locations
    x-nash-topic: config
  - name: Vehicles
    description: Vehicles
    x-nash-topic: provider
  - name: Couriers
    description: Couriers
    x-nash-topic: provider
  - name: Shifts
    description: Shifts
    x-nash-topic: provider
  - name: Delivery Windows
    description: Delivery Windows
    x-nash-topic: config
  - name: Templates
    description: Templates
    x-nash-topic: config
  - name: Zones
    description: Zones
    x-nash-topic: config
  - name: Feedback
    description: Feedback
    x-nash-topic: reporting
  - name: Organizations
    description: Organizations
    x-nash-topic: config
  - name: Store Catalog
    description: Store Catalog
    x-nash-topic: config
  - name: Messaging
    description: Messaging
    x-nash-topic: config
  - name: Contracts
    description: Provider contract pricing and version listings
    x-nash-topic: provider
  - name: Event Timeline
    description: Entity-scoped event timeline + outbound provider traffic for one entity.
    x-nash-topic: internal
  - name: Fleet
    description: Inbound endpoints fleets call to update in-flight deliveries.
    x-nash-topic: delivery
  - name: Route Restrictions
    description: Org-scoped geographic areas the route optimizer must avoid traversing.
    x-nash-topic: config
  - name: Users
    description: User, role, and organization-membership management.
    x-nash-topic: config
paths:
  /v1/optimization-strategies/{id}:
    patch:
      tags:
        - Optimization Strategies
      summary: Update Optimization Strategy
      description: >-
        Update an existing optimization strategy. Only provided fields are
        updated. Supplying `optimization_schedules` replaces the existing
        schedules.
      operationId: >-
        update_optimization_strategy_v1_optimization_strategies__string_id__patch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            title: Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOptimizationStrategyInputSerializer'
        required: true
      responses:
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NashValidationError'
components:
  schemas:
    UpdateOptimizationStrategyInputSerializer:
      title: UpdateOptimizationStrategyInputSerializer
      type: object
      properties:
        optimizationSchedules:
          title: Optimizationschedules
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/OptimizationScheduleInputSerializer'
            - type: 'null'
          default: null
        contractIds:
          title: Contractids
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: Contracts considered during optimization.
          default: null
        shiftContractId:
          title: Shiftcontractid
          anyOf:
            - type: string
            - type: 'null'
          description: Contract id of the provider supplying shifts for this strategy.
          default: null
        pickupServiceTimeSeconds:
          title: Pickupservicetimeseconds
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        dropoffServiceTimeSeconds:
          title: Dropoffservicetimeseconds
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        incrementalServiceTimeSeconds:
          title: Incrementalservicetimeseconds
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        enableAutoDispatch:
          title: Enableautodispatch
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
        autodispatchWithinXMinutesOfPickupTime:
          title: Autodispatchwithinxminutesofpickuptime
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Deprecated. Use pickup_time_from_in_minutes /
            pickup_time_to_in_minutes.
          default: null
        earliestDispatchMinutesBeforePickup:
          title: Earliestdispatchminutesbeforepickup
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Deprecated. Use pickup_time_from_in_minutes /
            pickup_time_to_in_minutes.
          default: null
        pickupTimeFromInMinutes:
          title: Pickuptimefrominminutes
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Lower bound (inclusive) of the pickup time window to optimize, in
            minutes from now.
          default: null
        pickupTimeToInMinutes:
          title: Pickuptimetoinminutes
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Upper bound (exclusive) of the pickup time window to optimize, in
            minutes from now.
          default: null
        contractOptimizationOverrideParameters:
          title: Contractoptimizationoverrideparameters
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/ContractOverrideParametersSerializer'
            - type: 'null'
          default: null
        unassignedOrdersOptionsGroupId:
          title: Unassignedordersoptionsgroupid
          anyOf:
            - type: string
            - type: 'null'
          default: null
        defaultTrafficSource:
          title: Defaulttrafficsource
          anyOf:
            - type: string
            - type: 'null'
          default: null
        trafficTimeOffsetWeeks:
          title: Traffictimeoffsetweeks
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        zones:
          title: Zones
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: Zone ids assigned to this strategy.
          default: null
        storeLocations:
          title: Storelocations
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: Store location ids assigned to this strategy.
          default: null
        softCapabilities:
          title: Softcapabilities
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          default: null
        searchLevel:
          title: Searchlevel
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        clusteringLevel:
          title: Clusteringlevel
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        softClusterLabel:
          title: Softclusterlabel
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
        balanceRoutes:
          anyOf:
            - $ref: '#/components/schemas/OptimizationBalanceRoutes'
            - type: 'null'
          default: null
        saveOptimizedRoutes:
          title: Saveoptimizedroutes
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
        dynamicCadenceConfig:
          anyOf:
            - $ref: '#/components/schemas/DynamicCadenceConfigInputSerializer'
            - type: 'null'
          default: null
        label:
          title: Label
          anyOf:
            - type: string
            - type: 'null'
          default: null
    NashValidationError:
      title: NashValidationError
      required:
        - error
        - response_status
        - RequestID
      type: object
      properties:
        error:
          $ref: '#/components/schemas/NashErrorDetails'
        response_status:
          title: Response Status
          type: string
        RequestID:
          title: Requestid
          type: string
    OptimizationScheduleInputSerializer:
      title: OptimizationScheduleInputSerializer
      type: object
      properties:
        cronExpression:
          title: Cronexpression
          anyOf:
            - type: string
            - type: 'null'
          description: Cron expression controlling when the strategy runs (input timezone).
          default: null
        startDate:
          title: Startdate
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Earliest time the schedule may fire.
          default: null
        endDate:
          title: Enddate
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Latest time the schedule may fire.
          default: null
        inputTimezoneId:
          title: Inputtimezoneid
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            IANA timezone id used to interpret the cron expression (e.g.
            'America/New_York').
          default: null
    ContractOverrideParametersSerializer:
      title: ContractOverrideParametersSerializer
      required:
        - contractId
      type: object
      properties:
        contractId:
          title: Contractid
          type: string
        vehicleCount:
          title: Vehiclecount
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        dispatchStrategyId:
          title: Dispatchstrategyid
          anyOf:
            - type: string
            - type: 'null'
          default: null
        leadTimeMinutes:
          title: Leadtimeminutes
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        fixedCost:
          title: Fixedcost
          anyOf:
            - type: number
            - type: 'null'
          default: null
        maxOrdersPerRoute:
          title: Maxordersperroute
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        minOrdersPerRoute:
          title: Minordersperroute
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        useAllVehicles:
          title: Useallvehicles
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
    OptimizationBalanceRoutes:
      title: OptimizationBalanceRoutes
      enum:
        - none
        - same_vehicle_type
        - all_vehicle_types
      type: string
    DynamicCadenceConfigInputSerializer:
      title: DynamicCadenceConfigInputSerializer
      required:
        - tiersBeforeCutoff
      type: object
      properties:
        tiersBeforeCutoff:
          title: Tiersbeforecutoff
          type: array
          items:
            $ref: '#/components/schemas/CadenceTierInputSerializer'
    NashErrorDetails:
      title: NashErrorDetails
      required:
        - code
        - message
      type: object
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
        details:
          title: Details
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          default: null
    CadenceTierInputSerializer:
      title: CadenceTierInputSerializer
      required:
        - intervalMinutes
      type: object
      properties:
        maxHours:
          title: Maxhours
          anyOf:
            - type: number
            - type: 'null'
          default: null
        intervalMinutes:
          title: Intervalminutes
          type: integer

````