---
title: "Channels queries all the IBC channels of a chain."
method: GET
path: "/ibc/core/channel/v1/channels"
tags: ["Query"]
---

# Channels queries all the IBC channels of a chain.

`GET /ibc/core/channel/v1/channels`

## Request

- The document declares no server URL.
- Auth: none declared
- TypeScript: <https://skmtc.dev/cosmos/apis/ibc-go-grpc-gateway-docs/docs/ibc/core/channel/v1/channels/get.ts> (a function with typed inputs; its response is checked against the schema)

## 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: QueryChannelsResponse is the response type for the Query/Channels RPC method.
  - `channels` object[]: list of stored channels of the chain.
    - `state` 'STATE_UNINITIALIZED_UNSPECIFIED' | 'STATE_INIT' | 'STATE_TRYOPEN' | 'STATE_OPEN' | 'STATE_CLOSED': State defines if a channel is in one of the following states: CLOSED, INIT, TRYOPEN, OPEN, or UNINITIALIZED. - STATE_UNINITIALIZED_UNSPECIFIED: Default State - STATE_INIT: A channel has just started the opening handshake. - STATE_TRYOPEN: A channel has acknowledged the handshake step on the counterparty chain. - STATE_OPEN: A channel has completed the handshake. Open channels are ready to send and receive packets. - STATE_CLOSED: A channel has been closed and can no longer be used to send or receive packets.
    - `ordering` 'ORDER_NONE_UNSPECIFIED' | 'ORDER_UNORDERED' | 'ORDER_ORDERED': - ORDER_NONE_UNSPECIFIED: zero-value for channel ordering - ORDER_UNORDERED: packets can be delivered in any order, which may differ from the order in which they were sent. - ORDER_ORDERED: packets are delivered exactly in the order which they were sent
    - `counterparty` object
      - `port_id` string: port on the counterparty chain which owns the other end of the channel.
      - `channel_id` string
    - `connection_hops` string[]
    - `version` string
    - `port_id` string
    - `channel_id` string
  - `pagination` object: PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest. message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }
    - `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
  - `height` object: Normally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag. This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height.
    - `revision_number` string, uint64
    - `revision_height` string, uint64

## Other responses

- `default`: An unexpected error response.

## Changes

- **2022-08-01** `8d0e0b0b2bda`: 1 info
  - added the new optional `query` request parameter `pagination.reverse`
- **2021-07-19** `cb56bc693679`: 1 warning
  - deleted the `query` request parameter `pagination.reverse`

[Operation history](https://skmtc.dev/cosmos/apis/ibc-go-grpc-gateway-docs/changes/ibc/core/channel/v1/channels/get.md)

---

[API](https://skmtc.dev/cosmos/apis/ibc-go-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/cosmos/apis/ibc-go-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/cosmos/apis/ibc-go-grpc-gateway-docs/revisions/50daa3dd79ce?raw)
