---
title: "Update Optimization Strategy"
method: PATCH
path: "/v1/optimization-strategies/{id}"
tags: ["Optimization Strategies"]
---

# Update Optimization Strategy

`PATCH /v1/optimization-strategies/{id}`

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

## Path parameters

- `id` string, required

## Request body

- UpdateOptimizationStrategyInputSerializer
  - `optimizationSchedules` OptimizationScheduleInputSerializer[], nullable
    - `cronExpression` string, nullable — Cron expression controlling when the strategy runs (input timezone).
    - `startDate` string, date-time, nullable — Earliest time the schedule may fire.
    - `endDate` string, date-time, nullable — Latest time the schedule may fire.
    - `inputTimezoneId` string, nullable — IANA timezone id used to interpret the cron expression (e.g. 'America/New_York').
  - `contractIds` string[], nullable — Contracts considered during optimization.
  - `shiftContractId` string, nullable — Contract id of the provider supplying shifts for this strategy.
  - `pickupServiceTimeSeconds` integer, nullable
  - `dropoffServiceTimeSeconds` integer, nullable
  - `incrementalServiceTimeSeconds` integer, nullable
  - `enableAutoDispatch` boolean, nullable
  - `autodispatchWithinXMinutesOfPickupTime` integer, nullable — Deprecated. Use pickup_time_from_in_minutes / pickup_time_to_in_minutes.
  - `earliestDispatchMinutesBeforePickup` integer, nullable — Deprecated. Use pickup_time_from_in_minutes / pickup_time_to_in_minutes.
  - `pickupTimeFromInMinutes` integer, nullable — Lower bound (inclusive) of the pickup time window to optimize, in minutes from now.
  - `pickupTimeToInMinutes` integer, nullable — Upper bound (exclusive) of the pickup time window to optimize, in minutes from now.
  - `contractOptimizationOverrideParameters` ContractOverrideParametersSerializer[], nullable
    - `contractId` string, required
    - `vehicleCount` integer, nullable
    - `dispatchStrategyId` string, nullable
    - `leadTimeMinutes` integer, nullable
    - `fixedCost` number, nullable
    - `maxOrdersPerRoute` integer, nullable
    - `minOrdersPerRoute` integer, nullable
    - `useAllVehicles` boolean, nullable
  - `unassignedOrdersOptionsGroupId` string, nullable
  - `defaultTrafficSource` string, nullable
  - `trafficTimeOffsetWeeks` integer, nullable
  - `zones` string[], nullable — Zone ids assigned to this strategy.
  - `storeLocations` string[], nullable — Store location ids assigned to this strategy.
  - `softCapabilities` string[], nullable
  - `searchLevel` integer, nullable
  - `clusteringLevel` integer, nullable
  - `softClusterLabel` boolean, nullable
  - `balanceRoutes` 'none' | 'same_vehicle_type' | 'all_vehicle_types'
  - `saveOptimizedRoutes` boolean, nullable
  - `dynamicCadenceConfig` DynamicCadenceConfigInputSerializer
    - `tiersBeforeCutoff` CadenceTierInputSerializer[], required
      - `maxHours` number, nullable
      - `intervalMinutes` integer, required
  - `label` string, nullable

## Other responses

- `422` — Unprocessable Content

---

[API](https://skmtc.net/usenash/apis/nash-api.md) · [All operations](https://skmtc.net/usenash/apis/nash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usenash/nash-api/revisions/09a23a95889b/schema)
