Delete Session
curl --request DELETE \
--url https://stage-api.getswitch.io/operations/sessions/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/sessions/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/operations/sessions/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/operations/sessions/{slug}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Routing Sessions
Delete Session
Delete a routing session. It and its routes no longer appear in lists and lookups, and drivers no longer see its routes.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, or you cannot manage the session’s company
- 404: No session with this slug
Required Auth Scopes:
routing-sessions:manage
DELETE
/
operations
/
sessions
/
{slug}
Delete Session
curl --request DELETE \
--url https://stage-api.getswitch.io/operations/sessions/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/operations/sessions/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/operations/sessions/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/operations/sessions/{slug}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
HTTPBearerHTTPBearer
Response
Session deleted. No content returned.
