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

# commit

> Get commit results at a specified height

Get Commit.

If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.



## OpenAPI

````yaml /cometbft/latest/api-reference/rpc/openapi.yaml get /commit
openapi: 3.0.0
info:
  title: CometBFT RPC
  contact:
    name: CometBFT
    url: https://docs.cosmos.network/cometbft
  description: >
    CometBFT supports the following RPC protocols:


    * URI over HTTP

    * JSONRPC over HTTP

    * JSONRPC over websockets


    ## Configuration


    RPC can be configured by tuning parameters under `[rpc]` table in the

    `$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line

    flags.


    The default RPC listen address is `tcp://127.0.0.1:26657`.

    To set another address, set the `laddr` config parameter to desired value.

    CORS (Cross-Origin Resource Sharing) can be enabled by setting

    `cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`

    config parameters.


    If testing using a local RPC node, under the `[rpc]`

    section change the `cors_allowed_origins` property, please add the URL of

    the site where this OpenAPI document is running, for example:

      `cors_allowed_origins = ["http://localhost:8088"]`

    or if testing from the official documentation site:

      `cors_allowed_origins = ["https://docs.cosmos.network"]`

    ## Arguments


    Arguments which expect strings or byte arrays may be passed as quoted

    strings, like `"abc"` or as `0x`-prefixed strings, like `0x616263`.


    ## URI/HTTP


    A REST like interface.

        curl localhost:26657/block?height=5

    ## JSONRPC/HTTP


    JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.

        curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657

    ## JSONRPC/websockets


    JSONRPC requests can be also made via websocket.

    The websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.

    Asynchronous RPC functions like event `subscribe` and `unsubscribe` are

    only available via websockets.


    For example using the [websocat](https://github.com/vi/websocat) tool, you
    can subscribe for 'NewBlock` events

    with the following command:

        echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket
  version: v0.38.x
  license:
    name: Apache 2.0
    url: https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE
servers:
  - url: https://rpc.cosmos.directory/cosmoshub
    description: Interact with the CometBFT RPC from a public node in the Cosmos registry
  - url: http://localhost:26657
    description: Interact with CometBFT RPC node running locally
security: []
tags:
  - name: Info
    description: Informations about the node APIs
  - name: Tx
    description: Transactions broadcast APIs
  - name: ABCI
    description: ABCI APIs
  - name: Evidence
    description: Evidence APIs
  - name: Unsafe
    description: Unsafe APIs
paths:
  /commit:
    get:
      tags:
        - Info
      summary: commit
      description: |-
        Get commit results at a specified height

        Get Commit.

        If the `height` field is set to a non-default value, upon success, the
        `Cache-Control` header will be set with the default maximum age.
      operationId: commit
      parameters:
        - in: query
          name: height
          description: >-
            height to return. If no height is provided, it will fetch commit
            informations regarding the latest block.
          schema:
            type: integer
            default: 0
            example: 1
      responses:
        '200':
          description: >
            Commit results.


            canonical switches from false to true for block H once block H+1 has
            been committed. Until then it's subjective and only reflects what
            this node has seen so far.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommitResponse'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CommitResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
        id:
          type: integer
          example: 0
        result:
          required:
            - signed_header
            - canonical
          properties:
            signed_header:
              required:
                - header
                - commit
              properties:
                header:
                  $ref: '#/components/schemas/BlockHeader'
                commit:
                  required:
                    - height
                    - round
                    - block_id
                    - signatures
                  properties:
                    height:
                      type: string
                      example: '1311801'
                    round:
                      type: integer
                      example: 0
                    block_id:
                      $ref: '#/components/schemas/BlockID'
                    signatures:
                      type: array
                      items:
                        type: object
                        properties:
                          block_id_flag:
                            type: integer
                            example: 2
                          validator_address:
                            type: string
                            example: 000001E443FD237E4B616E2FA69DF4EE3D49A94F
                          timestamp:
                            type: string
                            example: '2019-04-22T17:01:58.376629719Z'
                          signature:
                            type: string
                            example: >-
                              14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw==
                  type: object
              type: object
            canonical:
              type: boolean
              example: true
          type: object
    ErrorResponse:
      description: Error Response
      allOf:
        - $ref: '#/components/schemas/JSONRPC'
        - type: object
          properties:
            error:
              type: string
              example: Description of failure
    BlockHeader:
      required:
        - version
        - chain_id
        - height
        - time
        - last_block_id
        - last_commit_hash
        - data_hash
        - validators_hash
        - next_validators_hash
        - consensus_hash
        - app_hash
        - last_results_hash
        - evidence_hash
        - proposer_address
      properties:
        version:
          required:
            - block
            - app
          properties:
            block:
              type: string
              example: '10'
            app:
              type: string
              example: '0'
          type: object
        chain_id:
          type: string
          example: cosmoshub-2
        height:
          type: string
          example: '12'
        time:
          type: string
          example: '2019-04-22T17:01:51.701356223Z'
        last_block_id:
          $ref: '#/components/schemas/BlockID'
        last_commit_hash:
          type: string
          example: 21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812
        data_hash:
          type: string
          example: 970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73
        validators_hash:
          type: string
          example: D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0
        next_validators_hash:
          type: string
          example: D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0
        consensus_hash:
          type: string
          example: 0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8
        app_hash:
          type: string
          example: 223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C
        last_results_hash:
          type: string
          example: ''
        evidence_hash:
          type: string
          example: ''
        proposer_address:
          type: string
          example: D540AB022088612AC74B287D076DBFBC4A377A2E
      type: object
    BlockID:
      required:
        - hash
        - parts
      properties:
        hash:
          type: string
          example: 112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7
        parts:
          required:
            - total
            - hash
          properties:
            total:
              type: integer
              example: 1
            hash:
              type: string
              example: 38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD
          type: object
    JSONRPC:
      type: object
      properties:
        id:
          type: integer
          example: 0
        jsonrpc:
          type: string
          example: '2.0'

````