TonAPI API

TonAPI API as documented publicly: 22 operations. Contract generated from the documentation by API Evangelist (2026-11-16); not the provider's own document.

GitHub OpenAPI

Operations 22

GET /usage-stats Get usage statistics #
GET /v2/sse/accounts/traces Real-time notifications about traces #
GET /v2/sse/accounts/transactions Real-time notifications about finalized transactions #
GET /v2/sse/blocks Real-time notifications about new blocks #
GET /webhooks List webhooks #
POST /webhooks Create webhook #
DELETE /webhooks/{webhookId} Delete a webhook #
PATCH /webhooks/{webhookId} Update a webhook #
POST /webhooks/{webhookId}/account-tx/bulk-subscribe Bulk subscribe to account transactions #
POST /webhooks/{webhookId}/account-tx/subscribe Subscribe to account transactions #
GET /webhooks/{webhookId}/account-tx/subscriptions Get a webhook's subscriptions #
POST /webhooks/{webhookId}/account-tx/unsubscribe Unsubscribe from account transactions #
POST /webhooks/{webhookId}/back-online Mark a webhook back online #
POST /webhooks/{webhookId}/generate-new-token Generate a new webhook token #
GET /webhooks/{webhookId}/logs Get webhook logs #
POST /webhooks/{webhookId}/mempool/subscribe Subscribe to mempool events #
POST /webhooks/{webhookId}/mempool/unsubscribe Unsubscribe from mempool events #
GET /webhooks/{webhookId}/msg-opcode/subscriptions Get a webhook's opcode subscriptions #
POST /webhooks/{webhookId}/subscribe-msg-opcode/0x{opcode} Subscribe to messages with a specific opcode in a message body #
POST /webhooks/{webhookId}/subscribe-new-contracts Subscribe to events about new contract deployments #
POST /webhooks/{webhookId}/unsubscribe-msg-opcode/0x{opcode} Unsubscribe from messages with a specific opcode in a message body #
POST /webhooks/{webhookId}/unsubscribe-new-contracts Unsubscribe from events about new contract deployments #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tonapi:tonapi-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tonapi-openapi-generated.yml Raw ↑
openapi: 3.1.0
info:
  title: TonAPI API
  version: '2026-11-16'
  description: 'GENERATED FROM DOCUMENTATION by API Evangelist on 2026-11-16: 22 operation(s) read from 5 public documentation page(s) (each operation
    names its page in x-source). This is not the provider''s published contract; TonAPI has published no machine-readable contract that the pipeline
    could find. Engine: local.'
  x-evidence-tiers:
    code-example: 1
    documentation: 21
    pages-with-code: 2
    pages-read: 5
  x-generated-from: documentation
  x-provenance: generated
  x-authored-by: API Evangelist
  x-generated: '2026-11-16'
  x-generator: generate-contract-from-docs.py
  x-engine: local
  x-sources:
  - https://docs.tonapi.io/tonapi/webhooks-api
  - https://docs.tonapi.io/tonapi/streaming-api
  - https://docs.tonconsole.com/tonapi/webhooks-api
  - https://docs.tonconsole.com/tonapi/streaming-api
  - https://docs.tonconsole.com/tonapi/webhooks-api?utm_source=tonapi.io
