Skip to main content
POST
Dispatch Session

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

Top-level dispatch payload — creates session + routes + operations + drivers.

slug
string
required

Unique session identifier you choose, e.g. a UUID. Used in the session URLs.

company_slug
string
required

Owning company: yours or another company you can manage.

routes
RouteCreate · object[]
required

Routes to create within this session.

Minimum array length: 1

Response

Session created successfully. Returns the complete session with routes, operations, and driver assignments.

Full session detail response (includes routes + operations).

slug
string
required

Session identifier.

company_slug
string
required

Owning company.

created_at
string<date-time>
required

When the session was dispatched.

updated_at
string<date-time> | null

Last update, if any.

routes
RoutePublic · object[]

Routes with their drivers and operations.