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>"
],
"addFirstVersionContractIds": [
"<string>"
],
"removeFirstVersionContractIds": [
"<string>"
],
"isShiftActive": true,
"enabled": true,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>",
"driverMetadata": {}
}
'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>"],
"addFirstVersionContractIds": ["<string>"],
"removeFirstVersionContractIds": ["<string>"],
"isShiftActive": True,
"enabled": True,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>",
"driverMetadata": {}
}
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>'],
addFirstVersionContractIds: ['<string>'],
removeFirstVersionContractIds: ['<string>'],
isShiftActive: true,
enabled: true,
dateOfBirth: '2023-12-25',
driversLicense: '<string>',
driverMetadata: {}
})
};
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>'
],
'addFirstVersionContractIds' => [
'<string>'
],
'removeFirstVersionContractIds' => [
'<string>'
],
'isShiftActive' => true,
'enabled' => true,
'dateOfBirth' => '2023-12-25',
'driversLicense' => '<string>',
'driverMetadata' => [
]
]),
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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\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>"
],
"addFirstVersionContractIds": [
"<string>"
],
"removeFirstVersionContractIds": [
"<string>"
],
"isShiftActive": true,
"enabled": true,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>",
"driverMetadata": {}
}
'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>"],
"addFirstVersionContractIds": ["<string>"],
"removeFirstVersionContractIds": ["<string>"],
"isShiftActive": True,
"enabled": True,
"dateOfBirth": "2023-12-25",
"driversLicense": "<string>",
"driverMetadata": {}
}
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>'],
addFirstVersionContractIds: ['<string>'],
removeFirstVersionContractIds: ['<string>'],
isShiftActive: true,
enabled: true,
dateOfBirth: '2023-12-25',
driversLicense: '<string>',
driverMetadata: {}
})
};
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>'
],
'addFirstVersionContractIds' => [
'<string>'
],
'removeFirstVersionContractIds' => [
'<string>'
],
'isShiftActive' => true,
'enabled' => true,
'dateOfBirth' => '2023-12-25',
'driversLicense' => '<string>',
'driverMetadata' => [
]
]),
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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\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 \"addFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"removeFirstVersionContractIds\": [\n \"<string>\"\n ],\n \"isShiftActive\": true,\n \"enabled\": true,\n \"dateOfBirth\": \"2023-12-25\",\n \"driversLicense\": \"<string>\",\n \"driverMetadata\": {}\n}"
response = http.request(request)
puts response.read_body[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Authorizations
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).
Was this page helpful?