---
title: "Update Ops Group"
method: PATCH
path: "/workers/ops-groups/{ops_group_handle}"
tags: ["Workers"]
---

# Update Ops Group

`PATCH /workers/ops-groups/{ops_group_handle}`

## Request

- Base URL: `https://v3.api.hypertrack.com`
- URL: `https://v3.api.hypertrack.com/workers/ops-groups/{ops_group_handle}`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/hypertrack/apis/hypertrack-api/docs/workers/ops-groups/:ops_group_handle/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update Ops Group by ops_group_handle

## Path parameters

- `ops_group_handle` string, required

## Request body

- PatchOpsGroupRequest
  - `ops_group_label` string, nullable: Display name for an Ops Group
  - `route_start_location` 'driver_home' | 'ops_group_home' | 'live_location' | 'null', nullable: Configuration to identify where routes are expected to start
  - `route_completion_type` 'end_at_last_order' | 'return_to_start_location' | 'manual' | 'null', nullable: Configuration to identify where routes are expected to end
  - `objective_fn` 'minimise_time' | 'minimise_distance' | 'null', nullable: Configuration to identify the metric used by the solver when generating optimized routes
  - `ops_group_home` union: Location of the Ops Group
    - OpsGroupHomeRequest
      - `geometry` LocationGeometry, required
        - `type` 'Point', required: Geometry type
        - `coordinates` number[], required: Location coordinates represented as [longitude, latitude]
      - `address` string, nullable: Address of the Ops Group home
    - unknown
  - `default_shift_start_time` string, nullable: Default time HH:mm when the shift starts for drivers
  - `default_shift_end_time` string, nullable: Default time HH:mm when the shift ends for drivers
  - `route_capacity` integer, nullable: Maximum number of orders in a route
  - `route_max_distance` integer, nullable: Maximum distance in meters used by the resolver to constrain each route distance
  - `timezone` string, nullable: IANA timezone of the Ops Group
  - `shift_availability_mode` 'auto' | 'manual' | 'null', nullable: Flag to start/stop availability of all drivers based on the ops group shift
  - `order_tracking_mode` string, nullable: Order tracking mode associated with the ops-group
  - `order_tracking_automation` union: A configuration object to enable/disable and customize automatic order tracking.
    - OpsGroupOrderTrackingAutomation
      - `mode` 'auto' | 'auto_start' | 'auto_stop' | 'null', nullable: Controls what automation should occur. <ul> <li>`"auto"`: Automatically start <em>and</em> stop tracking based on the `type`.</li> <li>`"auto_start"`: Only automatically <em>start</em> tracking.</li> <li>`"auto_stop"`: Only automatically <em>stop</em> tracking.</li> </ul>
      - `lead_time` integer, nullable: Defines how <em>early</em> tracking should begin, relative to a key event. <ul> <li>If `type` is `"shift"`: Starts `lead_time` seconds <em>before</em> the driver's schedule `start_time`.</li> <li>If `type` is `"order"`: Starts `lead_time` seconds <em>before</em> the driver's <strong>first</strong> assigned order's `scheduled_at` time.</li> <li>If `type` is `"route"` or `"order_and_route"`: Starts `lead_time` seconds <em>before</em> the driver's assigned route's `scheduled_start_at` time.</li> </ul>
      - `lag_time` integer, nullable: Defines how <em>late</em> tracking should stop, relative to a key event. <ul> <li>If `type` is `"shift"`: Stops `lag_time` seconds <em>after</em> the driver's schedule `end_time`.</li> <li>If `type` is `"order"`: Stops `lag_time` seconds <em>after</em> the driver's <strong>last</strong> order is completed.</li> </ul> <strong>Important:</strong> Tracking will <em>not</em> automatically stop if the driver still has active orders.
      - `type` 'manual' | 'shift' | 'order' | 'route' | 'order_and_route', required: Defines the basis for automation. The value of this field determines how the rest of the configuration is interpreted. <ul> <li>`"manual"`: No automation. Tracking must be manually started and stopped. All other fields are ignored.</li> <li>`"shift"`: Automation is based on the driver's scheduled shift times.</li> <li>`"order"`: Automation is based on the driver's assigned order times.</li> <li>`"route"`: Automation is based on the driver's assigned route scheduled start times.</li> <li>`"order_and_route"`: Automation is based on the driver's assigned order and route scheduled start times.</li> </ul>
      - `approval` union: Approval automation settings.
        - ApprovalAutomation
          - `auto_cancel` boolean, required: Whether to auto-cancel unapproved approvals
          - `cancel_before_scheduled_in_seconds` integer, nullable: Time before scheduled at of order to cancel approvals automatically
        - unknown
      - `acceptance` union: Acceptance automation settings.
        - AcceptanceAutomation
          - `auto_cancel` boolean, required: Whether to auto-cancel unaccepted acceptances
          - `cancel_before_scheduled_in_seconds` integer, nullable: Time before scheduled event to cancel acceptances automatically
        - unknown
    - unknown
  - `work_status_automation` WorkStatusAutomation[], nullable: List of configuration object to enable/disable and customize automatic work status updation. If `null`, the default behavior is equivalent to: `{"type": "manual"}`.
    - `mode` 'auto' | 'auto_start' | 'auto_stop' | 'null', nullable: Controls what automation should occur. <ul> <li>`"auto"`: Automatically toggle <em>and</em> work status based on the `type`.</li> <li>`"auto_start"`: Only automatically set <em>start</em> work status based on the `type`.</li> <li>`"auto_stop"`: Only automatically reset <em>stop</em> work status based on the `type`.</li> </ul>
    - `type` 'manual' | 'tracking' | 'available', required: Defines the basis for automation. The value of this field determines how the rest of the configuration is interpreted. <ul> <li>`"manual"`: No Automation. Work status to be managed manually.</li> <li>`"tracking"`: Automate tracking controls based on worker/ops-group schedule.</li> <li>`"available"`: Automate availability controls based on worker/ops-group schedule.</li> </ul>
  - `schedule` union[], nullable: List of schedules used for ops group workers matching during order planning and auto start/stop of availability or tracking of the workers
    - union
      - OpsGroupDateSchedule
        - `start_time` string, required: Start time of day represented by HH:mm for all the workers belonging to ops group
        - `end_time` string, required: End time of day represented by HH:mm for all the workers belonging to ops group
        - `date` string, required: Date for which for all the workers belonging to ops group are available for work
        - `priority` integer, nullable: Priority of schedule
      - OpsGroupRecurringSchedule
        - `start_time` string, required: Start time of day represented by HH:mm for all the workers belonging to ops group
        - `end_time` string, required: End time of day represented by HH:mm for all the workers belonging to ops group
        - `day_of_week` 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY', required: Day of the week when ops group workers are available for work
        - `priority` integer, nullable: Priority of schedule
  - `app_config` object, nullable: Configuration specific to order's app
  - `operations_radius` integer, nullable: Maximum distance in meters from the ops group home within which order destinations are allowed
  - `enforce_operations_radius` boolean, nullable: Whether to enforce operations_radius validation at order creation time

