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

# Get Block Header

> Get block header information



## 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 [JSON-RPC
    endpoint](#json%20rpc)  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: Mainnet
  - url: https://testnet.toncenter.com
    description: Testnet
security: []
tags:
  - name: utils
    description: Some useful methods
  - name: accounts
    description: Information about accounts
  - name: blocks
    description: Information about blocks
  - name: transactions
    description: Fetching and locating transactions
  - name: configuration
    description: Information about blockchain config
  - name: run method
    description: Run get-method of smart contracts
  - name: send
    description: Send data to blockchain
  - name: rpc
    description: JSON-RPC and POST endpoints
paths:
  /api/v2/getBlockHeader:
    get:
      tags:
        - blocks
      summary: Get Block Header
      description: Get block header information
      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: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                  result:
                    title: BlockHeader
                    allOf:
                      - $ref: '#/components/schemas/BlockHeader'
                required:
                  - ok
                  - result
        default:
          $ref: '#/components/responses/default'
components:
  parameters:
    workchain:
      name: workchain
      in: query
      description: Workchain ID
      required: true
      schema:
        type: integer
        format: int32
    shard:
      name: shard
      in: query
      description: Shard ID
      required: true
      schema:
        type: string
        x-usrv-cpp-type: std::int64_t
    seqno:
      name: seqno
      in: query
      description: Seqno of a block
      required: true
      schema:
        type: integer
        format: int32
    rootHashOptional:
      name: root_hash
      in: query
      description: Root hash of a block
      required: false
      schema:
        type: string
        x-usrv-cpp-type: '#/components/schemas/TonHash'
    fileHashOptional:
      name: file_hash
      in: query
      description: File hash of a block
      required: false
      schema:
        type: string
        x-usrv-cpp-type: '#/components/schemas/TonHash'
  schemas:
    BlockHeader:
      type: object
      additionalProperties: true
      description: Block header information.
      properties:
        '@type':
          type: string
          enum:
            - blocks.header
          default: blocks.header
        id:
          $ref: '#/components/schemas/TonBlockIdExt'
          description: Extended identifier of the block.
        global_id:
          type: integer
          description: Global network identifier.
        version:
          type: integer
          description: Block format version.
        after_merge:
          type: boolean
          description: True if block was created after a merge.
        after_split:
          type: boolean
          description: True if block was created after a split.
        before_split:
          type: boolean
          description: True if block was created before a split.
        want_merge:
          type: boolean
          description: Indicates if validators wanted a merge.
        want_split:
          type: boolean
          description: Indicates if validators wanted a split.
        validator_list_hash_short:
          type: integer
          description: Short hash of validator list.
        catchain_seqno:
          type: integer
          description: Catchain sequence number.
        min_ref_mc_seqno:
          type: integer
          description: Minimum referenced masterchain seqno.
        is_key_block:
          type: boolean
          description: True if this block is a key block.
        prev_key_block_seqno:
          type: integer
          description: Previous key block sequence number.
        start_lt:
          type: string
          description: Starting logical time.
          x-usrv-cpp-type: std::int64_t
        end_lt:
          type: string
          description: Ending logical time.
          x-usrv-cpp-type: std::int64_t
        gen_utime:
          type: integer
          description: Block generation UNIX timestamp.
        prev_blocks:
          type: array
          description: List of previous block identifiers.
          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
        workchain:
          type: integer
        shard:
          type: string
          x-usrv-cpp-type: std::int64_t
        seqno:
          type: integer
        root_hash:
          $ref: '#/components/schemas/TonHash'
        file_hash:
          $ref: '#/components/schemas/TonHash'
      required:
        - '@type'
        - workchain
        - shard
        - seqno
        - root_hash
        - file_hash
      description: Extended block identifier.
    TonlibErrorResponse:
      type: object
      additionalProperties: false
      title: TonlibErrorResponse
      required:
        - ok
        - error
        - code
      properties:
        ok:
          type: boolean
          title: Ok
          default: false
        error:
          type: string
          title: Error description
        code:
          type: integer
          title: Error code
          minimum: 100
          maximum: 600
        '@extra':
          type: string
          title: Extra information
        jsonrpc:
          type: string
        id:
          type: string
    TonHash:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_hash
  responses:
    default:
      description: Tonlib error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TonlibErrorResponse'
          examples:
            '409':
              summary: Not a token
              value:
                ok: false
                code: 409
                error: Smart contract is not a Jetton or NFT
                '@extra': ...
            '422':
              summary: Request validation error
              value:
                ok: false
                code: 422
                error: ...
                '@extra': ...
            '429':
              summary: Ratelimit exceeded
              value:
                ok: false
                code: 429
                error: ...
                '@extra': ...
            '504':
              summary: Tonlib timeout
              value:
                ok: false
                code: 504
                error: ...
                '@extra': ...

````