> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ton.org/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/ecosystem/api/toncenter/v2/rpc/json-rpc-endpoint",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# JSON-RPC endpoint

> All API methods are available through this single endpoint using JSON-RPC 2.0 protocol. Send the method name in the `method` field and parameters as a dictionary in `params`. Useful for calling multiple methods in sequence or when JSON-RPC is preferred over REST.



## OpenAPI

````yaml post /api/v2/jsonRPC
openapi: 3.1.1
info:
  title: TON HTTP API C++
  description: >
    This API enables HTTP access to TON blockchain - getting accounts and
    wallets information, looking up blocks and transactions, sending messages to
    the blockchain, calling get methods of smart contracts, and more.


    In addition to REST API, all methods are available through a JSON-RPC
    endpoint  with `method` equal to method name and `params` passed as a
    dictionary.


    The response contains a JSON object, which always has a boolean field `ok`
    and either `error` or `result`. If `ok` equals true, the request was
    successful and the result of the query can be found in the `result` field.
    In case of an unsuccessful request, `ok` equals false and the error is
    explained in the `error`.


    API Key should be sent either as `api_key` query parameter or `X-API-Key`
    header
  version: 2.1.1
servers:
  - url: https://toncenter.com
    description: TON Mainnet
  - url: https://testnet.toncenter.com
    description: TON Testnet
security: []
tags:
  - name: Accounts
    description: Information about accounts
  - name: Transactions
    description: Fetching and locating transactions
  - name: Blocks
    description: Information about blocks
  - name: Run method
    description: Run get-method of smart contracts
  - name: Send
    description: Send data to blockchain
  - name: Utils
    description: Some useful methods
  - name: Configuration
    description: Information about blockchain config
  - name: RPC
    description: JSON-RPC and POST endpoints
paths:
  /api/v2/jsonRPC:
    post:
      tags:
        - RPC
      summary: JSON-RPC endpoint
      description: >-
        All API methods are available through this single endpoint using
        JSON-RPC 2.0 protocol. Send the method name in the `method` field and
        parameters as a dictionary in `params`. Useful for calling multiple
        methods in sequence or when JSON-RPC is preferred over REST.
      operationId: jsonRPC_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
        required: true
      responses:
        '200':
          description: Returns the result of the specified JSON-RPC method call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TonlibResponse'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422_jsonrpc'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500_execution'
        '504':
          $ref: '#/components/responses/504'
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
components:
  schemas:
    JsonRpcRequest:
      type: object
      additionalProperties: false
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: JSON-RPC protocol version identifier.
        id:
          type: string
          description: >-
            Request identifier. Echoed back in the response for matching async
            calls.
        method:
          type: string
          description: >-
            API method name to invoke (e.g., `getMasterchainInfo`,
            `getAddressBalance`).
        params:
          type: object
          additionalProperties: true
          description: Method parameters as a JSON object with key-value pairs.
      description: >-
        A JSON-RPC 2.0 request. Set `method` to the API method name (e.g.,
        "getWalletInformation") and `params` to a dictionary of parameters.
    TonlibResponse:
      type: object
      title: TonlibResponse
      additionalProperties: false
      required:
        - ok
        - result
        - '@extra'
      properties:
        ok:
          type: boolean
          title: Ok
          default: true
          description: >-
            Returns `true` if the request succeeded; otherwise `false`. See the
            `error` field for details.
        result:
          type: object
          description: >-
            The method return value. The structure depends on the method called;
            see individual method documentation for response schemas. Only
            present when `ok` is `true`.
          additionalProperties: true
        '@extra':
          type: string
          title: Extra information
          description: >-
            Optional request ID that can be passed in the request and received
            back in the response. Useful for matching async responses.
        jsonrpc:
          type: string
          description: JSON-RPC protocol version identifier.
        id:
          type: string
          description: Echoed request identifier from the original JSON-RPC request.
  responses:
    '401':
      description: API key does not exist. Check for typos or generate a new key.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 401
                description: HTTP status code `401`.
              error:
                type: string
                enum:
                  - API key does not exist
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 401
            error: API key does not exist
    '403':
      description: >-
        API key is not allowed for this network (e.g. testnet key used on
        mainnet).
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 403
                description: HTTP status code `403`.
              error:
                type: string
                enum:
                  - Network not allowed
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 403
            error: Network not allowed
    '429':
      description: >-
        Rate limit exceeded. Back off and retry, or use an API key for higher
        limits.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 429
                description: HTTP status code `429`.
              error:
                type: string
                enum:
                  - Ratelimit exceeded
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 429
            error: Ratelimit exceeded
    '504':
      description: Timeout waiting for liteserver response.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 504
                description: HTTP status code `504`.
              error:
                type: string
                enum:
                  - LITE_SERVER_NETWORK timeout
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 504
            error: LITE_SERVER_NETWORK timeout
    422_jsonrpc:
      description: Invalid JSON-RPC request.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 422
                description: HTTP status code `422`.
              error:
                type: string
                enum:
                  - params must contain an object
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 422
            error: params must contain an object
    500_execution:
      description: Get method or simulation execution failed.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - ok
              - code
              - error
            properties:
              ok:
                type: boolean
                const: false
                description: Always `false` for error responses.
              code:
                type: integer
                const: 500
                description: HTTP status code `500`.
              error:
                type: string
                enum:
                  - Exit code <N> != 0
                  - Stack size <N> < 5
                  - 'Failed to parse int: <value>'
                  - stackEntryNumber expected
                  - stackEntryCell expected at <N> position
                  - stackEntryCell or stackEntrySlice expected
                  - addr_ext is not supported
                  - addr_var is not supported
                  - anycast is not supported
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 500
            error: Exit code <N> != 0
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key header of the form `X-API-Key: <token>`, where `<token>` is the
        API key. Requests without a key are limited to 1 RPS. Refer to the
        [authentication guide](/ecosystem/api/toncenter/v2-authentication) for
        details.
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: >-
        API key query parameter of the form `?api_key=<token>`, where `<token>`
        is the API key. Equivalent to the header method. Refer to the
        [authentication guide](/ecosystem/api/toncenter/v2-authentication) for
        details.

````