## Response `200`

Successful response

- PatchOpsGroupResponse
  - `ops_group_handle` string, required: Unique identifier for an Ops Group
  - `ops_group_label` string, required: Identifier label for an Ops Group
  - `timezone` string, required: IANA timezone of the Ops Group
  - `route_start_location` string: Configuration to identify where routes are expected to start
  - `route_completion_type` string: Configuration to identify where routes are expected to end
  - `objective_fn` string: Configuration to identify the metric used by the solver when generating optimized routes
  - `ops_group_home` OpsGroupHome
    - `geometry` LocationGeometry, required
      - `type` 'Point', required: Geometry type
      - `coordinates` number[], required: Location coordinates represented as [longitude, latitude]
    - `address` string, nullable: Address for the Ops Group home
  - `default_shift_start_time` string: Default time HH:mm when the shift starts for drivers
  - `default_shift_end_time` string: Default time HH:mm when the shift ends for drivers
  - `route_capacity` integer, required: Maximum number of orders in a route
  - `route_max_distance` integer, required: Maximum distance in meters used by the resolver to constrain each route distance
  - `deleted` boolean: Flag to include deleted ops groups
  - `deleted_at` string: Timestamp at which the OpsGroup was deleted
  - `shift_availability_mode` string, required: Flag to start/stop availability of all drivers based on the ops group shift
  - `order_tracking_mode` string, nullable: Order tracking mode associated with the ops-group
  - `schedule` union[], nullable: List of schedules used for ops group workers for work assignment and shift tracking
    - union
      - OpsGroupDateSchedule
        - `start_time` string, required: Start time of day represented by HH:mm for all the workers belonging to ops group
        - `end_time` string, required: End time of day represented by HH:mm for all the workers belonging to ops group
        - `date` string, required: Date for which for all the workers belonging to ops group are available for work
        - `priority` integer, nullable: Priority of schedule
      - OpsGroupRecurringSchedule
        - `start_time` string, required: Start time of day represented by HH:mm for all the workers belonging to ops group
        - `end_time` string, required: End time of day represented by HH:mm for all the workers belonging to ops group
        - `day_of_week` 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY', required: Day of the week when ops group workers are available for work
        - `priority` integer, nullable: Priority of schedule
  - `order_tracking_automation` union: A configuration object to enable/disable and customize automatic order tracking.
    - OpsGroupOrderTrackingAutomation
      - `mode` 'auto' | 'auto_start' | 'auto_stop' | 'null', nullable: Controls what automation should occur. <ul> <li>`"auto"`: Automatically start <em>and</em> stop tracking based on the `type`.</li> <li>`"auto_start"`: Only automatically <em>start</em> tracking.</li> <li>`"auto_stop"`: Only automatically <em>stop</em> tracking.</li> </ul>
      - `lead_time` integer, nullable: Defines how <em>early</em> tracking should begin, relative to a key event. <ul> <li>If `type` is `"shift"`: Starts `lead_time` seconds <em>before</em> the driver's schedule `start_time`.</li> <li>If `type` is `"order"`: Starts `lead_time` seconds <em>before</em> the driver's <strong>first</strong> assigned order's `scheduled_at` time.</li> <li>If `type` is `"route"` or `"order_and_route"`: Starts `lead_time` seconds <em>before</em> the driver's assigned route's `scheduled_start_at` time.</li> </ul>
      - `lag_time` integer, nullable: Defines how <em>late</em> tracking should stop, relative to a key event. <ul> <li>If `type` is `"shift"`: Stops `lag_time` seconds <em>after</em> the driver's schedule `end_time`.</li> <li>If `type` is `"order"`: Stops `lag_time` seconds <em>after</em> the driver's <strong>last</strong> order is completed.</li> </ul> <strong>Important:</strong> Tracking will <em>not</em> automatically stop if the driver still has active orders.
      - `type` 'manual' | 'shift' | 'order' | 'route' | 'order_and_route', required: Defines the basis for automation. The value of this field determines how the rest of the configuration is interpreted. <ul> <li>`"manual"`: No automation. Tracking must be manually started and stopped. All other fields are ignored.</li> <li>`"shift"`: Automation is based on the driver's scheduled shift times.</li> <li>`"order"`: Automation is based on the driver's assigned order times.</li> <li>`"route"`: Automation is based on the driver's assigned route scheduled start times.</li> <li>`"order_and_route"`: Automation is based on the driver's assigned order and route scheduled start times.</li> </ul>
      - `approval` union: Approval automation settings.
        - ApprovalAutomation
          - `auto_cancel` boolean, required: Whether to auto-cancel unapproved approvals
          - `cancel_before_scheduled_in_seconds` integer, nullable: Time before scheduled at of order to cancel approvals automatically
        - unknown
      - `acceptance` union: Acceptance automation settings.
        - AcceptanceAutomation
          - `auto_cancel` boolean, required: Whether to auto-cancel unaccepted acceptances
          - `cancel_before_scheduled_in_seconds` integer, nullable: Time before scheduled event to cancel acceptances automatically
        - unknown
    - unknown
  - `work_status_automation` WorkStatusAutomation[], nullable: List of configuration object to enable/disable and customize automatic work status updation. If `null`, the default behavior is equivalent to: `{"type": "manual"}`.
    - `mode` 'auto' | 'auto_start' | 'auto_stop' | 'null', nullable: Controls what automation should occur. <ul> <li>`"auto"`: Automatically toggle <em>and</em> work status based on the `type`.</li> <li>`"auto_start"`: Only automatically set <em>start</em> work status based on the `type`.</li> <li>`"auto_stop"`: Only automatically reset <em>stop</em> work status based on the `type`.</li> </ul>
    - `type` 'manual' | 'tracking' | 'available', required: Defines the basis for automation. The value of this field determines how the rest of the configuration is interpreted. <ul> <li>`"manual"`: No Automation. Work status to be managed manually.</li> <li>`"tracking"`: Automate tracking controls based on worker/ops-group schedule.</li> <li>`"available"`: Automate availability controls based on worker/ops-group schedule.</li> </ul>
  - `app_config` object, nullable: Configuration specific to order's app
  - `operations_radius` integer, nullable: Maximum distance in meters from the ops group home within which order destinations are allowed
  - `enforce_operations_radius` boolean, nullable: Whether to enforce operations_radius validation at order creation time

## Other responses

- `400`: Validation error
- `401`: Authentication error
- `404`: Not found

---

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