Remove an identity from an Application (revoke AppMembership)
/portal/v1/accounts/{accountSlug}/identities/{id}/app-memberships/{appId}Authentication
- Bearer Token
AuthorizationJWT access token
Path Parameters
| Name | Required | Type | Description |
|---|---|---|---|
id | string | ||
appId | string |
Code samples
curl -X DELETE "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/value/app-memberships/value" \
-H "Authorization: Bearer $CANOPY_TOKEN"const response = await fetch("https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/value/app-memberships/value", {
method: "DELETE",
headers: {
"Authorization": "Bearer $CANOPY_TOKEN"
},
});
const data = await response.json();import requests
response = requests.delete(
"https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/value/app-memberships/value",
headers={
"Authorization": "Bearer $CANOPY_TOKEN"
},
)
data = response.json()package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/identities/value/app-memberships/value", nil)
req.Header.Set("Authorization", "Bearer $CANOPY_TOKEN")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
204 Deactivates the AppMembership row and revokes every role assignment the identity holds at this App's hierarchy nodes. The Identity row itself stays (it may still belong to other Apps).
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)
404 Identity not found