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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/near/docs/llms.txt
Use this file to discover all available pages before exploring further.
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
| Method | Endpoint | Purpose |
|---|---|---|
view_access_key | Query single key | Get details of a specific access key |
view_access_key_list | Query all keys | List all access keys for an account |
single_access_key_changes | Track specific changes | Monitor changes to specific keys |
all_access_key_changes | Track all changes | Monitor all key changes for accounts |
View access key
Returns information about a single access key for a given account. Ifpermission of the key is FunctionCall, it will return more details such as the allowance, receiver_id, and method_names.
queryview_access_keyBlock finality (
optimistic, near-final, or final). See finality param.Block height or hash. See block_id param.
Example:
"example.testnet"Example:
"ed25519:..."View access key list
Returns all access keys for a given account.queryview_access_key_listBlock finality (
optimistic, near-final, or final). See finality param.Block height or hash. See block_id param.
Example:
"example.testnet"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 theaccount_id and public_key.
changessingle_access_key_changesArray of objects:
[{ account_id, public_key }]Block finality. See finality param.
Block height or hash. See block_id param.
View access key changes (all)
Returns changes to all access keys of a specific block. Multiple accounts can be queried by passing an array ofaccount_ids.
changesall_access_key_changesExample:
["example.testnet", "example2.testnet"]Block finality. See finality param.
Block height or hash. See block_id param.
Best Practices
- Use specific queries: Use
view_access_keywhen 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_changeswith multiple keys - Archival nodes: Only use archival endpoints when historical data is required