> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoking Delegation

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/docs/javascript/reference/react-quickstart) to get started.
</Card>

Revocation is a reshare that removes the delegated server share. After revocation, the developer can no longer act on the user's behalf.

**Revocation process:**

1. User initiates revocation from their wallet
2. Dynamic performs a reshare ceremony
3. Developer's external share becomes invalid
4. All delegated operations are immediately blocked

## User Experience

### Dynamic UI

Within the Dynamic Widget, the user can navigate to the "Settings" tab, where they will see a button for Delegated Wallets.

<Frame>
  <img src="https://mintcdn.com/dynamic-docs-testing/yqJNqPH8DxpJAUhQ/images/widget/widget-settings.png?fit=max&auto=format&n=yqJNqPH8DxpJAUhQ&q=85&s=b9a722091b7e03fa3b2e1c5a6c58adc4" alt="Delegated Wallets" width="818" height="1242" data-path="images/widget/widget-settings.png" />
</Frame>

Once inside the Delegated Wallets tab, the user will see a button for Revoke Delegation, they can revoke a single wallet, or all wallets.

<Frame>
  <img src="https://mintcdn.com/dynamic-docs-testing/yqJNqPH8DxpJAUhQ/images/widget/widget-revoke-delegation.png?fit=max&auto=format&n=yqJNqPH8DxpJAUhQ&q=85&s=51d54951d8753d35f5dc786f6a69ec15" alt="Revoke Delegation" width="866" height="1240" data-path="images/widget/widget-revoke-delegation.png" />
</Frame>

### Custom UI

[`useWalletDelegation`](/docs/react/reference/hooks/embedded-wallets/usewalletdelegation) provides a `revokeDelegation` method that can be used to revoke a wallet.

```typescript theme={"system"}
import { ChainEnum } from '@dynamic-labs/sdk-api-core';

const { revokeDelegation } = useWalletDelegation();
await revokeDelegation([
  {
    chainName: ChainEnum.Evm,
    accountAddress: '0x123...',
    status: 'delegated',
  },
]);
```

**Parameters:**

* `wallets`: Array of wallet objects to revoke. Each wallet object should have:
  * `chainName`: ChainEnum - The chain the wallet is associated with
  * `accountAddress`: string - The address of the wallet to revoke
  * `status`: WalletDelegationStatus - The delegation status of the wallet (must be 'delegated' for revocation to proceed)

## Webhook payload (`wallet.delegation.revoked`)

```json theme={"system"}
{
  "eventName": "wallet.delegation.revoked",
  "eventId": "3f0a1b1c-0000-4000-8000-aaaaaaaaaaaa",
  "timestamp": "2025-10-01T16:00:00.000Z",
  "userId": "7eb7843b-2a4d-4f69-b95e-d219f0662fda",
  "data": {
    "walletId": "25193936-3ecd-4c1b-84e6-9eabc82e53c2",
    "chain": "EVM"
  }
}
```

## Cleanup checklist (server)

* Invalidate cached delegated materials for the `walletId`.
* Stop any delegated jobs/agents for the wallet.
* Remove or rotate stored delegated share and per‑wallet API key.
* Treat duplicate events as idempotent using `eventId`.
