POSTview_access_key_list

NEAR Mainnethttps://near-mainnet.nodit.io/

Returns every access key registered on an account, with each key's public key, nonce, and permission (full access, function call, or gas key).

Call the query method with request_type: "view_access_key_list". Querying an account that does not exist returns the UNKNOWN_ACCOUNT error. You can page through the list with limit and after_key. On nodes that support pagination, querying an account with more keys than the node limit without paging returns the TOO_MANY_ACCESS_KEYS error. Nodes that do not support pagination ignore limit and return the full list.

Request Body
jsonrpcstringrequired
idstringrequired

Request ID. Any string; it is returned unchanged in the response.

methodstringrequired
request_typestring (enum)required

Query type. Fixed to view_access_key_list for listing access keys.

finalitystring (enum)

Specifies the block finality. Cannot be used together with block_id.

  • optimistic: the latest block the node has received (may be reorganized)
  • near-final: a Doomslug-final block (not reverted in most cases)
  • final: a fully finalized block
block_idinteger

Specifies the block to query by block height (integer) or block hash (base58 string). Cannot be used together with finality.

account_idstringrequired

NEAR account ID. A human-readable name (e.g. wrap.near) or a 64-character hex implicit account ID.

after_keystring

Resume listing after this public key (exclusive). Pass the last_key from the previous response.

limitinteger

Maximum number of access keys to return in one page

Responses
jsonrpcstring

JSON-RPC version

idstring

Request ID

keysobject[]

Access keys registered on the account

public_keystring

Public key (base58 string prefixed with ed25519: or secp256k1:)

access_keyobject

Nonce and permission of the key

nonceinteger

Current nonce of the key. The next transaction signed with this key must use a nonce greater than this value.

permissiononeOf

Access key permission. The format depends on the key type.

  • "FullAccess": a key that can perform any action on the account (string)
  • {"FunctionCall": {...}}: a key that can only call methods on the specified contract
  • {"GasKeyFullAccess": {...}}: a gas key that can perform any action (an access key prefunded with NEAR to pay for gas)
  • {"GasKeyFunctionCall": {...}}: a gas key that can only make function calls
FullAccessstring (enum)
FunctionCallobject
FunctionCallobject
GasKeyFullAccessobject
GasKeyFullAccessobject
GasKeyFunctionCallobject
GasKeyFunctionCallobject

An object with the same allowance, receiver_id, and method_names as FunctionCall, plus the gas key's balance and num_nonces.

last_keystring

Public key to pass as after_key to fetch the next page. Present only when the list was truncated; absent on the last page or when no page is requested.

block_heightinteger

Block height.

Example: 220785385

block_hashstring

Base58-encoded 32-byte hash (block hash, chunk hash, transaction hash, etc.).

Example: 8EjuQRnAJiWkRmqxfexQFJWXXonuSMbz5AZziJLCWnWS

namestring (enum)

Error class. REQUEST_VALIDATION_ERROR (invalid request), HANDLER_ERROR (processing error), INTERNAL_ERROR (node internal error)

causeobject

The specific cause of the error.

namestring

Name of the error cause (e.g. UNKNOWN_BLOCK, UNKNOWN_ACCOUNT, PARSE_ERROR)

infoobject

Additional information about the error (block hash, height, account ID, etc.)

codeinteger

Legacy JSON-RPC error code (e.g. -32000 server error, -32700 parse error, -32601 method not found)

messagestring

Legacy error message

datastring

Legacy error details

X-API-KEY
RequestCU60
cURL
curl -X POST "https://near-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "dontcare",
    "method": "query",
    "params": {
      "request_type": "view_access_key_list",
      "finality": "final",
      "block_id": 220785385,
      "account_id": "wrap.near",
      "after_key": "ed25519:132zsRazNn1nE1YnjaKdVHHakbyKzgoZesmbXsVUQUsx",
      "limit": 2
    }
  }'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "result": {
    "keys": [
      {
        "public_key": "ed25519:168vdqFUxij2yvsxYgAGoykJMX7tgrPKVCH484A8nHP",
        "access_key": {
          "nonce": 65790930078045,
          "permission": "FullAccess"
        }
      },
      {
        "public_key": "ed25519:5sBuVB7SudWfVJhDU4wV7dQdVLJoznL3reuoTaT6NQpg",
        "access_key": {
          "nonce": 66806870000000,
          "permission": {
            "FunctionCall": {
              "allowance": "250000000000000000000000",
              "method_names": [],
              "receiver_id": "v2.ref-farming.near"
            }
          }
        }
      }
    ],
    "block_height": 220785367,
    "block_hash": "9qz64F7AVWFKD4poUDuGSZ7CYK74g8xcLH6joVQgThPr"
  }
}