Delete API Key
curl --request DELETE \
--url https://stage-api.getswitch.io/auth/api-keys/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/auth/api-keys/{uuid}"
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/auth/api-keys/{uuid}', 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/auth/api-keys/{uuid}"
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))
}{
"auth_scopes": [
{
"description": "Read forecast data",
"slug": "forecast:read"
},
{
"description": "Read access to upstream vehicles",
"slug": "integrations:vehicles:read"
}
],
"created_at": "2026-11-30T09:00:00Z",
"exp": "2027-11-30T09:00:00Z",
"name": "Nightly forecast export",
"uuid": "3f2b8c1e-5d4a-4e7b-9c0d-1a2b3c4d5e6f"
}API Keys
Delete API Key
Delete one of your API keys. It stops working immediately and this cannot be undone. Returns the deleted key’s details.
API keys authenticate scripts and integrations as you: send one as Authorization: Bearer <key>. A key acts with your permissions (or fewer, when created with narrowing) and stops working when it expires or is deleted. Create keys in the Copilot (Settings → API keys) or with POST /auth/api-keys.
Failure Modes:
- 401: Token is missing, invalid, expired or revoked
- 403:
access_deniedwhen your role cannot manage API keys - 404:
API key not foundwhen no key of yours has this id
Required Auth Scopes:
api_keys:write
DELETE
/
auth
/
api-keys
/
{uuid}
Delete API Key
curl --request DELETE \
--url https://stage-api.getswitch.io/auth/api-keys/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/auth/api-keys/{uuid}"
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/auth/api-keys/{uuid}', 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/auth/api-keys/{uuid}"
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))
}{
"auth_scopes": [
{
"description": "Read forecast data",
"slug": "forecast:read"
},
{
"description": "Read access to upstream vehicles",
"slug": "integrations:vehicles:read"
}
],
"created_at": "2026-11-30T09:00:00Z",
"exp": "2027-11-30T09:00:00Z",
"name": "Nightly forecast export",
"uuid": "3f2b8c1e-5d4a-4e7b-9c0d-1a2b3c4d5e6f"
}Authorizations
HTTPBearerHTTPBearer
Path Parameters
Response
API key successfully deleted and token revoked.
Public schema for an API key resource.
Exposes API key metadata and associated authorization scopes to API consumers.