servers:
- url: https://rt.tonapi.io
paths:
  /usage-stats:
    get:
      operationId: get_usage_stats
      tags:
      - Usage Stats
      summary: Get usage statistics
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUsageStatsResponse'
      x-evidence:
        kind: documentation
  /v2/sse/accounts/traces:
    get:
      operationId: get_v2_sse_accounts_traces
      tags:
      - Sse
      summary: Real-time notifications about traces
      x-source: https://docs.tonapi.io/tonapi/streaming-api
      parameters:
      - name: accounts
        in: query
        required: true
        schema:
          type: string
        description: Comma‑separated list of account IDs; special value "ALL" streams all traces.
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV2SseAccountsTracesResponse'
      x-evidence:
        kind: documentation
  /v2/sse/accounts/transactions:
    get:
      operationId: get_v2_sse_accounts_transactions
      tags:
      - Sse
      summary: Real-time notifications about finalized transactions
      x-source: https://docs.tonapi.io/tonapi/streaming-api
      parameters:
      - name: accounts
        in: query
        required: true
        schema:
          type: string
        description: Comma‑separated list of account IDs; special value "ALL" streams transactions for all accounts.
      - name: operations
        in: query
        required: false
        schema:
          type: string
        description: Comma‑separated list of operation names or hex strings (0x + 8 hex digits) to filter transactions.
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV2SseAccountsTransactionsResponse'
      x-evidence:
        kind: documentation
  /v2/sse/blocks:
    get:
      operationId: get_v2_sse_blocks
      tags:
      - Sse
      summary: Real-time notifications about new blocks
      x-source: https://docs.tonapi.io/tonapi/streaming-api
      parameters:
      - name: workchain
        in: query
        required: false
        schema:
          type: string
        description: Optional workchain identifier; if omitted blocks from all workchains are streamed.
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetV2SseBlocksResponse'
      x-evidence:
        kind: documentation
  /webhooks:
    get:
      operationId: get_webhooks
      tags:
      - Webhooks
      summary: List webhooks
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhooksResponse'
      x-evidence:
        kind: documentation
    post:
      operationId: post_webhooks
      tags:
      - Webhooks
      summary: Create webhook
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostWebhooksRequest'
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostWebhooksResponse'
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}:
    delete:
      operationId: delete_webhooks_webhookId
      tags:
      - Webhooks
      summary: Delete a webhook
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
    patch:
      operationId: patch_webhooks_webhookId
      tags:
      - Webhooks
      summary: Update a webhook
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchWebhooksWebhookidRequest'
      responses:
        '200':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/account-tx/bulk-subscribe:
    post:
      operationId: post_webhooks_webhookId_account_tx_bulk_subscribe
      tags:
      - Webhooks
      summary: Bulk subscribe to account transactions
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostWebhooksWebhookidAccountTxBulkSubscribeRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/account-tx/subscribe:
    post:
      operationId: post_webhooks_webhookId_account_tx_subscribe
      tags:
      - Webhooks
      summary: Subscribe to account transactions
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostWebhooksWebhookidAccountTxSubscribeRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/account-tx/subscriptions:
    get:
      operationId: get_webhooks_webhookId_account_tx_subscriptions
      tags:
      - Webhooks
      summary: Get a webhook's subscriptions
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      - name: offset
        in: query
        required: false
        schema:
          type: integer
        description: Pagination offset
      - name: limit
        in: query
        required: false
        schema:
          type: integer
        description: Pagination limit
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhooksWebhookidAccountTxSubscriptionsResponse'
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/account-tx/unsubscribe:
    post:
      operationId: post_webhooks_webhookId_account_tx_unsubscribe
      tags:
      - Webhooks
      summary: Unsubscribe from account transactions
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostWebhooksWebhookidAccountTxUnsubscribeRequest'
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/back-online:
    post:
      operationId: post_webhooks_webhookId_back_online
      tags:
      - Webhooks
      summary: Mark a webhook back online
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/generate-new-token:
    post:
      operationId: post_webhooks_webhookId_generate_new_token
      tags:
      - Webhooks
      summary: Generate a new webhook token
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostWebhooksWebhookidGenerateNewTokenResponse'
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/logs:
    get:
      operationId: get_webhooks_webhookId_logs
      tags:
      - Webhooks
      summary: Get webhook logs
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      - name: offset
        in: query
        required: false
        schema:
          type: integer
        description: Pagination offset
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhooksWebhookidLogsResponse'
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/mempool/subscribe:
    post:
      operationId: post_webhooks_webhookId_mempool_subscribe
      tags:
      - Webhooks
      summary: Subscribe to mempool events
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/mempool/unsubscribe:
    post:
      operationId: post_webhooks_webhookId_mempool_unsubscribe
      tags:
      - Webhooks
      summary: Unsubscribe from mempool events
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/msg-opcode/subscriptions:
    get:
      operationId: get_webhooks_webhookId_msg_opcode_subscriptions
      tags:
      - Webhooks
      summary: Get a webhook's opcode subscriptions
      x-source: https://docs.tonconsole.com/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      - name: offset
        in: query
        required: false
        schema:
          type: integer
      - name: limit
        in: query
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: Success (status as documented)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhooksWebhookidMsgOpcodeSubscriptionsResponse'
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/subscribe-msg-opcode/0x{opcode}:
    post:
      operationId: post_webhooks_webhookId_subscribe_msg_opcode_0x_opcode
      tags:
      - Webhooks
      summary: Subscribe to messages with a specific opcode in a message body
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      - name: opcode
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/subscribe-new-contracts:
    post:
      operationId: post_webhooks_webhookId_subscribe_new_contracts
      tags:
      - Webhooks
      summary: Subscribe to events about new contract deployments
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/unsubscribe-msg-opcode/0x{opcode}:
    post:
      operationId: post_webhooks_webhookId_unsubscribe_msg_opcode_0x_opcode
      tags:
      - Webhooks
      summary: Unsubscribe from messages with a specific opcode in a message body
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      - name: opcode
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
  /webhooks/{webhookId}/unsubscribe-new-contracts:
    post:
      operationId: post_webhooks_webhookId_unsubscribe_new_contracts
      tags:
      - Webhooks
      summary: Unsubscribe from events about new contract deployments
      x-source: https://docs.tonapi.io/tonapi/webhooks-api
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Success (status as documented)
      x-evidence:
        kind: documentation
