---
title: "Create Vehicle Assignment"
method: POST
path: "/vehicle_assignments"
tags: ["Vehicle Assignments"]
---

# Create Vehicle Assignment

`POST /vehicle_assignments`

## Request

- Base URL: `https://secure.fleetio.com/api`
- URL: `https://secure.fleetio.com/api/vehicle_assignments`
- 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/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new Vehicle Assignment.

## Request body

- object
  - `contact_employee_number` string: If the `Contact` being assigned has an employee number, it can be included here.
  - `contact_id` integer, required
  - `vehicle_id` integer, required
  - `started_at` string, date-time: 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: The date and time of this Vehicle Assignment ending. We recommend using [ISO-8601](/docs/overview/date-formatting) formatted dates to avoid ambiguity.
  - `custom_fields` CustomFields, nullable: *Full details on working with Custom Fields [here](/docs/overview/custom-fields).
  - `starting_meter_entry_attributes` object: A Vehicle Assignment may be associated with a starting [Meter Entry](/docs/api/meter-entries)
    - `value` number, float: The value is the actual number on the meter that increments over time. The unit is determined by the [configured `meter_unit`](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings) on the associated Vehicle.
    - `void` boolean: If you attempt to save a meter value, which is too high or too low, Fleetio's validation rules will reject it. If you need to bypass this validation, you may [mark an entry as void](https://help.fleetio.com/s/article/Meter-Entry-Mark-As-Void-Unmark-As-Void).
  - `ending_meter_entry_attributes` object: A Vehicle Assignment may also be associated with an ending [Meter Entry](/docs/api/meter-entries)
    - `value` number, float: The value is the actual number on the meter that increments over time. The unit is determined by the [configured `meter_unit`](https://help.fleetio.com/s/article/Fuel-Settings#vehicle-settings) on the associated Vehicle.
    - `void` boolean: If you attempt to save a meter value, which is too high or too low, Fleetio's validation rules will reject it. If you need to bypass this validation, you may [mark an entry as void](https://help.fleetio.com/s/article/Meter-Entry-Mark-As-Void-Unmark-As-Void).
  - `comments_attributes` CommentsAttributes[]
    - `title` string: The title of the comment.
    - `comment` string: The comment text.

## Response `201`

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
- `422`: Unprocessable Entity
- `500`: Something unexpected happened

## Changes

- **2026-11-06** `49558d744bd7`: 1 warning
  - the `comments_attributes/items/comment` request property's maxLength was set to `100000`

[Operation history](https://skmtc.dev/fleetio/apis/fleetio-developer-api/changes/vehicle_assignments/post.md)

---

[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)
