Add a driver
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"license_number": "<string>",
"license_expires_at": "<string>",
"date_of_birth": "",
"gender": "",
"national_id": "",
"address": "",
"city": "",
"employee_id": "",
"hire_date": "",
"license_class": "",
"license_issued_at": "",
"emergency_contact_name": "",
"emergency_contact_phone": "",
"emergency_contact_relationship": "",
"vehicle_id": "",
"notes": ""
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
license_number: '<string>',
license_expires_at: '<string>',
date_of_birth: '',
gender: '',
national_id: '',
address: '',
city: '',
employee_id: '',
hire_date: '',
license_class: '',
license_issued_at: '',
emergency_contact_name: '',
emergency_contact_phone: '',
emergency_contact_relationship: '',
vehicle_id: '',
notes: ''
})
};
fetch('https://partners.chargeexpressltd.com/api/public/v1/drivers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/drivers"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"license_number": "<string>",
"license_expires_at": "<string>",
"date_of_birth": "",
"gender": "",
"national_id": "",
"address": "",
"city": "",
"employee_id": "",
"hire_date": "",
"license_class": "",
"license_issued_at": "",
"emergency_contact_name": "",
"emergency_contact_phone": "",
"emergency_contact_relationship": "",
"vehicle_id": "",
"notes": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "driver",
"id": "<string>",
"status": "active",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"employee_id": "<string>",
"license_number": "<string>",
"license_expires_at": "2023-12-25",
"photo_url": "<string>",
"vehicle_ids": [
"<string>"
],
"profile": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"login_invite": {
"status": "<string>",
"message": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Drivers
Add a driver
Creates (or finds) the driver’s app account by email, joins them to the fleet and emails them a link to set a password.
Requires the drivers:write scope.
Accepts an Idempotency-Key header.
POST
/
drivers
Add a driver
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"license_number": "<string>",
"license_expires_at": "<string>",
"date_of_birth": "",
"gender": "",
"national_id": "",
"address": "",
"city": "",
"employee_id": "",
"hire_date": "",
"license_class": "",
"license_issued_at": "",
"emergency_contact_name": "",
"emergency_contact_phone": "",
"emergency_contact_relationship": "",
"vehicle_id": "",
"notes": ""
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
license_number: '<string>',
license_expires_at: '<string>',
date_of_birth: '',
gender: '',
national_id: '',
address: '',
city: '',
employee_id: '',
hire_date: '',
license_class: '',
license_issued_at: '',
emergency_contact_name: '',
emergency_contact_phone: '',
emergency_contact_relationship: '',
vehicle_id: '',
notes: ''
})
};
fetch('https://partners.chargeexpressltd.com/api/public/v1/drivers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/drivers"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"license_number": "<string>",
"license_expires_at": "<string>",
"date_of_birth": "",
"gender": "",
"national_id": "",
"address": "",
"city": "",
"employee_id": "",
"hire_date": "",
"license_class": "",
"license_issued_at": "",
"emergency_contact_name": "",
"emergency_contact_phone": "",
"emergency_contact_relationship": "",
"vehicle_id": "",
"notes": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "driver",
"id": "<string>",
"status": "active",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"employee_id": "<string>",
"license_number": "<string>",
"license_expires_at": "2023-12-25",
"photo_url": "<string>",
"vehicle_ids": [
"<string>"
],
"profile": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"login_invite": {
"status": "<string>",
"message": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
Your fleet API key, e.g. Authorization: Bearer cxk_live_…. Create keys in the fleet portal under Developers.
Headers
Maximum string length:
255Body
application/json
Required string length:
1 - 255Required string length:
1 - 255Maximum string length:
255Pattern:
^\+?[0-9\s-]{9,16}$Required string length:
1 - 128Pattern:
^\d{4}-\d{2}-\d{2}$Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Available options:
Response
Success
Available options:
driver Available options:
active, suspended, pending, archived Show child attributes
Show child attributes
Show child attributes
Show child attributes

