Skip to main content
PUT
/
drivers
/
update
/
{pk}
/
Update Driver
curl --request PUT \
  --url https://{company}.datatruck.io/api/v1/openapi/drivers/update/{pk}/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "account": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "jsmith@example.com"
  },
  "contact_number": "+1-555-0123",
  "driver_type": "Company Driver",
  "new_employee_status": "Active",
  "status": "Available",
  "is_main": true,
  "mc_number": 1,
  "brith_date": "1985-06-15",
  "telegram_number": null,
  "driver_license": "D1234567",
  "driver_license_issue_date": "2020-03-10",
  "driver_license_state": "CA",
  "driver_license_expiration": "2028-03-10",
  "driver_license_class": "A",
  "dispatch_status": 1
}
'
{
  "detail": "success"
}

API Url

https://{company_name}.datatruck.io/api/v1/openapi/drivers/update/{pk}/
Replace {company_name} with your company name and {pk} with the driver ID.

Sample Request

curl --request PUT \
--url https://{company_name}.datatruck.io/api/v1/openapi/drivers/update/102/ \
--header "Authorization: Token YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
  "account": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@companyx.com"
  },
  "contact_number": "+1 234-567-8901",
  "driver_type": "company_driver",
  "new_employee_status": "employed",
  "status": "active",
  "is_main": true,
  "mc_number": 12345,
  "brith_date": "1990-05-15",
  "telegram_number": "@johndoe",
  "driver_license": "D1234567",
  "driver_license_issue_date": "2015-06-01",
  "driver_license_state": "TX",
  "driver_license_expiration": "2025-06-01",
  "driver_license_class": "A",
  "dispatch_status": 1
}'
FieldTypeRequiredDescription
accountobjectyesNested driver account info
account.first_namestringyesFirst name of the driver
account.last_namestringyesLast name of the driver
account.emailstringyesEmail address
contact_numberstringyesContact number
driver_typestringyesType of driver (company_driver, owner_operator, etc.)
new_employee_statusstringyesNew employee status
statusstringyesCurrent status of the driver
is_mainbooleanyesIs main driver
mc_numberintegeryesMC number
brith_datestring (date)yesDate of birth
telegram_numberstringnoTelegram username / handle
driver_licensestringnoDriver license number
driver_license_issue_datestring (date)noLicense issue date
driver_license_statestringnoLicense issuing state
driver_license_expirationstring (date)noLicense expiration date
driver_license_classstringnoLicense class
dispatch_statusintegernoDispatch status code

Sample Response

[
  {
    "id": 102,
    "account": {
      "first_name": "John",
      "last_name": "Doe",
      "full_name": "John Doe",
      "email": "john.doe@companyx.com"
    },
    "contact_number": "+1 234-567-8901",
    "driver_type": "company_driver",
    "employee_status": "employed",
    "status": "active",
    "is_main": true,
    "mc_number": 12345,
    "brith_date": "1990-05-15",
    "telegram_number": "@johndoe",
    "driver_license": "D1234567",
    "driver_license_issue_date": "2015-06-01",
    "driver_license_state": "TX",
    "driver_license_expiration": "2025-06-01",
    "driver_license_class": "A",
    "dispatch_status": 1
  }
]

Authorizations

Authorization
string
header
required

Path Parameters

pk
integer
required

Unique identifier of the driver to update.

Body

application/json
account
object
required
contact_number
string
required
Minimum string length: 1
driver_type
string
required
Minimum string length: 1
new_employee_status
string
required
Minimum string length: 1
status
string
required
Minimum string length: 1
is_main
boolean
required
mc_number
integer
required
brith_date
string<date>
required
telegram_number
string | null
driver_license
string | null
driver_license_issue_date
string<date> | null
driver_license_state
string | null
driver_license_expiration
string<date> | null
driver_license_class
string | null
dispatch_status
integer | null

Response

Driver successfully updated.

detail
string
Example:

"success"