curl --request PUT \
--url https://stage-api.getswitch.io/operations/drivers/{driver_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"saturday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"is_active": true
}
'import requests
url = "https://stage-api.getswitch.io/operations/drivers/{driver_id}"
payload = {
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"saturday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"is_active": True
}
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({
availability: {
friday: {end: '17:00', start: '08:00'},
monday: {end: '17:00', start: '08:00'},
saturday: {end: '17:00', start: '08:00'},
thursday: {end: '17:00', start: '08:00'},
tuesday: {end: '17:00', start: '08:00'},
wednesday: {end: '17:00', start: '08:00'}
},
is_active: true
})
};
fetch('https://stage-api.getswitch.io/operations/drivers/{driver_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/operations/drivers/{driver_id}"
payload := strings.NewReader("{\n \"availability\": {\n \"friday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"monday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"saturday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"thursday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"tuesday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"wednesday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n }\n },\n \"is_active\": true\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))
}{
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"company_slug": "acme-mobility",
"created_at": "2026-10-01T07:45:00Z",
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 12,
"is_active": true,
"license_number": "MI1234567X",
"phone": "+39 02 1234 5678",
"updated_at": "2026-11-20T12:10:00Z",
"user_id": 57
}Update Driver
Update a driver’s phone, license number, working hours or active status. Only the fields you send change; name and email belong to the user account and cannot be changed here.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or you cannot manage the driver’s company or the new
company_slug - 404: No driver with this ID
- 422: Invalid request body
Required Auth Scopes:
drivers:manage
curl --request PUT \
--url https://stage-api.getswitch.io/operations/drivers/{driver_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"saturday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"is_active": true
}
'import requests
url = "https://stage-api.getswitch.io/operations/drivers/{driver_id}"
payload = {
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"saturday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"is_active": True
}
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({
availability: {
friday: {end: '17:00', start: '08:00'},
monday: {end: '17:00', start: '08:00'},
saturday: {end: '17:00', start: '08:00'},
thursday: {end: '17:00', start: '08:00'},
tuesday: {end: '17:00', start: '08:00'},
wednesday: {end: '17:00', start: '08:00'}
},
is_active: true
})
};
fetch('https://stage-api.getswitch.io/operations/drivers/{driver_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/operations/drivers/{driver_id}"
payload := strings.NewReader("{\n \"availability\": {\n \"friday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"monday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"saturday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"thursday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"tuesday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n },\n \"wednesday\": {\n \"end\": \"17:00\",\n \"start\": \"08:00\"\n }\n },\n \"is_active\": true\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))
}{
"availability": {
"friday": {
"end": "17:00",
"start": "08:00"
},
"monday": {
"end": "17:00",
"start": "08:00"
},
"thursday": {
"end": "17:00",
"start": "08:00"
},
"tuesday": {
"end": "17:00",
"start": "08:00"
},
"wednesday": {
"end": "17:00",
"start": "08:00"
}
},
"company_slug": "acme-mobility",
"created_at": "2026-10-01T07:45:00Z",
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi",
"id": 12,
"is_active": true,
"license_number": "MI1234567X",
"phone": "+39 02 1234 5678",
"updated_at": "2026-11-20T12:10:00Z",
"user_id": 57
}Authorizations
Body
Schema for partially updating a driver.
Only provided fields are applied; omitted fields remain unchanged. User-level fields (email, name) cannot be updated here.
New working hours; replaces the whole object.
{
"friday": { "end": "17:00", "start": "08:00" },
"monday": { "end": "17:00", "start": "08:00" },
"thursday": { "end": "17:00", "start": "08:00" },
"tuesday": { "end": "17:00", "start": "08:00" },
"wednesday": { "end": "17:00", "start": "08:00" }
}
Response
Driver updated successfully. Returns the updated driver profile including user details, availability, license info, and active status.
Public schema for a driver resource.
Exposes driver details to API consumers, including user details, availability, license info, and active status.
Working hours per weekday: keys monday to sunday, each {"start": "HH:MM", "end": "HH:MM"}; a missing day means not available.
{
"friday": { "end": "17:00", "start": "08:00" },
"monday": { "end": "17:00", "start": "08:00" },
"thursday": { "end": "17:00", "start": "08:00" },
"tuesday": { "end": "17:00", "start": "08:00" },
"wednesday": { "end": "17:00", "start": "08:00" }
}
