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

# Account Management API events

[Account management Snaps](/snaps/features/custom-evm-accounts/) can notify MetaMask of the following [Account Management API](/snaps/reference/keyring-api/account-management/) events.

### `AccountCreated`[​](#accountcreated "Direct link to accountcreated")

An account is created. MetaMask returns an error if the account already exists or the account object is invalid.

#### Example[​](#example "Direct link to Example")

```
try {
  emitSnapKeyringEvent(snap, KeyringEvent.AccountCreated, { account })
  // Update your Snap's state.
} catch (error) {
  // Handle the error.
}

```

### `AccountUpdated`[​](#accountupdated "Direct link to accountupdated")

An account is updated. MetaMask returns an error if one of the following is true:

- The account does not exist.
- The account object is invalid.
- The account address is updated.

#### Example[​](#example-1 "Direct link to Example")

```
try {
  emitSnapKeyringEvent(snap, KeyringEvent.AccountUpdated, { account })
  // Update your Snap's state.
} catch (error) {
  // Handle the error.
}

```

### `AccountDeleted`[​](#accountdeleted "Direct link to accountdeleted")

An account is deleted. The delete event is idempotent, so it is safe to emit even if the account does not exist.

#### Example[​](#example-2 "Direct link to Example")

```
try {
  emitSnapKeyringEvent(snap, KeyringEvent.AccountDeleted, {
    id: account.id,
  })
  // Update your Snap's state.
} catch (error) {
  // Handle the error.
}

```

### `RequestApproved`[​](#requestapproved "Direct link to requestapproved")

A request is approved. MetaMask returns an error if the request does not exist. This event only applies to Snaps that [handle requests asynchronously](/snaps/features/custom-evm-accounts/#asynchronous-transaction-flow).

#### Example[​](#example-3 "Direct link to Example")

```
try {
  emitSnapKeyringEvent(snap, KeyringEvent.RequestApproved, {
    id: request.id,
    result,
  })
  // Update your Snap's state.
} catch (error) {
  // Handle the error.
}

```

### `RequestRejected`[​](#requestrejected "Direct link to requestrejected")

A request is rejected. MetaMask returns an error if the request does not exist. This event only applies to Snaps that [handle requests asynchronously](/snaps/features/custom-evm-accounts/#asynchronous-transaction-flow).

#### Example[​](#example-4 "Direct link to Example")

```
try {
  emitSnapKeyringEvent(snap, KeyringEvent.RequestRejected, {
    id: request.id,
  })
  // Update your Snap's state.
} catch (error) {
  // Handle the error.
}

```
