Update a user

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Purpose: Use this API to update an existing user. You must specify the ID of the user whose details you want to update. You can also specify the External ID of the user associated with an integration.

Update: Validation for time_tracking_mode

We have now updated this endpoint with validation, so that the value of time_tracking_mode is compatible with the value of eld_mode.

Ensure that the values of time_tracking_mode correspond to the following values of eld_mode:

Time Tracking Mode ValueMust match the following ELD Mode Value
LogsNone or Logs
TimecardsExempt
Not_requiredExempt

Here is an explanation of the scenarios:

Time Tracking Mode ValueELD Mode ValueResult
LogsLogsThe driver need not maintain the log manually, as everything is recorded by the Vehicle Gateway.
LogsNoneThe driver must manually maintain an Electronic Logbook on the Motive Driver app. Logging will be disabled on the Vehicle Gateway.
TimecardsExemptThe driver is exempt from maintaining logs and will use Motive Timecards in the Driver App to track their time.
Not_requiredExemptThe driver is exempt from maintaining logs and is not required to track their time within Motive.

NOTE: Only the above-mentioned combinations are valid and rest all are considered invalid. The API will also validate the combinations and will throw a corresponding error when an invalid combination is found.

Add External Ids

To add one or more external ids follow the same format as mentioned in POST /v1/users endpoint documentation.

{
  "email":"acme@example.com",
  "first_name":"John",
  "last_name":"Doe",
  # other attributes for a user
  ...
  ...
  ...
  # add external id for user
  "external_ids_attributes":[
    {    
    "id": "9876",    
    "external_id": "987",
    "integration_name": "generic_tms"
}
  ]
}

require 'uri'
require 'net/http'
require 'json'

url = URI('https://api.gomotive.com/v1/users/<id>')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'
params = {
    :email                        => nil,
    :first_name                   => "John",
    :last_name                    => "Doe",
    :phone                        => nil,
    :phone_country_code           => nil,
    :phone_ext                    => nil,
    :time_zone                    => nil,
    :carrier_name                 => nil,
    :carrier_street               => nil,
    :carrier_city                 => nil,
    :carrier_state                => nil,
    :carrier_zip                  => nil,
    :violation_alerts             => "1_hour",
    :terminal_street              => nil,
    :terminal_city                => nil,
    :terminal_state               => nil,
    :terminal_zip                 => nil,
    :exception_24_hour_restart    => false,
    :exception_8_hour_break       => false,
    :exception_wait_time          => false,
    :exception_short_haul         => false,
    :exception_ca_farm_school_bus => false,
    :exception_adverse_driving    => false,
    :export_combined              => true,
    :export_recap                 => true,
    :export_odometers             => true,
    :metric_units                 => false,
    :username                     => "john.doe.demo.fleet",
    :password                     => "password",
    :cycle                        => nil,
    :driver_company_id            => nil,
    :minute_logs                  => false,
    :duty_status                  => "off_duty",
    :eld_mode                     => "none",
    :drivers_license_number       => nil,
    :drivers_license_state        => nil,
    :yard_moves_enabled           => false,
    :personal_conveyance_enabled  => false,
    :manual_driving_enabled       => false,
    :role                         => "driver",
    :status                       => "active",
    :dot_id                       => "12345678",
    :time_tracking_mode           => "logs"
}


request.body = params.to_json

response = http.request(request)
puts response.read_body

Restrict fleet user’s access to certain groups

To restrict a fleet user's access to specific groups via the PUT User API, always use the custom_user_role object and include the id of the existing company connection user role. The target group IDs should be specified inside custom_user_role.group_ids.
IMPORTANT: Do not use top-level group_ids for fleet users.

{
  # restrict fleet user to groups
  "group_visibility": "limited",
  "custom_user_role": {
    "id": 123,               // Required: existing company connection user role ID
    "user_role_id": 9,       // Role type ID, e.g., "fleet_user"
    "group_ids": [101, 102], // Only these groups will be assigned
    "is_assigned_to_coach": true,
    "delete": false
  }
}

📘

custom_user_role object definitions

