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

# ContractsByCode lists all smart contracts for a code id

`GET /cosmwasm/wasm/v1/code/{code_id}/contracts`

## 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/code/{code_id}/contracts`
- 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
- `pagination.reverse` boolean

## Response `200`

A successful response.

- object
  - `contracts` string[]
  - `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)
