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

# Revoking Delegation

> How to revoke delegated access in Flutter.

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

You can use `initDelegationProcess` to open the delegation management UI where users can revoke delegation:

```dart theme={"system"}
await DynamicSDK.instance.wallets.initDelegationProcess();
```

### Custom UI

Use the `revokeDelegation` method to revoke delegation for specific wallets programmatically:

```dart theme={"system"}
import 'package:dynamic_sdk/dynamic_sdk.dart';

await DynamicSDK.instance.wallets.revokeDelegation(
  wallets: [
    DelegationWalletIdentifier(
      chainName: ChainEnum.evm,
      accountAddress: '0x123...',
    ),
  ],
);
```

You can also revoke multiple wallets at once:

```dart theme={"system"}
await DynamicSDK.instance.wallets.revokeDelegation(
  wallets: [
    DelegationWalletIdentifier(
      chainName: ChainEnum.evm,
      accountAddress: '0xABC...',
    ),
    DelegationWalletIdentifier(
      chainName: ChainEnum.sol,
      accountAddress: 'DEF123...',
    ),
  ],
);
```

## 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`.
