block by version - Movement

Returns the block that contains a given ledger (transaction) version. Use it to map a transaction version back to its block.

Endpoint

httpGET /v1/blocks/by_version/{version}

Path Parameters

ParameterTypeDescription
versionstringLedger (transaction) version

Query Parameters

ParameterTypeDescription
with_transactionsstringInclude full transactions (true/false)

Example

bashexport MOVEMENT_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl "${MOVEMENT_REST}v1/blocks/by_version/285000000?with_transactions=false"

Response

json{
    "block_height": "120000000",
    "block_hash": "0x7md...",
    "block_timestamp": "1736772000000000",
    "first_version": "285000000",
    "last_version": "285000003"
}

Response Fields

FieldTypeDescription
block_heightstringHeight of the block containing the version
first_versionstringFirst version in the block
last_versionstringLast version in the block

Use Cases

  • Version Mapping: Resolve a transaction version to its block

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid
404 / Not foundNot foundThe account, block, transaction, or resource does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect