> For the complete documentation index, see [llms.txt](/llms.txt).

# Invalid delegator

The [Delegation Manager](/smart-accounts-kit/development/reference/glossary#delegation-manager)**Delegation Manager** The ERC-7710 component that validates and redeems delegations, including signature checks and caveat enforcer hooks. reverts with `InvalidDelegator()` when the caller is not the [delegator](/smart-accounts-kit/development/reference/glossary#delegator-account)**Delegator account** The account that creates and signs a delegation to grant limited authority to another account.specified in the delegation.

This error is thrown by the `disableDelegation` and `enableDelegation` contract functions. Only the account that created the delegation can [disable](/smart-accounts-kit/development/guides/delegation/disable-delegation/)or enable it.

## Solution[​](#solution "Direct link to Solution")

Verify that you're sending the transaction from the delegator's account. If the delegator is a smart account, submit a [user operation](/smart-accounts-kit/development/reference/glossary#user-operation)**User operation** A pseudo-transaction object defined by ERC-4337 that describes what a smart account should execute. User operations are submitted to the alternate mempool managed by bundlers. through the smart account.

```
import { DelegationManager } from '@metamask/smart-accounts-kit/contracts'

// Generate calldata to disable the delegation.
const disableCalldata = DelegationManager.encode.disableDelegation({
  delegation: signedDelegation, // Signed by delegatorSmartAccount
})

const userOpHash = await bundlerClient.sendUserOperation({
  account: delegatorSmartAccount,
  calls: [
    {
      to: delegatorSmartAccount.environment.DelegationManager,
      data: disableCalldata,
    },
  ],
})

```