components:
  schemas:
    GetUsageStatsResponse:
      type: object
      properties:
        period_started_at:
          type: string
          description: ISO8601 timestamp
        account_subscriptions:
          type: integer
        webhooks_delivered:
          type: integer
        webhooks_failed:
          type: integer
    GetV2SseAccountsTracesResponse:
      type: object
      properties:
        event:
          type: string
          description: Either "heartbeat" or "message".
        id:
          type: string
          description: Event identifier.
        data:
          type: object
          description: JSON representation of a trace, containing "accounts" array and "hash".
    GetV2SseAccountsTransactionsResponse:
      type: object
      properties:
        event:
          type: string
          description: Either "heartbeat" or "message".
        id:
          type: string
          description: Event identifier.
        data:
          type: object
          description: JSON representation of a transaction, e.g. account_id, lt, tx_hash.
    GetV2SseBlocksResponse:
      type: object
      properties:
        event:
          type: string
          description: Either "heartbeat" or "message".
        id:
          type: string
          description: Event identifier.
        data:
          type: object
          description: JSON representation of a block, e.g. workchain, shard, seqno, root_hash, file_hash.
    GetWebhooksResponse:
      type: object
      properties:
        webhooks:
          type: array
          description: Array of webhook objects
        id:
          type: integer
          description: Webhook identifier
        endpoint:
          type: string
          description: Webhook endpoint URL
    PostWebhooksRequest:
      type: object
      properties:
        endpoint:
          type: string
          description: Webhook endpoint URL
      required:
      - endpoint
    PostWebhooksResponse:
      type: object
      properties:
        webhook_id:
          type: integer
          description: Identifier of the created webhook
    PatchWebhooksWebhookidRequest:
      type: object
      properties:
        endpoint:
          type: string
        add_transaction_info:
          type: boolean
        add_account_info:
          type: boolean
    PostWebhooksWebhookidAccountTxBulkSubscribeRequest:
      type: object
      properties:
        accounts:
          type: string
          description: multipart/form-data file with account IDs, one per line
      required:
      - accounts
    PostWebhooksWebhookidAccountTxSubscribeRequest:
      type: object
      properties:
        accounts:
          type: array
          description: List of account objects to subscribe to
        account_id:
          type: string
          description: TON account identifier
      required:
      - accounts
      - account_id
    GetWebhooksWebhookidAccountTxSubscriptionsResponse:
      type: object
      properties:
        account_tx_subscriptions:
          type: array
          description: List of account transaction subscriptions
        account_id:
          type: string
          description: TON account identifier
        last_delivered_lt:
          type: integer
          description: Last delivered logical time
        failed_at:
          type: string
          description: Time of last failure
        failed_lt:
          type: integer
          description: Logical time of last failure
        failed_attempts:
          type: integer
          description: Number of consecutive failures
    PostWebhooksWebhookidAccountTxUnsubscribeRequest:
      type: object
      properties:
        accounts:
          type: array
          description: List of account IDs to unsubscribe from
        account_id:
          type: string
          description: TON account identifier
      required:
      - accounts
      - account_id
    PostWebhooksWebhookidGenerateNewTokenResponse:
      type: object
      properties:
        token:
          type: string
    GetWebhooksWebhookidLogsResponse:
      type: object
      properties:
        next_offset:
          type: integer
        logs:
          type: array
          description: Array of log objects
    GetWebhooksWebhookidMsgOpcodeSubscriptionsResponse:
      type: object
      properties:
        subscriptions:
          type: array
          description: List of opcode subscription objects
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
security:
- bearer: []
tags:
- name: Sse
- name: Usage Stats
- name: Webhooks