Skip to main content
POST
Get Rebalancing Suggestions

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Body

application/json

Defines the filters applicable to a rebalancing request.

.. deprecated:: Only used by the deprecated /rebalance endpoint. Use OperationsGenerationConfiguration from the /suggest endpoint instead.

This schema includes parameters to filter operation types and override default strategy configurations.

time_granularity_minutes
integer
required

Length of each forecast time bucket in minutes, e.g. 60. Together with prediction_horizon_size it must match one of the horizons enabled for your company; a 400 response lists them.

prediction_horizon_size
integer
required

Size of the prediction horizon in time steps (each one long time_granularity_minutes minutes)

grid
GridFilters · object
required

Grid schema defining the spatial structure for the forecast

zones_whitelist
string[] | null

Optional list of zone IDs to include in the response. If provided, only zones in this list will be returned.

zones_blacklist
string[] | null

Optional list of zone IDs to exclude from the response. Takes precedence over zones_whitelist when both are provided.

operation_types
string[] | null

Operation types to generate: any of battery_swap, pickup, dropoff. Omit for all three.

override_strat
PartialRebalanceConfig · object
deprecated

Partial override for strategy configuration. Only provided fields will override the default configuration, others will use default values.

Example:

null

vehicle_pool
string[] | null

Optional list of vehicle IDs to filter operations to. When provided, only vehicles in this pool will be considered for rebalancing operations.

complete_rebalance
boolean
default:true

When false, the number of pickup and dropoff operations will be balanced. If different numbers are generated, suggestions will be cut based on urgency.

upstream_tasks
UpstreamTask · object[] | null

Optional list of upstream tasks to be converted into operations. These tasks will be enriched with spatial and zone information from the retrieved vehicles and included in the suggestions list.

Response

Rebalancing suggestions retrieved successfully with recommended operations for optimization.

Represents the response structure for a rebalancing request.

.. deprecated:: Only used by the deprecated /rebalance endpoint. Use the /suggest endpoint and OperationsGenerationResponse instead.

This schema includes a list of suggested operations for rebalancing vehicles across different zones and time periods. It also includes the time periods for which the suggestions are provided.

periods
string<date-time>[]
required

list of time buckets for which the suggestions are provided

suggestions
Operation · object[]
required

list of rebalancing suggestions