ParamsTypeDescription
idIntegerThe ID of the company connection user role that is used for editing an existing role assignment.
user_role_idIntegerThis is the ID of the user's role.
group_idsInteger (Array)The ID of the group to which this user role is associated with.
is_assigned_to_coachBooleanDenotes if the user role/user is assigned to a coach.
deleteBooleanDenotes if the existing user role is being deleted or not.

> TRUE: Denotes that the user role assignment is deleted.
> FALSE: Denotes that the user role assignment is not being deleted.

To delete an existing user role assignmnet, you must pass the company connection user role id (id).

To add a driver to a group, the list of group IDs needs to be sent in the group_ids attribute in the user object

{
  # add driver to groups
  "group_ids":[
    1,
    2
  ]
}

Response Parameters

user

  • Type: Object
  • Description: Details of a user.

id: Integer

  • Type: Integer
  • Description: Unique identifier for the user.

email

  • Type: String
  • Description: User's email address.

first_name

  • Type: String
  • Description: User's first name.

last_name

  • Type: String
  • Description: User's last name.

company_reference_id

  • Type: String
  • Description: Reference ID for the company.

phone

  • Type: String
  • Description: User's phone number.

phone_country_code

  • Type: String
  • Description: The country code associated with the user's phone number. For example, +1 for USA, and +52 for Mexico.

phone_ext

  • Type: String
  • Description: The extension of the user's phone number.

time_zone

  • Type: String
  • Description: Time zone of the user.

carrier_name

  • Type: String
  • Description: Carrier name associated with the user.

carrier_street

  • Type: String
  • Description: Street address of the carrier.

carrier_city

  • Type: String
  • Description: City of the carrier.

carrier_state

  • Type: String
  • Description: State of the carrier.

carrier_zip

  • Type: String
  • Description: Zip code of the carrier.

violation_alerts

  • Type: String
  • Description: Frequency of violation alerts (e.g., 1_hour, 2_hours).

terminal_street

  • Type: String
  • Description: Street address of the terminal.

terminal_city

  • Type: String
  • Description: City of the terminal.

terminal_state

  • Type: String
  • Description: State of the terminal.

terminal_zip

  • Type: String
  • Description: Zip code of the terminal.

exception_24_hour_restart

  • Type: Boolean
  • Description: Indicates if the 24-hour restart exception is enabled.

exception_8_hour_break

  • Type: Boolean
  • Description: Indicates if the 8-hour break exception is enabled.

exception_wait_time

  • Type: Boolean
  • Description: Indicates if the wait time exception is enabled.

exception_short_haul

  • Type: Boolean
  • Description: Indicates if the short haul exception is enabled.

exception_ca_farm_school_bus

  • Type: Boolean
  • Description: Indicates if the California farm school bus exception is enabled.

exception_adverse_driving

  • Type: Boolean
  • Description: Indicates if the adverse driving exception is enabled.

export_combined

  • Type: Boolean
  • Description: Indicates if the combined export option is enabled.

export_recap

  • Type: Boolean
  • Description: Indicates if the recap export option is enabled.

export_odometers

  • Type: Boolean
  • Description: Indicates if the odometer export option is enabled.

metric_units

  • Type: Boolean
  • Description: Indicates if metric units are used.

username

  • Type: String
  • Description: Username of the user.

cycle

  • Type: String
  • Description: Cycle type associated with the user.

driver_company_id

  • Type: String
  • Description: Driver's company ID.

minute_logs

  • Type: Boolean
  • Description: Indicates if minute logs are enabled.

duty_status

  • Type: String
  • Description: Current duty status of the user.

eld_mode

  • Type: String
  • Description: The mode of the vehicle gateway.

drivers_license_number

  • Type: String
  • Description: Driver's license number.

drivers_license_state

  • Type: String
  • Description: State where the driver's license was issued.

yard_moves_enabled

  • Type: Boolean
  • Description: Indicates if yard moves are enabled.

personal_conveyance_enabled

  • Type: Boolean
  • Description: Indicates if personal conveyance is enabled.

manual_driving_enabled

  • Type: Boolean
  • Description: Indicates if manual driving is enabled.

role

  • Type: String
  • Description: Role of the user (e.g., driver).

status

  • Type: String
  • Description: Status of the user (e.g., active).

created_at

  • Type: String
  • Description: Timestamp when the user was created.

