Create Vehicle Assignment
Creates a new Vehicle Assignment
- application/json
Request Body
- contact_employee_number string
Possible values:
<= 255 characters
If the
Contact
being assigned has an employee number, it can be included here. - contact_id integer required
Possible values:
>= 1
- vehicle_id integer required
Possible values:
>= 1
- started_at date-time
The date and time of this Vehicle Assignment. Dates in the future are accepted. We recommend using ISO-8601 formatted dates to avoid ambiguity.
- ended_at date-time
The date and time of this Vehicle Assignment ending. We recommend using ISO-8601 formatted dates to avoid ambiguity.
- custom_fields object
*Full details on working with Custom Fields here.
starting_meter_entry_attributes object
A Vehicle Assignment may be associated with a starting Meter Entry
value floatThe value is the actual number on the meter that increments over time. The unit is determined by the configured
meter_unit
on the associated Vehicle.void booleanIf 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.
ending_meter_entry_attributes object
A Vehicle Assignment may also be associated with an ending Meter Entry
value floatThe value is the actual number on the meter that increments over time. The unit is determined by the configured
meter_unit
on the associated Vehicle.void booleanIf 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.
comments_attributes object[]
title stringThe title of the comment.
comment stringThe comment text.
- 201
- 401
- 403
- 422
- 500
OK
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
- id integer
Possible values:
>= 1
- created_at date-time
The date and time at which this record was created.
- updated_at date-time
The date and time at which this record was most recently updated.
- vehicle_id integer
Possible values:
>= 1
- contact_id integer
Possible values:
>= 1
- started_at date-time
The date and time of this Vehicle Assignment. Dates in the future are accepted. We recommend using ISO-8601 formatted dates to avoid ambiguity.
- ended_at date-time
The date and time of this Vehicle Assignment ending. We recommend using ISO-8601 formatted dates to avoid ambiguity.
- current boolean
Default value:
false
Whether this Vehicle Assignment is current/active.
- future boolean
Default value:
false
Whether this Vehicle Assignment is set to take place in the future.
- custom_fields object
*Full details on working with Custom Fields here.
- starting_meter_entry_value string
The meter value at the start of this Vehicle Assignment.
- ending_meter_entry_value string
The meter value at the end of this Vehicle Assignment.
- comments_count integer
The number of comments on this Vehicle Assignment.
- contact_full_name string
- contact_image_url string
The URL pointing to the
Contact
's image. attachment_permissions object
read_photos booleanIndicates whether the user has read permission for photos.
manage_photos booleanIndicates whether the user has permission to manage (eg. upload, delete) photos.
read_documents booleanIndicates whether the user has read permission for documents.
manage_documents booleanIndicates whether the user has permission to manage (eg. upload, delete) documents.
comments object[]
Any
Comments
made on this Vehicle Assignment.id integerPossible values:
>= 1
created_at date-timeThe date and time at which this record was created.
updated_at date-timeThe date and time at which this record was most recently updated.
commentable_type CommentableTypePossible values: [
Contact
,FleetcorCard
,FuelEntry
,InventoryJournalEntry
,Issue
,Part
,PurchaseOrder
,ServiceEntry
,ServiceReminder
,SubmittedInspectionItem
,Vehicle
,VehicleAssignment
,Vendor
,WexCard
,WorkOrder
]The type of record that the Comment will be left on. Must be associated with a matching
commentable_id
.commentable_id integerPossible values:
>= 1
user_id integerPossible values:
>= 1
title string deprecatedThe title of the Comment.
comment stringThe content of the Comment message body.
user_full_name stringThe full name of the
User
who created the Comment.user_image_url stringThe image url for the
User
who created the Comment.rich_content objecthtml_content stringThe comment message body rendered as HTML.
with_mentions booleanIndicates if the message body contains @mentions.
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"vehicle_id": 0,
"contact_id": 0,
"started_at": "2023-03-14T13:46:27-06:00",
"ended_at": "2023-03-14T13:46:27-06:00",
"current": false,
"future": false,
"custom_fields": {},
"starting_meter_entry_value": "string",
"ending_meter_entry_value": "string",
"comments_count": 0,
"contact_full_name": "string",
"contact_image_url": "string",
"attachment_permissions": {
"read_photos": true,
"manage_photos": true,
"read_documents": true,
"manage_documents": true
},
"comments": [
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"commentable_type": "Contact",
"commentable_id": 0,
"user_id": 0,
"comment": "string",
"user_full_name": "string",
"user_image_url": "string",
"rich_content": {},
"html_content": "string",
"with_mentions": true
}
]
}
Request could not be authenticated
- application/json
- Schema
- Example (from schema)
Schema
- status integer
Possible values:
>= 400
and<= 599
- title string
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
- detail string
A human-readable explanation specific to this occurrence of the problem.
- instance string
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Insufficient permission to perform this operation
- application/json
- Schema
- Example (from schema)
Schema
- status integer
Possible values:
>= 400
and<= 599
- title string
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
- detail string
A human-readable explanation specific to this occurrence of the problem.
- instance string
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Unprocessable Entity
- application/json
- Schema
- Example (from schema)
- Example
Schema
errors object
typeitems string
{
"errors": {}
}
{
"errors": {
"field1": [
"error1",
"error2"
],
"field2": [
"error3"
]
}
}
Something unexpected happened
- application/json
- Schema
- Example (from schema)
Schema
- status integer
Possible values:
>= 400
and<= 599
- title string
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
- detail string
A human-readable explanation specific to this occurrence of the problem.
- instance string
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}