Skip to main content

Update Vehicle Assignment

PATCH 

https://secure.fleetio.com/api/v1/vehicle_assignments/:id

Update a Vehicle Assignment

Request

Path Parameters

    id stringrequired

    Possible values: Value must match regular expression ^[0-9]+$

    The id of the relevant record

Body

    contact_employee_numberstring

    If the Contact being assigned has an employee number, it can be included here.

    Possible values: <= 255 characters

    contact_idId (integer)

    Possible values: >= 1

    vehicle_idId (integer)

    Possible values: >= 1

    started_atdate-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.

    Example: 2023-03-14T13:46:27-06:00
    ended_atdate-time

    The date and time of this Vehicle Assignment ending. We recommend using ISO-8601 formatted dates to avoid ambiguity.

    Example: 2023-03-14T13:46:27-06:00
    custom_fieldsobjectnullable

    *Full details on working with Custom Fields here.

    starting_meter_entry_attributes object

    A Vehicle Assignment may be associated with a starting Meter Entry

    valuefloat

    The 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.

    Example: 108043
    voidboolean

    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.

    ending_meter_entry_attributes object

    A Vehicle Assignment may also be associated with an ending Meter Entry

    valuefloat

    The 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.

    Example: 108043
    voidboolean

    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.

    comments_attributes object[]
  • Array [
  • titlestring

    The title of the comment.

    commentstring

    The comment text.

  • ]

Responses

OK

Response Headers
    Schema
      idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      vehicle_idId (integer)required

      Possible values: >= 1

      contact_idId (integer)required

      Possible values: >= 1

      started_atdate-timenullablerequired

      The date and time of this Vehicle Assignment. Dates in the future are accepted. We recommend using ISO-8601 formatted dates to avoid ambiguity.

      Example: 2023-03-14T13:46:27-06:00
      ended_atdate-timenullablerequired

      The date and time of this Vehicle Assignment ending. We recommend using ISO-8601 formatted dates to avoid ambiguity.

      Example: 2023-03-14T13:46:27-06:00
      currentbooleanrequired

      Whether this Vehicle Assignment is current/active.

      Default value: false
      futurebooleanrequired

      Whether this Vehicle Assignment is set to take place in the future.

      Default value: false
      custom_fieldsobjectnullablerequired

      *Full details on working with Custom Fields here.

      starting_meter_entry_valuestringnullablerequired

      The meter value at the start of this Vehicle Assignment.

      ending_meter_entry_valuestringnullablerequired

      The meter value at the end of this Vehicle Assignment.

      comments_countintegerrequired

      The number of comments on this Vehicle Assignment.

      contact_full_namestringnullable
      contact_image_urlstringnullable

      The URL pointing to the Contact's image.

      attachment_permissions objectnullable
      read_photosboolean

      Indicates whether the user has read permission for photos.

      manage_photosboolean

      Indicates whether the user has permission to manage (eg. upload, delete) photos.

      read_documentsboolean

      Indicates whether the user has read permission for documents.

      manage_documentsboolean

      Indicates whether the user has permission to manage (eg. upload, delete) documents.

      comments object[]required

      Any Comments made on this Vehicle Assignment.

    • Array [
    • idId (integer)required

      Possible values: >= 1

      created_atdate-time

      The date and time at which this record was created.

      Example: 2023-03-14T13:46:27-06:00
      updated_atdate-time

      The date and time at which this record was most recently updated.

      Example: 2023-03-14T13:46:27-06:00
      commentable_typeCommentableType (string)required

      The type of record that the Comment will be left on. Must be associated with a matching commentable_id.

      Possible values: [Contact, FleetcorCard, FuelEntry, InventoryJournalEntry, Issue, Part, PurchaseOrder, ServiceEntry, ServiceReminder, SubmittedInspectionItem, Vehicle, VehicleAssignment, Vendor, WexCard, WorkOrder]

      commentable_idId (integer)required

      Possible values: >= 1

      user_idId (integer)required

      Possible values: >= 1

      titlestringdeprecated

      The title of the Comment.

      commentstringrequired

      The content of the Comment message body.

      user_full_namestringrequired

      The full name of the User who created the Comment.

      user_image_urlstringnullablerequired

      The image url for the User who created the Comment.

      rich_contentobjectnullablerequired
      html_contentstringnullablerequired

      The comment message body rendered as HTML.

      with_mentionsbooleanrequired

      Indicates if the message body contains @mentions.

    • ]

    Authorization: Authorization

    name: Authorizationtype: apiKeyin: headerdescription: Prefix the value with "Token", for example: "Token 76cbe06c49a64".
    You can generate a new API key [here](https://secure.fleetio.com/api_keys).
    name: Account-Tokentype: apiKeyin: headerdescription: You can find your Account-Token [here](https://secure.fleetio.com/api_keys)
    curl -L -X PATCH 'https://secure.fleetio.com/api/v1/vehicle_assignments/:id' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: <Authorization>' \
    -H 'Account-Token: <Authorization>' \
    -d '{
    "contact_employee_number": "string",
    "contact_id": 0,
    "vehicle_id": 0,
    "started_at": "2023-03-14T13:46:27-06:00",
    "ended_at": "2023-03-14T13:46:27-06:00",
    "custom_fields": {},
    "starting_meter_entry_attributes": {
    "value": "108043",
    "void": true
    },
    "ending_meter_entry_attributes": {
    "value": "108043",
    "void": true
    },
    "comments_attributes": [
    {
    "title": "string",
    "comment": "string"
    }
    ]
    }'
    Request Collapse all
    Base URL
    https://secure.fleetio.com/api
    Auth
    Parameters
    — pathrequired
    Body
    {
      "contact_employee_number": "string",
      "contact_id": 0,
      "vehicle_id": 0,
      "started_at": "2023-03-14T13:46:27-06:00",
      "ended_at": "2023-03-14T13:46:27-06:00",
      "custom_fields": {},
      "starting_meter_entry_attributes": {
        "value": "108043",
        "void": true
      },
      "ending_meter_entry_attributes": {
        "value": "108043",
        "void": true
      },
      "comments_attributes": [
        {
          "title": "string",
          "comment": "string"
        }
      ]
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!