Update Depot
curl --request PUT \
--url https://stage-api.getswitch.io/operations/depots/{depot_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "Via Rombon 13, 20134 Milano MI",
"latitude": 45.4889,
"longitude": 9.2419
}
'import requests
url = "https://stage-api.getswitch.io/operations/depots/{depot_id}"
payload = {
"address": "Via Rombon 13, 20134 Milano MI",
"latitude": 45.4889,
"longitude": 9.2419
}
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({
address: 'Via Rombon 13, 20134 Milano MI',
latitude: 45.4889,
longitude: 9.2419
})
};
fetch('https://stage-api.getswitch.io/operations/depots/{depot_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/depots/{depot_id}"
payload := strings.NewReader("{\n \"address\": \"Via Rombon 13, 20134 Milano MI\",\n \"latitude\": 45.4889,\n \"longitude\": 9.2419\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))
}{
"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
Update Depot
Update a depot. Only the fields you send change; send latitude and longitude together to move it.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or you cannot manage the depot’s company or the new
company_slug - 404: No depot with this ID
- 422: Invalid request body
Required Auth Scopes:
depots:manage
PUT
/
operations
/
depots
/
{depot_id}
Update Depot
curl --request PUT \
--url https://stage-api.getswitch.io/operations/depots/{depot_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "Via Rombon 13, 20134 Milano MI",
"latitude": 45.4889,
"longitude": 9.2419
}
'import requests
url = "https://stage-api.getswitch.io/operations/depots/{depot_id}"
payload = {
"address": "Via Rombon 13, 20134 Milano MI",
"latitude": 45.4889,
"longitude": 9.2419
}
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({
address: 'Via Rombon 13, 20134 Milano MI',
latitude: 45.4889,
longitude: 9.2419
})
};
fetch('https://stage-api.getswitch.io/operations/depots/{depot_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/depots/{depot_id}"
payload := strings.NewReader("{\n \"address\": \"Via Rombon 13, 20134 Milano MI\",\n \"latitude\": 45.4889,\n \"longitude\": 9.2419\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))
}{
"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 partially updating a depot.
Only provided fields are applied; omitted fields remain unchanged. Latitude and longitude are only applied when both are sent.
Response
Depot updated successfully. Returns the updated 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.
