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

# Request permissions

[Snaps must request permission](#request-permissions-from-a-snap) to access certain powerful JavaScript globals or API methods. [Dapps must also request permission](#request-permissions-from-a-dapp) to access certain API methods to communicate with Snaps.

Snaps and dapps follow the [EIP-2255 wallet permissions specification](https://eips.ethereum.org/EIPS/eip-2255).

## Request permissions from a Snap[​](#request-permissions-from-a-snap "Direct link to Request permissions from a Snap")

### Snaps API methods[​](#snaps-api-methods "Direct link to Snaps API methods")

Request permission to call [Snaps API methods](/snaps/reference/snaps-api/) in the `initialPermissions` field of the Snap [manifest file](/snaps/learn/about-snaps/files/#manifest-file). For example, to request to call [snap_dialog](/snaps/reference/snaps-api/snap%5Fdialog/), add the following to the manifest file:

snap.manifest.json

```
"initialPermissions": {
  "snap_dialog": {}
}

```

note

All Snaps API methods except the following interactive UI methods require requesting permission in the manifest file:

- [snap_createInterface](/snaps/reference/snaps-api/snap%5Fcreateinterface/)
- [snap_getInterfaceState](/snaps/reference/snaps-api/snap%5Fgetinterfacestate/)
- [snap_updateInterface](/snaps/reference/snaps-api/snap%5Fupdateinterface/)

### Endowments[​](#endowments "Direct link to Endowments")

Endowments are a type of permission. Request endowments in the `initialPermissions` field of the Snap [manifest file](/snaps/learn/about-snaps/files/#manifest-file). See the [Snaps permissions reference](/snaps/reference/permissions/) for the full list of endowments.

For example, to request the [endowment:network-access](/snaps/reference/permissions/#endowmentnetwork-access)permission, add the following to the manifest file:

snap.manifest.json

```
"initialPermissions": {
  "endowment:network-access": {}
}

```

### Dynamic permissions[​](#dynamic-permissions "Direct link to Dynamic permissions")

Dynamic permissions are not requested in the manifest file. Instead, your Snap can acquire dynamic permissions during its lifecycle.

For example, request permission to call the [eth_accounts](/metamask-connect/evm/reference/json-rpc-api/)MetaMask JSON-RPC API method by calling [eth_requestAccounts](/metamask-connect/evm/reference/json-rpc-api/). See the [eth_accounts dynamic permission](/snaps/reference/permissions/#eth%5Faccounts) for more information.

## Request permissions from a dapp[​](#request-permissions-from-a-dapp "Direct link to Request permissions from a dapp")

Dapps that communicate with Snaps using [wallet_snap](/snaps/reference/snaps-api/wallet%5Fsnap/)or [wallet_invokeSnap](/snaps/reference/snaps-api/wallet%5Finvokesnap/) must request permission to do so by calling [wallet_requestSnaps](/snaps/reference/snaps-api/wallet%5Frequestsnaps/) first.

The following example calls `wallet_requestSnaps` to request permission to connect to the `hello-snap` Snap, then calls `wallet_invokeSnap` to invoke the `hello` JSON-RPC method exposed by the Snap:

index.js

```
// If the Snap is not already installed, the user will be prompted to install it.
await window.ethereum.request({
  method: 'wallet_requestSnaps',
  params: {
    // Assuming the Snap is published to npm using the package name "hello-snap".
    'npm:hello-snap': {},
  },
})

// Invoke the "hello" JSON-RPC method exposed by the Snap.
const response = await window.ethereum.request({
  method: 'wallet_invokeSnap',
  params: { snapId: 'npm:hello-snap', request: { method: 'hello' } },
})

console.log(response) // "world!"

```

note

Learn more about implementing [custom JSON-RPC APIs](/snaps/learn/about-snaps/apis/#custom-json-rpc-apis) in a Snap.
