Delete a role
/api/v1/roles/{id}Authentication
- Bearer Token
AuthorizationJWT access token
- API Key
X-API-KeyAPI key for management-tier access
Path Parameters
| Name | Required | Type | Description |
|---|---|---|---|
id | string |
Headers
if-matchrequiredIf-MatchOptimistic-lock version of the resource. Send the `version` field returned on read; the server rejects with 409 if the row has changed since.
Code samples
curl -X DELETE "https://api.canopy.dev/api/v1/roles/value" \ -H "if-match: value" \ -H "If-Match: value" \ -H "X-API-Key: $CANOPY_API_KEY"
const response = await fetch("https://api.canopy.dev/api/v1/roles/value", {
method: "DELETE",
headers: {
"if-match": "value",
"If-Match": "value",
"X-API-Key": "$CANOPY_API_KEY"
},
});
const data = await response.json();import requests
response = requests.delete(
"https://api.canopy.dev/api/v1/roles/value",
headers={
"if-match": "value",
"If-Match": "value",
"X-API-Key": "$CANOPY_API_KEY"
},
)
data = response.json()package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.canopy.dev/api/v1/roles/value", nil)
req.Header.Set("if-match", "value")
req.Header.Set("If-Match", "value")
req.Header.Set("X-API-Key", "$CANOPY_API_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
204 Role deleted
401 Invalid or expired token
403 System role cannot be deleted
404 Role not found
409 Version mismatch — the resource was modified since the version supplied in If-Match. Refresh and retry.