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

# Get messages

> Get messages by specified filters.



## OpenAPI

````yaml get /api/v3/messages
openapi: 3.0.0
info:
  description: >-
    TON Index collects data from a full node to PostgreSQL database and provides
    convenient API to an indexed blockchain.
  title: TON Index (Go)
  contact: {}
  version: 1.1.0
servers:
  - url: https://toncenter.com
  - url: https://testnet.toncenter.com/
security: []
paths:
  /api/v3/messages:
    get:
      tags:
        - blockchain
      summary: Get messages
      description: Get messages by specified filters.
      operationId: api_v3_get_messages
      parameters:
        - description: Message hash. Acceptable in hex, base64 and base64url forms.
          name: msg_hash
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: Hash of message body.
          name: body_hash
          in: query
          schema:
            type: string
        - description: >-
            The source account address. Can be sent in hex, base64 or base64url
            form. Use value `null` to get external messages.
          name: source
          in: query
          schema:
            type: string
        - description: >-
            The destination account address. Can be sent in hex, base64 or
            base64url form. Use value `null` to get log messages.
          name: destination
          in: query
          schema:
            type: string
        - description: Opcode of message in hex or signed 32-bit decimal form.
          name: opcode
          in: query
          schema:
            type: string
        - description: Query messages with `created_at >= start_utime`.
          name: start_utime
          in: query
          schema:
            type: integer
            minimum: 0
        - description: Query messages with `created_at >= start_utime`.
          name: end_utime
          in: query
          schema:
            type: integer
            minimum: 0
        - description: Query messages with `created_lt >= start_lt`.
          name: start_lt
          in: query
          schema:
            type: integer
            minimum: 0
        - description: Query messages with `created_lt <= end_lt`.
          name: end_lt
          in: query
          schema:
            type: integer
            minimum: 0
        - description: Direction of message.
          name: direction
          in: query
          schema:
            type: string
            enum:
              - in
              - out
        - description: Exclude external messages.
          name: exclude_externals
          in: query
          schema:
            type: boolean
        - description: Return only external messages.
          name: only_externals
          in: query
          schema:
            type: boolean
        - description: Limit number of queried rows. Use with *offset* to batch read.
          name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 10
        - description: Skip first N rows. Use with *limit* to batch read.
          name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
        - description: Sort transactions by lt.
          name: sort
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestError'
      security: []
components:
  schemas:
    MessagesResponse:
      type: object
      properties:
        address_book:
          $ref: '#/components/schemas/AddressBook'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
        metadata:
          $ref: '#/components/schemas/Metadata'
    RequestError:
      type: object
      properties:
        code:
          type: integer
        error:
          type: string
    AddressBook:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/AddressBookRow'
    Message:
      type: object
      properties:
        bounce:
          type: boolean
        bounced:
          type: boolean
        created_at:
          type: string
          example: '0'
        created_lt:
          type: string
          example: '0'
        destination:
          type: string
        fwd_fee:
          type: string
          example: '0'
        hash:
          type: string
        hash_norm:
          type: string
        ihr_disabled:
          type: boolean
        ihr_fee:
          type: string
          example: '0'
        import_fee:
          type: string
          example: '0'
        in_msg_tx_hash:
          type: string
        init_state:
          $ref: '#/components/schemas/MessageContent'
        message_content:
          $ref: '#/components/schemas/MessageContent'
        opcode:
          type: integer
        out_msg_tx_hash:
          type: string
        source:
          type: string
        value:
          type: string
          example: '0'
        value_extra_currencies:
          type: object
          additionalProperties:
            type: string
    Metadata:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/AddressMetadata'
    AddressBookRow:
      type: object
      properties:
        domain:
          type: string
        user_friendly:
          type: string
    MessageContent:
      type: object
      properties:
        body:
          type: string
        decoded:
          $ref: '#/components/schemas/DecodedContent'
        hash:
          type: string
    AddressMetadata:
      type: object
      properties:
        is_indexed:
          type: boolean
        token_info:
          type: array
          items:
            $ref: '#/components/schemas/TokenInfo'
    DecodedContent:
      type: object
      properties:
        comment:
          type: string
        type:
          type: string
    TokenInfo:
      type: object
      properties:
        description:
          type: string
        extra:
          type: object
          additionalProperties: true
        image:
          type: string
        name:
          type: string
        nft_index:
          type: string
        symbol:
          type: string
        type:
          type: string
        valid:
          type: boolean

````