---
title: "ContractsByCode lists all smart contracts for a code id"
method: GET
path: "/wasm/v1beta1/code/{code_id}/contracts"
tags: ["Query"]
---

# ContractsByCode lists all smart contracts for a code id

`GET /wasm/v1beta1/code/{code_id}/contracts`

## Request

- The document declares no server URL.
- Auth: none declared

## Path parameters

- `code_id` string, uint64, required

## Query parameters

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

## Response `200`

A successful response.

- object
  - `contract_infos` object[]
    - `address` string
    - `contract_info` object
      - `code_id` string, uint64
      - `creator` string
      - `admin` string
      - `label` string: Label is optional metadata to be stored with a contract instance.
      - `created` object: AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions.
        - `block_height` string, uint64
        - `tx_index` string, uint64
  - `pagination` object: pagination defines the pagination in the response.
    - `next_key` string, byte
    - `total` string, uint64

## Other responses

- `default`: An unexpected error response.

## Changes

- **2020-12-11** `7a45cf376295`: 1 info
  - endpoint added
- **2020-04-20** `55279958f492`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/bianjieai/apis/irita-legacy-rest-and-grpc-gateway-docs/changes/wasm/v1beta1/code/:code_id/contracts/get.md)

---

[API](https://skmtc.dev/bianjieai/apis/irita-legacy-rest-and-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/bianjieai/apis/irita-legacy-rest-and-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/bianjieai/apis/irita-legacy-rest-and-grpc-gateway-docs/revisions/dcc6f688c291?raw)
