---
title: "ContractHistory gets the contract code history"
method: GET
path: "/cosmwasm/wasm/v1/contract/{address}/history"
tags: ["Query"]
---

# ContractHistory gets the contract code history

`GET /cosmwasm/wasm/v1/contract/{address}/history`

## Request

- Base URL: `https://api.mantrachain.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mantrachain.io/cosmwasm/wasm/v1/contract/{address}/history`
- Auth: none declared

## Path parameters

- `address` string, required

## Query parameters

- `pagination.key` string, byte
- `pagination.offset` string, uint64
- `pagination.limit` string, uint64
- `pagination.count_total` boolean
- `pagination.reverse` boolean

## Response `200`

A successful response.

- object
  - `entries` object[]
    - `operation` 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED' | 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT' | 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE' | 'CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS': - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: ContractCodeHistoryOperationTypeUnspecified placeholder for empty value - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: ContractCodeHistoryOperationTypeInit on chain contract instantiation - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: ContractCodeHistoryOperationTypeMigrate code migration - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: ContractCodeHistoryOperationTypeGenesis based on genesis data
    - `code_id` string, uint64
    - `updated` object: Updated Tx position when the operation was executed.
      - `block_height` string, uint64
      - `tx_index` string, uint64
    - `msg` string, byte
  - `pagination` object: pagination defines the pagination in the response.
    - `next_key` string, byte: next_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results.
    - `total` string, uint64

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/mantrachain/apis/mantra-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/mantrachain/apis/mantra-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/mantrachain/apis/mantra-grpc-gateway-docs/revisions/641ce457f7fd?raw)
