Create a new vehicle

Log in to see full request history

Purpose: Use this API to create a vehicle on the Motive Fleet Dashboard for your organisation. It is important to note that whenever you create a vehicle, a vehicle gateway must be installed, and you must assign the vehicle gateway to it, so that you can track the vehicle and also get the respective metrics.

📘

External IDs

External IDs are the unique identifiers assigned by an external system or an integration. When you enter the external ID, you must also mention the integration it is associated with. The combination of the external ID and the integration name will always be unique. Below are the steps that you must take in order to add an external ID to the endpoint.

Apart from adding the following to the request body, you must also add the external_id and the integration_name in the Body Parameters. Refer to the Body Parameters section for more info.

External IDs

To add an external ID to the vehicle, take the following steps:

  1. Add the following request to the body:

  2. { "number":"toyota_32", # other attributes for a vehicle ... ... ... # add external id for vehicle "external_ids_attributes":[ { "external_id":"987", "integration_name":"generic_tms" } ] }
  3. require 'uri' require 'net/http' require 'json' url = URI('https://api.gomotive.com/v1/vehicles') http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request['Authorization'] = "Bearer <OAUTH_TOKEN>" request['Content-Type'] = 'application/json' params = { :company_id => 1, :number => "Demo Vehicle", :status => "active", :ifta => true, :vin => "WP0AB2966NS458669", :make => "Demo", :model => "Vehicle", :year => "2016", :license_plate_state => "CA", :license_plate_number => "5M37250", :metric_units => false, :notes => "Demo Notes", :fuel_type => "diesel", :eld_device => { :id => 2, :identifier => "000074802542164638439715893965", :model => "lbb-1" }, :current_driver => { :id => 11, :first_name => "Demo", :last_name => "Driver", :username => "demo_driver", :email => nil, :driver_company_id => nil, :status => "active", :role => "driver" } } request.body = params.to_json response = http.request(request) puts response.read_body

Response Parameters

vehicle

  • Type: Object
  • Description: Denotes the object that contains the vehicle information that has been created.

vehicle Object

id

  • Type: String
  • Description: The unique identifier assigned to the vehicle.

company_id

  • Type: Number
  • Description: The unique identifier of the company to which the vehicle belongs.

number

  • Type: String
  • Description: The fleet number assigned to the vehicle.

status

  • Type: String
  • Description: The status of the vehicle (e.g., "active").

ifta

  • Type: Boolean
  • Description: Indicates whether the vehicle is subject to International Fuel Tax Agreement (IFTA) reporting.

vin

  • Type: String
  • Description: The Vehicle Identification Number (VIN).

make

  • Type: String
  • Description: The manufacturer of the vehicle. For example, Ford.

model

  • Type: String
  • Description: The model of the vehicle. For example, Expedition.

year

  • Type: String
  • Description: The year the vehicle was manufactured. For example, 2024.

license_plate_state

  • Type: String
  • Description: The state of the vehicle's license plate.

license_plate_number

  • Type: String
  • Description: The license plate number of the vehicle.

metric_units

  • Type: Boolean
  • Description: Indicates whether the vehicle's measurements are in metric units.

fuel_type

  • Type: String
  • Description: The type of fuel the vehicle uses (e.g., "diesel").

group_ids

  • Type: Array
  • Description: A list of group IDs assigned to the vehicle.

created_at

  • Type: DateTime
  • Description: The timestamp when the vehicle was created.

updated_at

  • Type: DateTime
  • Description: The timestamp when the vehicle was last updated.

eld_device

  • Type: String
  • Description: The ELD device associated with the vehicle, if any.

id

  • Type: Integer
  • Description: The ID of the vehicle gateway that has been assigned to the vehicle.

identifier

  • Type: Integer
  • Description: The unique identifier of the vehicle gateway.

model

  • Type: String
  • Description: The model of the vehicle.

current_driver

  • Type: String
  • Description: The current driver of the vehicle, if any.

id

  • Type: Integer
  • Description: The unique identifier of the driver.

first_name

  • Type: String
  • Description: The first name of the driver.

last_name

  • Type: String
  • Description: The last name of the driver.

username

  • Type: String
  • Description: The username assigned to the driver.

email

  • Type: String
  • Description: The email address of the driver.

driver_company_id

  • Type: Integer
  • Description: The ID of the driver assigned by the company.

status

  • Type: String
  • Description: The status of the driver in the company. For example, Active.

role

  • Type: String
  • Description: The role of the user as per the company. For example, Driver.

external_ids

  • Type: Array
  • Description: A list of external identifiers associated with the vehicle.

Body Params
int32
required

A unique number assigned to the vehicle that you are creating. NOTE: Ensure to add a unique number for each vehicle that you create. If you use an existing number, the system will notify that you are using an existing number.

int32

Specify the ID number of the vehicle gateway that is assigned to the vehicle.

boolean

Specify if the vehicle is part of the IFTA calculations. TRUE: Denotes that the vehicle is part of the calculations. FALSE: The vehicle is not part of the calculations.

boolean

Specify if the is using Metric Units or the Imperial Units. TRUE: Uses the metric units. FALSE: Uses the imperial units.

string

Specify the type of the fuel the vehicle is using. Allowed values are: diesel, gasoline, propane, lng, cng, ethanol, methanol, e85, m85, a55, biodiesel, and other.

string

Specify the Vehicle Identification Number (VIN).

string

Specify the state where the license number was issued.

string

Specify the license number plate of the vehicle.

string

Specify the make of the vehicle.

string

Specify the model of the vehicle.

string

Specify the year when the vehicle was manufactured.

boolean

Specify if the vehicle prevents an auto odometer entry. TRUE: The vehicle prevents the odometer entry. FALSE: The vehicle does not prevent the odometer entry.

array of objects

Specify the external ID, as well as the associated integration name for the vehicle.

external_ids_attributes
int32

Specify the permanent driver ID that is assigned to the driver of the vehicle.

string

Mention any notes for the vehicle that you are creating.

array of int32s

Specify the IDs of the group with which the vehicle is associated.

group_ids
int32
Defaults to -1

Denotes if the recording of the driver facing camera is enabled or not. Allowed values are: -1: no_override (meaning cannot be overridden), 0: No recording, 1: Recording enabled, 2: No recording while idling, & 3: Recording enabled if engine in ON.

int32
Defaults to -1

Denotes if the audio from the driver's cab is being recorded or not. Allowed values are: -1: No manual override, 0: No recording of audio, 1: Audio recording enabled.

Headers
string

Specify the timezone for formatting the timestamps.

boolean

Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units

int32

Specify the ID of the Fleet Admin or the Fleet Manager who is accessing this endpoint.

Responses

Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json