> ## 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 revocation works and how to handle the webhook and clean up on your server.

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

## Using the Client API

You can revoke delegation programmatically using the Dynamic client:

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

const client = createClient({
  environmentId: 'your-environment-id',
  // ... other config
});

// Revoke delegation for specific wallets
await client.wallets.waas.delegation.revokeDelegation({
  wallets: [
    { chainName: ChainEnum.Evm, accountAddress: '0x123...' },
    { chainName: ChainEnum.Sol, accountAddress: 'abc...' },
  ],
});

// Revoke delegation with password (if wallet was delegated with password)
await client.wallets.waas.delegation.revokeDelegation({
  wallets: [
    { chainName: ChainEnum.Evm, accountAddress: '0x123...' },
  ],
  password: 'secure-password',
});
```

**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
* `password` (optional): string - The password used when delegating, if applicable

<Note>
  If the wallet was originally delegated with a password, you must provide the same password when revoking. Learn more about [password encryption](/react-native/wallets/embedded-wallets/mpc/password-encryption).
</Note>

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