Create Depot
curl --request POST \
--url https://stage-api.getswitch.io/operations/depots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot"
}
'import requests
url = "https://stage-api.getswitch.io/operations/depots"
payload = {
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot"
}
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({
address: 'Via Rombon 11, 20134 Milano MI',
company_slug: 'acme-mobility',
latitude: 45.4887,
longitude: 9.2415,
name: 'Lambrate Depot'
})
};
fetch('https://stage-api.getswitch.io/operations/depots', 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/depots"
payload := strings.NewReader("{\n \"address\": \"Via Rombon 11, 20134 Milano MI\",\n \"company_slug\": \"acme-mobility\",\n \"latitude\": 45.4887,\n \"longitude\": 9.2415,\n \"name\": \"Lambrate Depot\"\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))
}{
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"created_at": "2026-09-18T10:02:00Z",
"id": 7,
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot",
"updated_at": "2026-11-03T08:30:00Z"
}Fleet Management
Create Depot
Add a depot: a place where operators start and end their shifts and refill their vehicles.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or
company_slugis a company you cannot manage - 422: Invalid request body
Required Auth Scopes:
depots:manage
POST
/
operations
/
depots
Create Depot
curl --request POST \
--url https://stage-api.getswitch.io/operations/depots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot"
}
'import requests
url = "https://stage-api.getswitch.io/operations/depots"
payload = {
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot"
}
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({
address: 'Via Rombon 11, 20134 Milano MI',
company_slug: 'acme-mobility',
latitude: 45.4887,
longitude: 9.2415,
name: 'Lambrate Depot'
})
};
fetch('https://stage-api.getswitch.io/operations/depots', 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/depots"
payload := strings.NewReader("{\n \"address\": \"Via Rombon 11, 20134 Milano MI\",\n \"company_slug\": \"acme-mobility\",\n \"latitude\": 45.4887,\n \"longitude\": 9.2415,\n \"name\": \"Lambrate Depot\"\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))
}{
"address": "Via Rombon 11, 20134 Milano MI",
"company_slug": "acme-mobility",
"created_at": "2026-09-18T10:02:00Z",
"id": 7,
"latitude": 45.4887,
"longitude": 9.2415,
"name": "Lambrate Depot",
"updated_at": "2026-11-03T08:30:00Z"
}Authorizations
HTTPBearerHTTPBearer
Body
application/json
Schema for creating a new depot.
All required fields must be provided including name, address, and WGS84 coordinates.
Response
Depot created successfully. Returns the complete depot profile including coordinates, address, and company ownership.
Public schema for a depot resource.
Exposes depot details to API consumers, including coordinates, address, and company ownership.