updated_at

  • Type: String
  • Description: Timestamp when the user was last updated.

external_ids

  • Type: Array
  • Description: External IDs associated with the user.

dot_id

  • Type: String
  • Description: DOT ID associated with the user.

Path Params
int32
required

Specify the ID of the user whose information you want to update.

Body Params
string

Enter the first name of the user.

string

Enter the last name of the user.

string

Specify the email address of the user.

string

Enter the user name of the user that you are creating.

string

Specify a password for the user.

string

Specify the role of the user. Possible values are driver, fleet_user, or admin.

string

Enter the phone number of the user.

string
required

Specify the user's phone country code. For example if you are creating a user in the USA, enter the country code as +1

string

Enter the phone number extension if available.

string

Enter the driver's company ID.

string

Specify the time zone of the the user's home terminal.

group_ids
object
string

Mention the data visibility for the fleet users. Allowed values are all or limited. NOTE: This parameter is only applicable to users with the role "fleet_user".

string

Enter the name of the carrier you want to associate the user with.

string

Enter the street address of the carrier.

string

Enter the city of the carrier.

string

Enter the state of the carrier.

string

Enter the ZIP code of the carrier.

string

Specify the frequency of the violation alerts that you want the Motive Mobile app to show to your drivers. Allowed values are 15_minutes, 30_minutes, 45_minutes, or 1_hour.

string

Enter the street address of the terminal.

string

Specify the city of the terminal.

string

Specify the state when the terminal is located at.

string

Specify the ZIP code where the terminal is located at.

string

Set up the primary working cycle of the user that you are adding. Allowed values are: 70_8, 60_7, 70_8_o, 60_7_o, 70_8_p, 60_7_p, 80_8, 80_8_o, 80_8_p, tx_70_7, ak_70_7, ak_80_8, ak_70_7_o, ak_80_8_o, ak_70_7_p, ak_80_8_p, 70_7, 120_14, canada_oil, 80_7, 120_14_north, and Other.

boolean

Set true when driver is using 24 hours restart exception for cycle.

boolean

Set true when driver is using 8 hour break exception for cycle.

boolean

Set true when driver is using wait time exception for cycle.

boolean

Set true when driver is using short haul exception for cycle.

boolean

Set true when driver is using CA farm/school bus exception for cycle.

boolean

Set true when driver is allowed to extend duty day by up to 2 hours when adverse driving conditions are encountered

boolean

Set true to export logs and DVIRs on the same page.

boolean

Set true to export recap with logs.

boolean

Set true to export odometers with logs.

boolean

Set true to use metric units.

boolean

Set true to use minute resolution log events.

string

Specify the mode of the vehicle gateway. Allowed values are none, logs, and exempt.

string

Specify the license number of the driver.

string

Specify the issuing state of the driver's license.

boolean

Set true if yard moves are allowed for the driver.

boolean

Set true if personal conveyance is allowed for the driver.

string

Specify the status of the user. Allowed values are active or deactivated.

string

Driver's secondary cycle. Valid values include 70_8, 60_7, 70_8_o, 60_7_o, 70_8_p, 60_7_p, 80_8, 80_8_o, 80_8_p, tx_70_7, ak_70_7, ak_80_8, ak_70_7_o, ak_80_8_o, ak_70_7_p, ak_80_8_p, 70_7, 120_14, canada_oil, 80_7, 120_14_north, and Other.

boolean

Set true when driver is using 24 hours restart exception for secondary cycle.

boolean

Set true when driver is using 8 hour break exception for secondary cycle.

boolean

Set true when driver is using wait time exception for secondary cycle.

boolean

Set true when driver is using short haul exception for secondary cycle.

boolean

Set true when driver is using CA farm/school bus exception for secondary cycle.

boolean

Set true when driver is allowed to extend duty day by up to 2 hours when adverse driving conditions are encountered.

boolean

Set true when driver is allowed to manually add driving time

external_ids_attributes
array of objects

Specify the external ID of the user and the integration name associated with the ID.

external_ids_attributes
string

Driver's DOT number.

custom_user_role
object

Specify the custom user role.

string

Internal reference id of a user in the company

string

Specify the time tracking mode of the driver. Allowed values are logs, timecards, & not_required.

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
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json