Logout identity and revoke tokens
/v1/identity/auth/logoutRequest body
Code samples
curl -X POST "https://api.canopy.dev/v1/identity/auth/logout" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch("https://api.canopy.dev/v1/identity/auth/logout", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.canopy.dev/v1/identity/auth/logout",
headers={
"Content-Type": "application/json"
},
json={},
)
data = response.json()package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload := map[string]interface{}{}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://api.canopy.dev/v1/identity/auth/logout", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
200 Tokens revoked
{
"message": "string"
}application/json
message *string
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)