curl --request PUT \
--url https://api.sandbox.usenash.com/v1/fleet/drivers/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalIdentifier": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"vehicleInfo": {},
"vehicleIds": [
"<string>"
],
"storeLocationIds": [
"<string>"
],
"firstVersionContractIds": [
"<string>"
],
"isShiftActive": true,
"enabled": true,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>"
}
'import requests
url = "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert"
payload = {
"externalIdentifier": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"vehicleInfo": {},
"vehicleIds": ["<string>"],
"storeLocationIds": ["<string>"],
"firstVersionContractIds": ["<string>"],
"isShiftActive": True,
"enabled": True,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalIdentifier: '<string>',
phoneNumber: '<string>',
email: '<string>',
firstName: '<string>',
lastName: '<string>',
vehicleInfo: {},
vehicleIds: ['<string>'],
storeLocationIds: ['<string>'],
firstVersionContractIds: ['<string>'],
isShiftActive: true,
enabled: true,
dateOfBirth: '2023-12-25',
driversLicense: '<string>'
})
};
fetch('https://api.sandbox.usenash.com/v1/fleet/drivers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'externalIdentifier' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'vehicleInfo' => [
],
'vehicleIds' => [
'<string>'
],
'storeLocationIds' => [
'<string>'
],
'firstVersionContractIds' => [
'<string>'
],
'isShiftActive' => true,
'enabled' => true,
'dateOfBirth' => '2023-12-25',
'driversLicense' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert"
payload := strings.NewReader("{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.usenash.com/v1/fleet/drivers/upsert")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/fleet/drivers/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Upsert Driver
Create or update a driver in your internal fleet, keyed on your own externalIdentifier. There is no separate create vs. update call — sending the same externalIdentifier again updates the existing driver. The response’s created field tells you which happened. To disable a driver, upsert with isShiftActive: false (or enabled: false) — there is no separate delete/disable call.
curl --request PUT \
--url https://api.sandbox.usenash.com/v1/fleet/drivers/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalIdentifier": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"vehicleInfo": {},
"vehicleIds": [
"<string>"
],
"storeLocationIds": [
"<string>"
],
"firstVersionContractIds": [
"<string>"
],
"isShiftActive": true,
"enabled": true,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>"
}
'import requests
url = "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert"
payload = {
"externalIdentifier": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"vehicleInfo": {},
"vehicleIds": ["<string>"],
"storeLocationIds": ["<string>"],
"firstVersionContractIds": ["<string>"],
"isShiftActive": True,
"enabled": True,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalIdentifier: '<string>',
phoneNumber: '<string>',
email: '<string>',
firstName: '<string>',
lastName: '<string>',
vehicleInfo: {},
vehicleIds: ['<string>'],
storeLocationIds: ['<string>'],
firstVersionContractIds: ['<string>'],
isShiftActive: true,
enabled: true,
dateOfBirth: '2023-12-25',
driversLicense: '<string>'
})
};
fetch('https://api.sandbox.usenash.com/v1/fleet/drivers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'externalIdentifier' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>',
'firstName' => '<string>',
'lastName' => '<string>',
'vehicleInfo' => [
],
'vehicleIds' => [
'<string>'
],
'storeLocationIds' => [
'<string>'
],
'firstVersionContractIds' => [
'<string>'
],
'isShiftActive' => true,
'enabled' => true,
'dateOfBirth' => '2023-12-25',
'driversLicense' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.usenash.com/v1/fleet/drivers/upsert"
payload := strings.NewReader("{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.usenash.com/v1/fleet/drivers/upsert")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/fleet/drivers/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalIdentifier\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"vehicleInfo\": {},\n \"vehicleIds\": [\n \"<string>\"\n ],\n \"storeLocationIds\": [\n \"<string>\"\n ],\n \"firstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
PUT /v1/fleet/drivers/upsert request body — see FLE-2224.
Upsert identity is external_identifier, scoped to the calling org's own
internal-fleet provider. The required phone links a User who already belongs to the
calling organization or creates a new one, so portal roster queries include the driver. A
phone owned outside the organization is rejected. The endpoint attaches the organization's
driver role and provisions an Auth0 passwordless SMS identity. An optional email provisions
the Auth0 email identity on that user.
Wire format is camelCase, matching the rest of Nash's customer-facing REST
API (populate_by_name=True also accepts snake_case).
Caller's own id for this driver; the upsert identity key.
Required. Links or creates the driver's Nash User record, attaches the driver role, and provisions SMS login. Supply an international number with a leading country code; the value is stored in E.164 form. Does not send a welcome message.
1Optionally provisions a Nash driver-app email login on the phone-linked User, mirroring the portal's own driver create/edit behavior. Omit, null, or blank leaves the existing email unchanged.
Existing Vehicle ids to link to this driver.
Driver group membership, by first_version_contract_id. Omit to leave unchanged.
Whether the driver is available. Defaults to true for a newly created driver when omitted; an update call that omits it leaves the existing value unchanged.
EMPLOYEE, CONTRACTOR Was this page helpful?