> ## 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/v3/blockchain-data/get-messages",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Get messages

> Get messages by specified filters.



## OpenAPI

````yaml get /api/v3/messages
openapi: 3.0.0
info:
  title: TON Index (Go)
  description: >-
    TON Index collects data from a full node to PostgreSQL database and provides
    convenient API to an indexed blockchain.
  version: 1.2.4-rc
  contact: {}
servers:
  - url: https://toncenter.com
  - url: https://testnet.toncenter.com
security: []
paths:
  /api/v3/messages:
    get:
      tags:
        - Blockchain Data
      summary: Get messages
      description: Get messages by specified filters.
      operationId: api_v3_get_messages
      parameters:
        - name: msg_hash
          in: query
          description: Message hash. Acceptable in hex, base64 and base64url forms.
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: body_hash
          in: query
          description: Hash of message body.
          schema:
            type: string
        - name: source
          in: query
          description: >-
            The source account address. Can be sent in hex, base64 or base64url
            form. Use value `null` to get external messages.
          schema:
            type: string
        - name: destination
          in: query
          description: >-
            The destination account address. Can be sent in hex, base64 or
            base64url form. Use value `null` to get log messages.
          schema:
            type: string
        - name: opcode
          in: query
          description: Opcode of message in hex or signed 32-bit decimal form.
          schema:
            type: string
        - name: start_utime
          in: query
          description: Query messages with `created_at >= start_utime`.
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: end_utime
          in: query
          description: Query messages with `created_at >= start_utime`.
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: start_lt
          in: query
          description: Query messages with `created_lt >= start_lt`.
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: end_lt
          in: query
          description: Query messages with `created_lt <= end_lt`.
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: direction
          in: query
          description: Direction of message.
          schema:
            type: string
            enum:
              - in
              - out
        - name: exclude_externals
          in: query
          description: Exclude external messages.
          schema:
            type: boolean
        - name: only_externals
          in: query
          description: Return only external messages.
          schema:
            type: boolean
        - name: limit
          in: query
          description: Limit number of queried rows. Use with *offset* to batch read.
          schema:
            type: integer
            format: int32
            default: 10
            minimum: 1
            maximum: 1000
        - name: offset
          in: query
          description: Skip first N rows. Use with *limit* to batch read.
          schema:
            type: integer
            format: int32
            default: 0
            minimum: 0
        - name: sort
          in: query
          description: >-
            Sort transactions by lt. If set to `desc`, you better set `start_lt
            = 1` to get latest messages.
          schema:
            type: string
            default: desc
            enum:
              - asc
              - 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'
        decoded_opcode:
          type: string
        destination:
          type: string
        extra_flags:
          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
        interfaces:
          type: array
          items:
            type: string
        user_friendly:
          type: string
    MessageContent:
      type: object
      properties:
        body:
          type: string
        decoded:
          type: object
        hash:
          type: string
    AddressMetadata:
      type: object
      properties:
        is_indexed:
          type: boolean
        token_info:
          type: array
          items:
            $ref: '#/components/schemas/TokenInfo'
    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

````