Drivers
On this page, we'll dive into the different driver endpoints you can use to manage them programmatically.
The Driver object
Driver objects represent a single driver in a commercial or personal risk profile. They contain the following properties and relationships:
Global Properties
These properties are available for all risk profile types.- Name
number- Type
- int
- Filterable
- Sortable
- Description
The driver number. The value must be unique for each driver related to a specific commercial or personal risk profile.
- Name
employee_number- Type
- nullable int
- Sortable
- Description
An employee number, also known as an employee ID or employee code, is a unique identifier for each employee in a company
- Name
first_name- Type
- nullable string
- Filterable
- Sortable
- Description
The driver's first name
- Name
middle_name- Type
- nullable string
- Filterable
- Sortable
- Description
The driver's middle name
- Name
last_name- Type
- nullable string
- Filterable
- Sortable
- Description
The driver's last name
- Name
date_of_birth- Type
- nullable string
- Description
The driver's date of birth
- Name
hire_date- Type
- nullable string
- Description
The driver's hire date
- Name
is_employee- Type
- bool
- Filterable
- Sortable
- Description
Is the driver an employee of the company?
- Name
is_contractor- Type
- bool
- Filterable
- Sortable
- Description
Is the driver a contractor for the company?
- Name
license_number- Type
- nullable string
- Description
The driver's license number
- Name
license_state- Type
- nullable string
- Filterable
- Sortable
- Description
TThe state in which the driver is licensed
- Name
license_expiration- Type
- nullable string
- Filterable
- Sortable
- Description
The date the driver's license expires
- Name
notes- Type
- nullable string
- Description
Any notes about the driver
- Name
image- Type
- nullable string
- Description
The URL of the driver's image, if uploaded via the Wunderite UI
- Name
sex- Type
- nullable string
- Filterable
- Sortable
- Description
The driver's sex
- Name
marital_status- Type
- nullable string
- Filterable
- Sortable
- Description
The driver's marital status
- Name
year_licensed- Type
- nullable int
- Filterable
- Sortable
- Description
The year the driver was licensed
- Name
commercial_driver_since- Type
- nullable string
- Filterable
- Sortable
- Description
The date the driver became a commercial driver
- Name
percent_use- Type
- nullable int
- Filterable
- Sortable
- Description
The percentage of time the driver uses the vehicle
- Name
vehicle- Type
- nullable string | int
- Filterable
- Description
The UUID, or vehicle number, of the vehicle assigned to the driver.
Meta
- Name
created- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the driver was created
- Name
updated- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the driver was last updated
Global Relations
Learn more about including relations.- Name
address- Type
- Address
- Filterable
- Sortable
- Name
attachments- Type
- Attachment[]
- Name
attachments.uploader- Type
- User
- Description
The user who uploaded the attachment
- Name
vehicle- Type
- Vehicle
- Filterable
List all drivers
This endpoint allows you to retrieve a paginated list of all drivers in the corresponding commercial or personal risk profile.
Parameters
See the driver object for a list of all available filters and sorts.
Searchable
You can search for drivers by providing a search query in the filter[search] parameter.
The search query will be matched against driver first and last names.
Request
curl -G https://app.wunderite.com/api/v1/risks/{risk}/data/drivers \
-H "Authorization: Bearer {token}" \
-d filter[search]=Rich \
-d per_page=50
Response
{ "data": [ { "object": "driver", "uuid": "7f1903ad-5071-4a73-a5a7-d94228178367", "data": { "number": 3, "employee_number": 3, "first_name": "Big", "middle_name": "O",
Create drivers
This endpoint allows you to create new drivers in the corresponding commercial or personal risk profile.
At least one driver object must be provided in the request body.
Optional global properties
See all available properties in the driver properties section.
- Name
number- Type
- nullable int
- Description
The driver's number. The value must be unique for each driver related to a specific commercial or personal risk profile. When this property is not provided, or uses a
nullvalue, the driver will be assigned a number automatically.
- Name
vehicle- Type
- nullable int|string
- Description
The UUID or
numberof the vehicle record. When this property is not provided, or uses anullvalue, the relationship is removed.
Request
curl -X POST "https://app.wunderite.com/api/v1/risks/{risk}/data/drivers" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "driver",
"data": {
"employee_number": 190389291,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"is_employee": true,
"is_contractor": false,
"license_number": "CA123456",
"license_state": "CA",
"license_expiration": "2025-01-01",
"notes": "This is a note",
"sex": "Male",
"marital_status": "Single",
"year_licensed": 2020,
"commercial_driver_since": "2020-01-01",
"percent_use": 50,
"hire_date": "2020-01-01",
"vehicle": null
},
"profile_type": "commercial"
}
]
}'
Response
{ "data": [ { "object": "driver", "uuid": "36359186-a623-4ee5-8648-be5ff28ba7fc", "data": { "number": 51, "employee_number": 190389291, "first_name": "John", "middle_name": null,
Request with sub resources
curl -X POST "https://app.wunderite.com/api/v1/risks/{risk}/data/drivers?include=address" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "driver",
"data": {
"employee_number": 190389291,
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"is_employee": true,
"is_contractor": false,
"license_number": "CA123456",
"license_state": "CA",
"license_expiration": "2025-01-01",
"notes": "This is a note",
"sex": "Male",
"marital_status": "Single",
"year_licensed": 2020,
"commercial_driver_since": "2020-01-01",
"percent_use": 50,
"hire_date": "2020-01-01",
"vehicle": null,
"address": {
"object": "address",
"data": {
"address": "123 Main St",
"city": "Boston",
"state": "MA",
"zip": "02108"
}
}
},
"profile_type": "commercial"
}
]
}'
Response
{ "data": [ { "object": "driver", "uuid": "a3f8519c-4fbb-40b6-9c63-43da14daa667", "data": { "number": 52, "employee_number": 190389291, "first_name": "John", "middle_name": null,
Update drivers
This endpoint allows you to perform bulk updates on drivers.
At least one driver object must be provided in the request body. Each object must contain at least one property from the driver properties section.
Properties that are not provided will not be updated.
To clear a nullable property, provide a null value.
Optional global properties
See all available properties in the driver properties section.
- Name
number- Type
- int
- Description
If updating the
numberproperty, the value must be unique for each driver related to a specific commercial or personal risk profile.
- Name
vehicle- Type
- nullable int|string
- Description
The UUID or number of the vehicle record. When this property is not provided, or uses a `null value, the relationship is removed.
Request
curl -X PATCH "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "driver",
"uuid": "7f1903ad-5071-4a73-a5a7-d94228178367",
"data": {
"number": 3,
"employee_number": 3,
"first_name": "Big",
"middle_name": "O",
"last_name": "Head",
"date_of_birth": "1990-01-18",
"is_employee": false,
"is_contractor": false,
"license_number": "FL-9I0J1K2L",
"license_state": "FL",
"license_expiration": null,
"notes": "Good Driver",
"image": null,
"sex": null,
"marital_status": null,
"year_licensed": null,
"commercial_driver_since": null,
"percent_use": null,
"hire_date": null,
"vehicle": null
}
}
]
}'
Response
{ "data": [ { "object": "driver", "uuid": "7f1903ad-5071-4a73-a5a7-d94228178367", "data": { "number": 3, "employee_number": 3, "first_name": "Big", "middle_name": "O",
Request with sub resources
curl -X PATCH "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "driver",
"uuid": "7f1903ad-5071-4a73-a5a7-d94228178367",
"data": {
"number": 3,
"employee_number": 3,
"first_name": "Big",
"middle_name": "O",
"last_name": "Head",
"date_of_birth": "1990-01-18",
"is_employee": false,
"is_contractor": false,
"license_number": "FL-9I0J1K2L",
"license_state": "FL",
"license_expiration": null,
"notes": "Good Driver",
"image": null,
"sex": null,
"marital_status": null,
"year_licensed": null,
"commercial_driver_since": null,
"percent_use": null,
"hire_date": null,
"vehicle": null,
"address": {
"object": "address",
"data": {
"address": "123 Test Street",
"address2": null,
"city": "Boston",
"state": "MA",
"zip": "08077",
"county": "Suffolk",
"lat": 0,
"lng": 0
}
}
}
}
]
}'
Response
{ "data": [ { "object": "driver", "uuid": "7f1903ad-5071-4a73-a5a7-d94228178367", "data": { "number": 3, "employee_number": 3, "first_name": "Big", "middle_name": "O",
Delete drivers
This endpoint allows you to bulk delete risk data, including drivers.
At least one driver object must be provided in the request body to delete the corresponding driver.
Required properties
- Name
object- Type
- string
- Description
The object type of the data to delete. Must be
driverin this case
- Name
uuid- Type
- string
- Description
The UUID of the driver to delete
Request
curl -X DELETE "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "driver",
"uuid": "7f1903ad-5071-4a73-a5a7-d94228178367"
}
]
}'
Response
{
"data": [
{
"object": "driver",
"uuid": "7f1903ad-5071-4a73-a5a7-d94228178367",
"profile_type": "commercial"
}
]
}