---
title: "POST /EXPERIMENTAL_call_function"
method: POST
path: "/EXPERIMENTAL_call_function"
---

# POST /EXPERIMENTAL_call_function

`POST /EXPERIMENTAL_call_function`

## Request

- The document declares no server URL.
- Auth: none declared

Calls a view function on a contract and returns the result.

## Request body

- JsonRpcRequestForEXPERIMENTALCallFunction
  - `id` string, required
  - `jsonrpc` string, required
  - `method` 'EXPERIMENTAL_call_function', required
  - `params` union, required
    - object
      - `block_id` union, required
        - integer
        - string
      - `account_id` string, required: NEAR Account Identifier. This is a unique, syntactically valid, human-readable account identifier on the NEAR network. [See the crate-level docs for information about validation.](index.html#account-id-rules) Also see [Error kind precedence](AccountId#error-kind-precedence). ## Examples ``` use near_account_id::AccountId; let alice: AccountId = "alice.near".parse().unwrap(); assert!("ƒelicia.near".parse::<AccountId>().is_err()); // (ƒ is not f) ```
      - `args_base64` string, bytes, required: This type is used to mark function arguments. NOTE: The main reason for this to exist (except the type-safety) is that the value is transparently serialized and deserialized as a base64-encoded string when serde is used (serde_json).
      - `method_name` string, required
      - `state_init` union: The initial state of a `0s` or `0u` account, as its state-init action carries it.
        - object
          - `deterministic` object, required
            - `code` union, required
              - …
            - `data` object, required
        - object
          - `universal` string, required: Raw bytes containing borsh-serialized `UniversalStateInit`. This is the protocol's view of a state init, not a mere transport wrapper: the account ID is SHA3-256 over exactly these bytes. The typed form is a decoded *view* of them, used to install the state and to price the action, and it is never re-serialized to derive an ID. From `CanonicalUniversalStateInit` on, only the canonical encoding is accepted (see `UniversalStateInit::from_raw_strict`), so each logical value has one ID. It also lets an immutable contract pass through a `UniversalStateInit` version it predates: the bytes travel verbatim, so a version added after the contract was compiled still works. Borsh-serializing `RawStateInit` writes a 4-byte length prefix before the bytes, which is how the `UniversalStateInit` action carries it as a field; over serde the bytes are base64. Neither is what the account ID hashes: that is `self.0` alone, never `borsh::to_vec(self)`.
    - object
      - `finality` 'optimistic' | 'near-final' | 'final', required: Different types of finality.
      - `account_id` string, required: NEAR Account Identifier. This is a unique, syntactically valid, human-readable account identifier on the NEAR network. [See the crate-level docs for information about validation.](index.html#account-id-rules) Also see [Error kind precedence](AccountId#error-kind-precedence). ## Examples ``` use near_account_id::AccountId; let alice: AccountId = "alice.near".parse().unwrap(); assert!("ƒelicia.near".parse::<AccountId>().is_err()); // (ƒ is not f) ```
      - `args_base64` string, bytes, required: This type is used to mark function arguments. NOTE: The main reason for this to exist (except the type-safety) is that the value is transparently serialized and deserialized as a base64-encoded string when serde is used (serde_json).
      - `method_name` string, required
      - `state_init` union: The initial state of a `0s` or `0u` account, as its state-init action carries it.
        - object
          - `deterministic` object, required
            - `code` union, required
              - …
            - `data` object, required
        - object
          - `universal` string, required: Raw bytes containing borsh-serialized `UniversalStateInit`. This is the protocol's view of a state init, not a mere transport wrapper: the account ID is SHA3-256 over exactly these bytes. The typed form is a decoded *view* of them, used to install the state and to price the action, and it is never re-serialized to derive an ID. From `CanonicalUniversalStateInit` on, only the canonical encoding is accepted (see `UniversalStateInit::from_raw_strict`), so each logical value has one ID. It also lets an immutable contract pass through a `UniversalStateInit` version it predates: the bytes travel verbatim, so a version added after the contract was compiled still works. Borsh-serializing `RawStateInit` writes a 4-byte length prefix before the bytes, which is how the `UniversalStateInit` action carries it as a field; over serde the bytes are base64. Neither is what the account ID hashes: that is `self.0` alone, never `borsh::to_vec(self)`.
    - object
      - `sync_checkpoint` 'genesis' | 'earliest_available', required
      - `account_id` string, required: NEAR Account Identifier. This is a unique, syntactically valid, human-readable account identifier on the NEAR network. [See the crate-level docs for information about validation.](index.html#account-id-rules) Also see [Error kind precedence](AccountId#error-kind-precedence). ## Examples ``` use near_account_id::AccountId; let alice: AccountId = "alice.near".parse().unwrap(); assert!("ƒelicia.near".parse::<AccountId>().is_err()); // (ƒ is not f) ```
      - `args_base64` string, bytes, required: This type is used to mark function arguments. NOTE: The main reason for this to exist (except the type-safety) is that the value is transparently serialized and deserialized as a base64-encoded string when serde is used (serde_json).
      - `method_name` string, required
      - `state_init` union: The initial state of a `0s` or `0u` account, as its state-init action carries it.
        - object
          - `deterministic` object, required
            - `code` union, required
              - …
            - `data` object, required
        - object
          - `universal` string, required: Raw bytes containing borsh-serialized `UniversalStateInit`. This is the protocol's view of a state init, not a mere transport wrapper: the account ID is SHA3-256 over exactly these bytes. The typed form is a decoded *view* of them, used to install the state and to price the action, and it is never re-serialized to derive an ID. From `CanonicalUniversalStateInit` on, only the canonical encoding is accepted (see `UniversalStateInit::from_raw_strict`), so each logical value has one ID. It also lets an immutable contract pass through a `UniversalStateInit` version it predates: the bytes travel verbatim, so a version added after the contract was compiled still works. Borsh-serializing `RawStateInit` writes a 4-byte length prefix before the bytes, which is how the `UniversalStateInit` action carries it as a field; over serde the bytes are base64. Neither is what the account ID hashes: that is `self.0` alone, never `borsh::to_vec(self)`.

## Response `200`

- union
  - object
    - `result` RpcCallFunctionResponse, required: A result returned by contract method
      - `block_hash` string, required
      - `block_height` integer, required
      - `logs` string[], required
      - `result` integer[], required
    - `id` string, required
    - `jsonrpc` string, required
  - object
    - `error` union, required
      - object
        - `cause` union, required
          - object
            - `info` object, required
              - …
            - `name` 'METHOD_NOT_FOUND', required
          - object
            - `info` object, required
              - …
            - `name` 'PARSE_ERROR', required
        - `name` 'REQUEST_VALIDATION_ERROR', required
      - object
        - `cause` union, required
          - object
            - `info` object, required
              - …
            - `name` 'UNKNOWN_BLOCK', required
          - object
            - `info` object, required
              - …
            - `name` 'INVALID_ACCOUNT', required
          - object
            - `info` object, required
              - …
            - `name` 'UNKNOWN_ACCOUNT', required
          - object
            - `info` object, required
              - …
            - `name` 'UNINITIALIZED_ACCOUNT', required
          - object
            - `info` object, required
              - …
            - `name` 'INVALID_STATE_INIT', required
          - object
            - `info` object, required
              - …
            - `name` 'NO_CONTRACT_CODE', required
          - object
            - `info` object, required
              - …
            - `name` 'NO_GLOBAL_CONTRACT_CODE', required
          - object
            - `info` object, required
              - …
            - `name` 'CONTRACT_EXECUTION_ERROR', required
          - object
            - `info` object, required
              - …
            - `name` 'EXTERNAL_CALL_REFUSED', required
          - object
            - `info` object, required
              - …
            - `name` 'INTERNAL_ERROR', required
        - `name` 'HANDLER_ERROR', required
      - object
        - `cause` InternalError, required
          - `info` object, required
            - `error_message` string, required
          - `name` 'INTERNAL_ERROR', required
        - `name` 'INTERNAL_ERROR', required
    - `id` string, required
    - `jsonrpc` string, required

## Changes

- **2026-11-16** `1ce6181198ef`: 1 breaking
  - added `subschema #10, subschema #11` to the `oneOf[subschema #2]/error/oneOf[subschema #2]/cause/oneOf[subschema #9]/info/error/oneOf[subschema #1]/ActionError/kind/allOf[#/components/schemas/ActionErrorKind]/oneOf[subschema #14]/NewReceiptValidationError` response property `oneOf` list for the response status `200`
- **2026-11-16** `a634a6925baf`: 1 breaking
  - added `subschema #9` to the `oneOf[subschema #2]/error/oneOf[subschema #2]/cause` response property `oneOf` list for the response status `200`
- **2026-11-12** `79ed36295796`: 1 breaking
  - added `subschema #32` to the `oneOf[subschema #2]/error/oneOf[subschema #2]/cause/oneOf[subschema #5]/info/error` response property `oneOf` list for the response status `200`
- **2026-11-11** `4c768e7e42ba`: 1 breaking, 1 info
  - added `subschema #5, subschema #7` to the `oneOf[subschema #2]/error/oneOf[subschema #2]/cause` response property `oneOf` list for the response status `200`
  - added the new optional request property `params/state_init`
- **2026-11-06** `d1370d8e7a8c`: 1 breaking
  - added `subschema #4` to the `oneOf[subschema #2]/error/oneOf[subschema #2]/cause` response property `oneOf` list for the response status `200`

[Operation history](https://skmtc.dev/near/apis/near-protocol-json-rpc-api-3/changes/EXPERIMENTAL_call_function/post.md)

---

[API](https://skmtc.dev/near/apis/near-protocol-json-rpc-api-3.md) - [All operations](https://skmtc.dev/near/apis/near-protocol-json-rpc-api-3/llms.txt) - [OpenAPI document](https://skmtc.dev/near/apis/near-protocol-json-rpc-api-3/revisions/961a6d5d2b57?raw)
