Skip to main content
POST
Get Imbalance Snapshot

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 an imbalance snapshot request.

This schema includes parameters such as location, time granularity, prediction horizon, and grid details.

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.

Response

Imbalance snapshot retrieved successfully with periods and zone-wise imbalance data.

Represents the response structure for an imbalance snapshot.

This schema includes the time periods and imbalance values for different zones.

periods
string<date-time>[]
required

Start of each time bucket (UTC) the imbalance is given for

zones
Zones · object
required

Imbalance per zone: zone id -> one value per entry of periods, in the same order. It is the number of vehicles projected to be parked in the zone minus the forecasted demand: positive means spare vehicles, negative means a shortage.