Skip to main content
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"}'
{
  "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

X-API-Key
string
required
Your MCP Rank API key

Body Parameters

user_id
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"}'
{
  "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.)
The user will need to re-authenticate to access their data again.

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 CodeDescription
400Invalid user_id
401Missing or invalid API key
429Rate limit exceeded