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 identifier.
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>"
}
]externalIdentifier — the first call creates, every later call with the same identifier updates. The response’s created field tells you which happened, so a sync job that replays the same roster is safe.
There is no separate create, update, or delete call. To take a driver off the road, upsert them with isShiftActive: false.
What an update leaves alone
Omitting a field leaves its current value untouched rather than clearing it — so a routine name correction can’t silently re-enable a driver you disabled.isShiftActive defaults to true only when the driver is being created.
Linking a driver to the rest of your fleet
| Field | What it links |
|---|---|
vehicleIds | Existing vehicles this driver can use. |
storeLocationIds | The store locations the driver works out of. |
firstVersionContractIds | Driver group membership. Omit to leave unchanged. |
email | Creates or reuses a Nash driver-app login for this address. A driver upserted without one has no app login. |
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.
Identity key is external_identifier, scoped to the calling org's own
internal-fleet provider (not phone/email — this endpoint never touches
User/Auth0 identity, unlike the GraphQL CreateCourier/UpdateCourier
mutations). No driver-group/contract fields — that assignment is out of
scope for this endpoint; see the FLE-2224 plan for the deferred follow-up.
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.
Provisions (or links) a Nash driver-app login for this email, mirroring the portal's own driver create/edit behavior: creates or reuses a User and its Auth0 email identity.
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?