curl -X POST https://api.mcprank.com/v1/identity/revoke \
-H "X-API-Key: sk_mcp_rank_..." \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123"}'
from mcp_rank import MCPRankClient
client = MCPRankClient(api_key="sk_mcp_rank_...", user_id="user_123")
await client.initialize()
# Revoke all tokens for this user
await client.revoke_user_token()
# Clear local state
client.clear_user_token()
{
"success": true
}
Identity
Revoke Tokens
Revoke all tokens for a user
POST
/
v1
/
identity
/
revoke
curl -X POST https://api.mcprank.com/v1/identity/revoke \
-H "X-API-Key: sk_mcp_rank_..." \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123"}'
from mcp_rank import MCPRankClient
client = MCPRankClient(api_key="sk_mcp_rank_...", user_id="user_123")
await client.initialize()
# Revoke all tokens for this user
await client.revoke_user_token()
# Clear local state
client.clear_user_token()
{
"success": true
}
Revoke Tokens
Revoke all tokens for a user, including their MCP Identity Token and stored OAuth tokens.Request
curl -X POST https://api.mcprank.com/v1/identity/revoke \
-H "X-API-Key: sk_mcp_rank_..." \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123"}'
Headers
string
required
Your MCP Rank API key
Body Parameters
string
required
Your user’s unique identifier
Response
Returns 200 OK on success.curl -X POST https://api.mcprank.com/v1/identity/revoke \
-H "X-API-Key: sk_mcp_rank_..." \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123"}'
from mcp_rank import MCPRankClient
client = MCPRankClient(api_key="sk_mcp_rank_...", user_id="user_123")
await client.initialize()
# Revoke all tokens for this user
await client.revoke_user_token()
# Clear local state
client.clear_user_token()
{
"success": true
}
What Gets Revoked
When you call this endpoint:- MCP Identity Token (MIT) - Immediately invalidated
- Refresh token - Can no longer be used
- Stored OAuth tokens - Deleted from server (Google, etc.)
When to Revoke Tokens
- User logout - When a user signs out of your application
- Account disconnection - When a user wants to disconnect their Google account
- Security concerns - If you suspect token compromise
- User deletion - When removing a user from your system
Important Notes
Users can also revoke access from:
- The MCP Rank dashboard
- Their Google account settings (accounts.google.com/permissions)
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid user_id |
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded |