| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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 Value | Must match the following ELD Mode Value |
|---|---|
| Logs | None or Logs |
| Timecards | Exempt |
| Not_required | Exempt |
Here is an explanation of the scenarios:
| Time Tracking Mode Value | ELD Mode Value | Result |
|---|---|---|
| Logs | Logs | The driver need not maintain the log manually, as everything is recorded by the Vehicle Gateway. |
| Logs | None | The driver must manually maintain an Electronic Logbook on the Motive Driver app. Logging will be disabled on the Vehicle Gateway. |
| Timecards | Exempt | The driver is exempt from maintaining logs and will use Motive Timecards in the Driver App to track their time. |
| Not_required | Exempt | The 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":"[email protected]",
"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.eu.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_bodyRestrict 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
Params Type Description id Integer The ID of the company connection user role that is used for editing an existing role assignment. user_role_id Integer This is the ID of the user's role. group_ids Integer (Array) The ID of the group to which this user role is associated with. is_assigned_to_coach Boolean Denotes if the user role/user is assigned to a coach. delete Boolean Denotes 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
- Type: Integer
- Description: The unique identifier for the user.
first_name
- Type: String
- Description: The first name of the user.
last_name
- Type: String
- Description: The last name of the user.
email
- Type: String
- Description: The primary email address of the user.
role
- Type: String
- Description: The system role assigned to the user (e.g., driver).
status
- Type: String
- Description: The current account status of the user (e.g., active).
phone
- Type: String
- Description: The primary phone number of the user.
phone_country_code
- Type: String
- Description: The ISO country code for the primary phone number.
phone_ext
- Type: String (or Null)
- Description: The extension for the primary phone number, if applicable.
phone2
- Type: String
- Description: The secondary phone number of the user.
phone_country_code2
- Type: String
- Description: The ISO country code for the secondary phone number.
time_zone
- Type: String
- Description: The preferred time zone setting for the user.
metric_units
- Type: Boolean
- Description: Indicates whether the user prefers metric units for measurement.
username
- Type: String
- Description: The unique username used for authentication.
driver_company_id
- Type: String
- Description: The internal company identifier assigned to the driver.
drivers_license_number
- Type: String
- Description: The driver's license number.
drivers_license_state
- Type: String
- Description: The state, region, or jurisdiction that issued the driver's license.
drivers_license_country
- Type: String
- Description: The country code of the issuing authority for the driver's license.
time_tracking_mode
- Type: String
- Description: The method used for tracking the driver's work hours (e.g., tachograph).
joined_at
- Type: String (Date)
- Description: The date when the user joined the company or platform.
user_notes
- Type: String
- Description: Additional comments or administrator notes regarding the user.
require_job_type_for_timecard_details
- Type: Boolean
- Description: Indicates whether specifying a job type is mandatory when submitting timecards.
company_reference_id
- Type: String
- Description: External reference identifier used by the company for the user.
group_ids
- Type: Array (Integer)
- Description: A list of group identifiers associated with the user.
tachograph_card_number
- Type: String
- Description: The identification number of the driver's smart tachograph card.
tachograph_card_expiry_date
- Type: String (Date)
- Description: The expiration date of the driver's tachograph card.
external_ids
- Type: Array (Object)
- Description: A collection of external integration mapping identifiers.
external_id
- Type: String
- Description: The identifier used in an external integration system.
integration_name
- Type: String
- Description: The name of the external integration platform.
company_connection
- Type: Object
- Description: Details regarding the user's connection state to the company.
company_connection_user_roles
- Type: Array
- Description: Specific sub-roles assigned to the user within the company connection.
mobile_last_active_at
- Type: String (Timestamp)
- Description: The date and time when the user was last active on the mobile application.
mobile_current_sign_in_at
- Type: String (Timestamp)
- Description: The timestamp of the user's current mobile session sign-in.
mobile_last_sign_in_at
- Type: String (Timestamp)
- Description: The timestamp of the user's previous mobile session sign-in.
web_last_active_at
- Type: String (Timestamp or Null)
- Description: The date and time when the user was last active on the web application.
created_at
- Type: String (Timestamp)
- Description: The timestamp when the user record was initially created.
updated_at
- Type: String (Timestamp)
- Description: The timestamp when the user record was last modified.
