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

# Subscribe to Mempool MSG

> Subscribe to mempool events. When a new message enters the mempool, TONAPI sends a POST request to the webhook URL.



## OpenAPI

````yaml POST /webhooks/{webhook_id}/mempool/subscribe
openapi: 3.0.0
info:
  title: Webhooks API for TON blockchain
  version: 1.0.0
  description: Real-time webhook subscriptions for TON blockchain events
  contact:
    name: Support
    email: support@tonkeeper.com
servers:
  - url: https://rt.tonapi.io
  - url: https://rt-testnet.tonapi.io
security:
  - BearerAuth: []
tags:
  - name: Webhooks
    description: Webhook CRUD operations
  - name: Account TX
    description: Account transaction subscriptions
  - name: Mempool MSG
    description: Mempool message subscriptions
  - name: Opcode MSG
    description: Opcode message subscriptions
  - name: New Contracts
    description: New contract deployment subscriptions
paths:
  /webhooks/{webhook_id}/mempool/subscribe:
    post:
      tags:
        - Mempool MSG
      summary: Subscribe to Mempool MSG
      description: >-
        Subscribe to mempool events. When a new message enters the mempool,
        TONAPI sends a POST request to the webhook URL.
      operationId: subscribeMempoolMsg
      parameters:
        - $ref: '#/components/parameters/WebhookId'
      responses:
        '200':
          description: Subscribed
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    WebhookId:
      name: webhook_id
      in: path
      required: true
      schema:
        type: integer
      description: Webhook identifier.
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: unauthorized
            status_code: 401
    NotFound:
      description: Webhook not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: webhook not found
            status_code: 404
  schemas:
    ErrorResponse:
      type: object
      required:
        - message
        - status_code
      properties:
        message:
          type: string
        status_code:
          type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        API key from [tonconsole.com](https://tonconsole.com/). Can also be
        passed as a `token` query parameter.

````