curl --request POST \
--url https://api.getswitch.io/operations/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi"
}
'import requests
url = "https://api.getswitch.io/operations/drivers"
payload = {
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'marco.bianchi@acme-mobility.com', full_name: 'Marco Bianchi'})
};
fetch('https://api.getswitch.io/operations/drivers', 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://api.getswitch.io/operations/drivers"
payload := strings.NewReader("{\n \"email\": \"marco.bianchi@acme-mobility.com\",\n \"full_name\": \"Marco Bianchi\"\n}")
req, _ := http.NewRequest("POST", 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
}Create Driver
Create a driver profile. If a user with the email exists in your company or a company you manage, the profile is linked to that account; otherwise a new account is created. The account gets the scopes cargo-vehicles:read, depots:read, stations:read and drivers:read, which you must hold yourself. Use the driver’s user_id to assign them to routes.
Failure Modes:
- 400: The user already has an active driver profile
- 401: Token is missing or invalid
- 403: Insufficient permissions,
company_slugis a company you cannot manage, or you lack one of the scopes above - 409: The email belongs to a user of a company outside yours
- 422: Invalid request body
Required Auth Scopes:
drivers:manage
curl --request POST \
--url https://api.getswitch.io/operations/drivers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi"
}
'import requests
url = "https://api.getswitch.io/operations/drivers"
payload = {
"email": "marco.bianchi@acme-mobility.com",
"full_name": "Marco Bianchi"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'marco.bianchi@acme-mobility.com', full_name: 'Marco Bianchi'})
};
fetch('https://api.getswitch.io/operations/drivers', 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://api.getswitch.io/operations/drivers"
payload := strings.NewReader("{\n \"email\": \"marco.bianchi@acme-mobility.com\",\n \"full_name\": \"Marco Bianchi\"\n}")
req, _ := http.NewRequest("POST", 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
Create a driver.
If email matches existing user, links to them; otherwise creates user too.
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" }
}
Response
Driver created successfully. Returns the complete 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" }
}
