---
title: "Unassign Vehicle Assignment"
method: PATCH
path: "/vehicle_assignments/{id}/unassign"
tags: ["Vehicle Assignments"]
---

# Unassign Vehicle Assignment

`PATCH /vehicle_assignments/{id}/unassign`

## Request

- Base URL: `https://secure.fleetio.com/api`
- URL: `https://secure.fleetio.com/api/vehicle_assignments/{id}/unassign`
- Auth: API key in header `Authorization` and API key in header `Account-Token`
- TypeScript: <https://skmtc.dev/fleetio/apis/fleetio-developer-api/docs/vehicle_assignments/:id/unassign/patch.ts> (a function with typed inputs; its response is checked against the schema)

Immediately End a Vehicle Assignment

## Path parameters

- `id` string, required

## Response `200`

OK

- VehicleAssignment, nullable: A Vehicle Assignment
  - `id` integer, required
  - `created_at` string, date-time: The date and time at which this record was created.
  - `updated_at` string, date-time: The date and time at which this record was most recently updated.
  - `vehicle_id` integer, required
  - `contact_id` integer, required
  - `started_at` string, date-time, nullable, required: The date and time of this Vehicle Assignment. Dates in the future are accepted. We recommend using [ISO-8601](/docs/overview/date-formatting) formatted dates to avoid ambiguity.
  - `ended_at` string, date-time, nullable, required: The date and time of this Vehicle Assignment ending. We recommend using [ISO-8601](/docs/overview/date-formatting) formatted dates to avoid ambiguity.
  - `current` boolean, required: Whether this Vehicle Assignment is current/active.
  - `future` boolean, required: Whether this Vehicle Assignment is set to take place in the future.
  - `custom_fields` CustomFields, nullable, required: *Full details on working with Custom Fields [here](/docs/overview/custom-fields).
  - `starting_meter_entry_value` string, nullable, required: The meter value at the start of this Vehicle Assignment.
  - `ending_meter_entry_value` string, nullable, required: The meter value at the end of this Vehicle Assignment.
  - `comments_count` integer, required: The number of comments on this Vehicle Assignment.
  - `contact_full_name` string, nullable
  - `contact_image_url` string, nullable: The URL pointing to the `Contact`'s image.
  - `attachment_permissions` AttachmentPermissions, nullable
    - `read_photos` boolean: Indicates whether the user has read permission for photos.
    - `manage_photos` boolean: Indicates whether the user has permission to manage (eg. upload, delete) photos.
    - `read_documents` boolean: Indicates whether the user has read permission for documents.
    - `manage_documents` boolean: Indicates whether the user has permission to manage (eg. upload, delete) documents.
  - `comments` Comment[], required: Any `Comments` made on this Vehicle Assignment.
    - `id` integer, required
    - `created_at` string, date-time: The date and time at which this record was created.
    - `updated_at` string, date-time: The date and time at which this record was most recently updated.
    - `commentable_type` 'Contact' | 'FleetcorCard' | 'FuelEntry' | 'InventoryJournalEntry' | 'Issue' | 'Part' | 'PurchaseOrder' | 'ServiceEntry' | 'ServiceReminder' | 'SubmittedInspectionItem' | 'Vehicle' | 'VehicleAssignment' | 'Vendor' | 'WexCard' | 'WorkOrder', required: The type of record that the Comment will be left on. Must be associated with a matching `commentable_id`.
    - `commentable_id` integer, required
    - `user_id` integer, required
    - `title` string: The title of the Comment.
    - `comment` string, required: The content of the Comment message body.
    - `user_full_name` string, required: The full name of the `User` who created the Comment.
    - `user_image_url` string, nullable, required: The image url for the `User` who created the Comment.
    - `rich_content` object, nullable, required
    - `html_content` string, nullable, required: The comment message body rendered as HTML.
    - `with_mentions` boolean, required: Indicates if the message body contains @mentions.

## Other responses

- `401`: Request could not be authenticated
- `403`: Insufficient permission to perform this operation
- `404`: The requested resource could not be located
- `422`: Unprocessable Entity
- `500`: Something unexpected happened

---

[API](https://skmtc.dev/fleetio/apis/fleetio-developer-api.md) - [All operations](https://skmtc.dev/fleetio/apis/fleetio-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fleetio/apis/fleetio-developer-api/revisions/49558d744bd7?raw)
