> ## 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/blocks/get-block-header",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Get block header

> Returns block metadata without the full transaction list. Includes timestamps, validator info, and references to previous blocks. Intended for block explorers and other use cases that require block information without transactions.



## OpenAPI

````yaml get /api/v2/getBlockHeader
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/getBlockHeader:
    get:
      tags:
        - Blocks
      summary: Get block header
      description: >-
        Returns block metadata without the full transaction list. Includes
        timestamps, validator info, and references to previous blocks. Intended
        for block explorers and other use cases that require block information
        without transactions.
      operationId: getBlockHeader_get
      parameters:
        - $ref: '#/components/parameters/workchain'
        - $ref: '#/components/parameters/shard'
        - $ref: '#/components/parameters/seqno'
        - $ref: '#/components/parameters/rootHashOptional'
        - $ref: '#/components/parameters/fileHashOptional'
      responses:
        '200':
          description: >-
            Returns the block header with merge/split flags, validator info, and
            timing data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockHeaderResponse'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422_block'
        '429':
          $ref: '#/components/responses/429'
        '504':
          $ref: '#/components/responses/504'
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
components:
  parameters:
    workchain:
      name: workchain
      in: query
      description: >-
        The workchain to query. Use `-1` for masterchain (validators, system
        contracts, config) or `0` for basechain (regular accounts and
        contracts). Most user transactions happen on workchain `0`.
      required: true
      schema:
        type: integer
        format: int32
    shard:
      name: shard
      in: query
      description: >-
        The shard identifier. Masterchain always uses `-9223372036854775808`.
        For basechain, shards split and merge dynamically. Use the `shards`
        endpoint to discover current shard configuration.
      required: true
      schema:
        type: string
        x-usrv-cpp-type: std::int64_t
    seqno:
      name: seqno
      in: query
      description: >-
        Masterchain block sequence number (block height). Used to query state at
        a specific point in time. If omitted, returns the current state.
      required: true
      schema:
        type: integer
        format: int32
    rootHashOptional:
      name: root_hash
      in: query
      description: >-
        The block's root hash for verification. Together with `file_hash`, this
        uniquely and cryptographically identifies a block. Only needed when
        proof of block identity is required.
      required: false
      schema:
        type: string
        x-usrv-cpp-type: '#/components/schemas/TonHash'
    fileHashOptional:
      name: file_hash
      in: query
      description: >-
        The block's file hash for verification. Together with `root_hash`, this
        provides cryptographic proof of block identity. Only needed for
        trustless verification.
      required: false
      schema:
        type: string
        x-usrv-cpp-type: '#/components/schemas/TonHash'
  schemas:
    BlockHeaderResponse:
      type: object
      additionalProperties: false
      required:
        - ok
        - result
      properties:
        ok:
          type: boolean
          default: true
          description: >-
            Returns `true` if the request succeeded; otherwise `false`. See the
            `error` field for details.
        result:
          $ref: '#/components/schemas/BlockHeader'
          description: Response data. Present only when `ok` is `true`.
        '@extra':
          type: string
          description: >-
            Optional request ID that can be passed in the request and received
            back in the response. Useful for matching async responses.
    BlockHeader:
      type: object
      additionalProperties: true
      description: >-
        Block metadata including creation time, validator info, and links to
        previous blocks. Does not include the transactions themselves.
      properties:
        '@type':
          type: string
          enum:
            - blocks.header
          default: blocks.header
          description: >-
            TonLib type identifier for block header objects. Refer to the
            [TonLib type reference](/ecosystem/api/toncenter/v2-tonlib-types)
            for a full list.
        id:
          $ref: '#/components/schemas/TonBlockIdExt'
          description: >-
            Full block identifier including workchain, shard, `seqno`, and
            hashes.
        global_id:
          type: integer
          description: Global network ID (`-239` for mainnet, `-3` for testnet).
        version:
          type: integer
          description: Block format version number.
        after_merge:
          type: boolean
          description: >-
            Returns `true` if this block was created immediately after a shard
            merge; otherwise `false`.
        after_split:
          type: boolean
          description: >-
            Returns `true` if this block was created immediately after a shard
            split; otherwise `false`.
        before_split:
          type: boolean
          description: >-
            Returns `true` if this shard will split after this block; otherwise
            `false`.
        want_merge:
          type: boolean
          description: >-
            Returns `true` if validators have signaled a preference to merge
            this shard; otherwise `false`.
        want_split:
          type: boolean
          description: >-
            Returns `true` if validators have signaled a preference to split
            this shard; otherwise `false`.
        validator_list_hash_short:
          type: integer
          description: Short hash of the validator set active during this block.
        catchain_seqno:
          type: integer
          description: Catchain sequence number used for validator consensus.
        min_ref_mc_seqno:
          type: integer
          description: Minimum masterchain block `seqno` referenced by this block.
        is_key_block:
          type: boolean
          description: >-
            Returns `true` if this is a key block containing validator set
            changes or config updates; otherwise `false`.
        prev_key_block_seqno:
          type: integer
          description: Sequence number of the previous key block.
        start_lt:
          type: string
          description: Logical time at the start of this block.
          x-usrv-cpp-type: std::int64_t
        end_lt:
          type: string
          description: >-
            Logical time at the end of this block. All transactions in this
            block have `lt` between `start_lt` and `end_lt`.
          x-usrv-cpp-type: std::int64_t
        gen_utime:
          type: integer
          description: Unix timestamp when this block was generated.
        prev_blocks:
          type: array
          description: >-
            Array of previous block identifiers (`workchain`, `shard`, `seqno`,
            `root_hash`, `file_hash`). Usually contains one entry, but two after
            a shard merge.
          items:
            $ref: '#/components/schemas/TonBlockIdExt'
      required:
        - '@type'
        - id
        - global_id
        - version
        - after_merge
        - after_split
        - before_split
        - want_merge
        - want_split
        - validator_list_hash_short
        - catchain_seqno
        - min_ref_mc_seqno
        - is_key_block
        - prev_key_block_seqno
        - start_lt
        - end_lt
        - gen_utime
        - prev_blocks
    TonBlockIdExt:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - ton.blockIdExt
          default: ton.blockIdExt
          description: >-
            TonLib type identifier for full block identifiers. Refer to the
            [TonLib type reference](/ecosystem/api/toncenter/v2-tonlib-types)
            for a full list.
        workchain:
          type: integer
          description: 'Workchain ID: `-1` for masterchain, `0` for basechain.'
        shard:
          type: string
          x-usrv-cpp-type: std::int64_t
          description: >-
            Shard identifier as a signed 64-bit integer string. Masterchain uses
            `-9223372036854775808`.
        seqno:
          type: integer
          description: >-
            Block sequence number within its workchain and shard. For the
            masterchain (workchain `-1`), this equals the global block height.
            For basechain shards (workchain `0`), this is the sequence number
            local to that specific shard, not a global height.
        root_hash:
          $ref: '#/components/schemas/TonHash'
          description: Merkle root hash of the block state tree.
        file_hash:
          $ref: '#/components/schemas/TonHash'
          description: >-
            Hash of the serialized block file. Together with `root_hash`,
            uniquely identifies a block.
      required:
        - '@type'
        - workchain
        - shard
        - seqno
        - root_hash
        - file_hash
      description: >-
        A complete block identifier with cryptographic hashes. Contains
        `workchain`, `shard`, `seqno` (position) plus `root_hash` and
        `file_hash` (verification).
    TonHash:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_hash
      description: >-
        A 256-bit hash value. Accepts either hex format (64 characters) or
        base64 format (44 characters). Used for block hashes, transaction
        hashes, and cryptographic proofs.
  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_block:
      description: Invalid block query parameters.
      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:
                  - workchain required
                  - shard required
                  - seqno required
                  - failed to parse workchain
                  - failed to parse shard
                  - failed to parse root_hash
                  - failed to parse seqno
                  - seqno should be positive
                  - from_seqno should be non-negative
              '@extra':
                type: string
                description: Extra data passed through from the request.
          example:
            ok: false
            code: 422
            error: workchain required
  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.

````