Skip to main content
The RPC API enables you to retrieve information about an account’s access keys. Access keys are cryptographic keys that allow actions to be performed on behalf of an account, with different permission levels for security.

Access Key Types

  • Full Access Keys: Can perform any action on the account, including deploying contracts, managing other keys, and transferring funds
  • Function Call Keys: Restricted to calling specific contract methods with limited allowance for gas fees

Quick Reference

MethodEndpointPurpose
view_access_keyQuery single keyGet details of a specific access key
view_access_key_listQuery all keysList all access keys for an account
single_access_key_changesTrack specific changesMonitor changes to specific keys
all_access_key_changesTrack all changesMonitor all key changes for accounts

View access key

Returns information about a single access key for a given account. If permission of the key is FunctionCall, it will return more details such as the allowance, receiver_id, and method_names.
method
string
required
query
request_type
string
required
view_access_key
finality
string
Block finality (optimistic, near-final, or final). See finality param.
block_id
number | string
Block height or hash. See block_id param.
account_id
string
required
Example: "example.testnet"
public_key
string
required
Example: "ed25519:..."
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "query",
  "params": {
    "request_type": "view_access_key",
    "finality": "final",
    "account_id": "account.rpc-examples.testnet",
    "public_key": "ed25519:EddTahJwZpJjYPPmat7DBm1m2vdrFBzVv7e3T4hzkENd"
  }
}
{
  "jsonrpc": "2.0",
  "result": {
    "block_hash": "J1zkrK8sHuzzV8pkXsEPrZH7SQZeJ2NSEs9L1hSWzVgg",
    "block_height": 187316844,
    "nonce": 187309654000001,
    "permission": {
      "FunctionCall": {
        "allowance": "149788200694421800000000",
        "method_names": [
          "write_record",
          "get_record",
          "get_greeting",
          "__contract_abi",
          "contract_source_metadata"
        ],
        "receiver_id": "contract.rpc-examples.testnet"
      }
    }
  },
  "id": "dontcare"
}
For error handling information, see the RPC Errors documentation.

View access key list

Returns all access keys for a given account.
method
string
required
query
request_type
string
required
view_access_key_list
finality
string
Block finality (optimistic, near-final, or final). See finality param.
block_id
number | string
Block height or hash. See block_id param.
account_id
string
required
Example: "example.testnet"
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "query",
  "params": {
    "request_type": "view_access_key_list",
    "finality": "final",
    "account_id": "account.rpc-examples.testnet"
  }
}
{
  "jsonrpc": "2.0",
  "result": {
    "block_hash": "29G6xeV4ufkVsY24YZPfiRwLMTNoKrAMitrjg6nvVZqq",
    "block_height": 187319080,
    "keys": [
      {
        "access_key": {
          "nonce": 187309654000000,
          "permission": "FullAccess"
        },
        "public_key": "ed25519:vJBU18AtvePANmepMoY3rtV3wt1RHwqoktak82E4d2M"
      },
      {
        "access_key": {
          "nonce": 187309654000001,
          "permission": {
            "FunctionCall": {
              "allowance": "149788200694421800000000",
              "method_names": [
                "write_record",
                "get_record",
                "get_greeting",
                "__contract_abi",
                "contract_source_metadata"
              ],
              "receiver_id": "contract.rpc-examples.testnet"
            }
          }
        },
        "public_key": "ed25519:EddTahJwZpJjYPPmat7DBm1m2vdrFBzVv7e3T4hzkENd"
      }
    ]
  },
  "id": "dontcare"
}

View access key changes (single)

Returns individual access key changes in a specific block. You can query multiple keys by passing an array of objects containing the account_id and public_key.
method
string
required
changes
changes_type
string
required
single_access_key_changes
keys
array
required
Array of objects: [{ account_id, public_key }]
finality
string
Block finality. See finality param.
block_id
number | string
Block height or hash. See block_id param.
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "changes",
  "params": {
    "changes_type": "single_access_key_changes",
    "keys": [
      {
        "account_id": "account.rpc-examples.testnet",
        "public_key": "ed25519:EddTahJwZpJjYPPmat7DBm1m2vdrFBzVv7e3T4hzkENd"
      }
    ],
    "block_id": "6RWmTYhXCzjMjoY3Mz1rfFcnBm8E6XeDDbFEPUA4sv1w"
  }
}

View access key changes (all)

Returns changes to all access keys of a specific block. Multiple accounts can be queried by passing an array of account_ids.
method
string
required
changes
changes_type
string
required
all_access_key_changes
account_ids
array
required
Example: ["example.testnet", "example2.testnet"]
finality
string
Block finality. See finality param.
block_id
number | string
Block height or hash. See block_id param.
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "changes",
  "params": {
    "changes_type": "all_access_key_changes",
    "account_ids": ["account.rpc-examples.testnet"],
    "block_id": 187309655
  }
}

Best Practices

  • Use specific queries: Use view_access_key when you know the exact key instead of listing all keys
  • Cache results: Access key information does not change frequently, consider caching
  • Batch operations: When checking multiple keys, use single_access_key_changes with multiple keys
  • Archival nodes: Only use archival endpoints when historical data is required

Build docs developers (and LLMs) love