---
title: "Create Optimization Strategy"
method: POST
path: "/v1/optimization-strategies"
tags: ["Optimization Strategies"]
---

# Create Optimization Strategy

`POST /v1/optimization-strategies`

## Request

- Base URL: `https://api.sandbox.usenash.com`
- URL: `https://api.sandbox.usenash.com/v1/optimization-strategies`
- Auth: none declared

Create a new optimization strategy for the authenticated organization. A strategy configures how orders are grouped into routes (service times, pickup-time windows, contracts, store locations, zones, and optional cron schedules).

## Request body

- CreateOptimizationStrategyInputSerializer
  - `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
  - `avoidFerries` boolean, nullable: Route around water crossings. Ferries are usually unusable by truck fleets, and the solver otherwise prices a sailing as ordinary driving time.
  - `minimizeZoneCrossings` boolean, nullable: Prefer fewer crossings of selected zone polygons in LogisticsOS. Null disables the preference.
  - `communityZoneIds` string[], nullable: Reusable zone references. Omit to preserve the selection; null or an empty list clears it.
  - `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'
  - `pickupSequencing` 'interleave' | 'after_deliveries': Where a strategy's pickup-only orders go on a route (OPT-805). `interleave` (also NULL): the solver places a pickup wherever capacity and windows allow. `after_deliveries`: every delivery is visited before any pickup-only stop on the same route.
  - `engineSolver` 'logistics_os' | 'here' | 'gmpro' | 'ptv': Which solver engine runs the optimization. Distinct from Nash's ``OptimizationProvider`` (nash_enums): that enum is the *persisted* provider on ``route.optimization_provider`` and includes non-solver values (MANUAL, NAIVE) alongside the vendors. ``OptimizationSolver`` is the narrower "which engine" selector for this module. Adding a solver here needs no schema change — ``route.optimization_provider`` is a plain varchar column — but it does need a new ``OptimizationProvider`` member and an entry in ``_SOLVER_TO_PROVIDER`` below. The mapping lives next to the enum precisely so that can't be missed: the engine originally shipped without it, and every engine-built route was recorded as LOGISTICS_OS (OPT-531).
  - `saveOptimizedRoutes` boolean, nullable
  - `dynamicCadenceConfig` DynamicCadenceConfigInputSerializer
    - `tiersBeforeCutoff` CadenceTierInputSerializer[], required
      - `maxHours` number, nullable
      - `intervalMinutes` integer, required
  - `label` string, required: Human-readable name for the strategy.

## Other responses

- `422`: Unprocessable Content

---

[API](https://skmtc.dev/nash/apis/nash-api.md) - [All operations](https://skmtc.dev/nash/apis/nash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nash/apis/nash-api/revisions/e3713837c5c9?raw)
