> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.getswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Driver from Route

> Remove a driver from a route. The driver no longer sees the route in `assigned_to_me`.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or you cannot manage the route's company
- **404**: No route with this ID, or the driver is not assigned to it

**Required Auth Scopes:**
- `routing-operations:manage`



## OpenAPI

````yaml /api-reference/openapi.json delete /operations/routes/{route_id}/drivers/{user_id}
openapi: 3.1.0
info:
  title: SWITCH API
  version: '1.0'
  description: >-
    The SWITCH API gives mobility and logistics teams programmatic access to
    SWITCH forecasts, fleet operations, routing and analytics. Every request is
    authenticated with an API key sent as a bearer token.
servers:
  - url: https://stage-api.getswitch.io
    description: Stage
security: []
tags:
  - name: Forecast
    description: Demand forecasts per zone and time window.
  - name: Operations
    description: Fleet imbalance, rebalancing suggestions and generated tasks.
  - name: Routing
    description: Route optimisation for single and multiple fleets.
  - name: Routing Sessions
    description: Saved routing sessions, their routes and drivers.
  - name: Routing Operations
    description: Complete, undo and re-route the stops of a route.
  - name: Fleet Management
    description: Your depots, stations, drivers and cargo vehicles.
  - name: Integrations
    description: Vehicles, statuses and commands on your fleet platform.
  - name: Station Based Analytics
    description: Analytics for station-based (docked) services.
  - name: Zone Based Analytics
    description: Analytics for free-floating services, by zone.
  - name: Free Float Analytics
    description: Trip history for free-floating services.
  - name: Transit Analytics
    description: Punctuality and service delivery for public transit.
  - name: Live
    description: Real-time fleet, delivery and transit status.
  - name: Grids
    description: Spatial grids used by forecasts and analytics.
  - name: API Keys
    description: Create and manage the API keys you call this API with.
paths:
  /operations/routes/{route_id}/drivers/{user_id}:
    delete:
      tags:
        - Routing Sessions
      summary: Remove Driver from Route
      description: >-
        Remove a driver from a route. The driver no longer sees the route in
        `assigned_to_me`.


        **Failure Modes:**

        - **401**: Token is missing or invalid

        - **403**: Insufficient permissions, or you cannot manage the route's
        company

        - **404**: No route with this ID, or the driver is not assigned to it


        **Required Auth Scopes:**

        - `routing-operations:manage`
      operationId: remove_route_driver
      parameters:
        - name: route_id
          in: path
          required: true
          schema:
            type: integer
            description: Route ID, from the session detail or the route list.
            title: Route Id
          description: Route ID, from the session detail or the route list.
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
            description: User ID of the driver to remove (`id` in `drivers`).
            title: User Id
          description: User ID of the driver to remove (`id` in `drivers`).
      responses:
        '204':
          description: Driver removed. No content returned.
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '404':
          description: Not Found. Route or assignment not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.