# List counterparties

> List counterparties visible to the agent.

`GET /v1/agent-api/counterparties`

## Query parameters

| Field     | Type                | Required | Description                                                                                                                                                                                                                                                                                         |
| --------- | ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `address` | string              |          | Only counterparties with a wallet rail at this address; bank rails never match                                                                                                                                                                                                                      |
| `network` | `"base"` \| `"arc"` |          | Only counterparties owning a wallet address in this network class; a matching rail can omit network when its configured destination is unavailable to the agent; such a rail cannot receive an agent send until that configuration or the organization's capability changes; bank rails never match |

## Responses

| Status | Description                                                |
| ------ | ---------------------------------------------------------- |
| `200`  | Visible counterparties                                     |
| `400`  | Malformed address, unknown network, or network not enabled |

## Response fields

| Field                     | Type                              | Required | Description |
| ------------------------- | --------------------------------- | -------- | ----------- |
| `counterparties`          | array of object                   | Yes      |             |
| `counterparties[].id`     | string                            | Yes      |             |
| `counterparties[].name`   | string                            | Yes      |             |
| `counterparties[].status` | `"ready"` \| `"awaiting_details"` | Yes      |             |
| `counterparties[].rails`  | array of object                   | Yes      |             |

## Example

### SDK

```ts
import { createCatenaClient } from "@catena/sdk"

// Reads CATENA_SECRET_KEY
const client = createCatenaClient()

const { counterparties } = await client.listCounterparties()
```

### CLI

```sh
catena counterparties list
```

### Response `200`

```json
{
  "counterparties": [
    {
      "id": "cp_01JC2Z1A3C5E7G9J2L4N6Q8S0U",
      "name": "Acme Supplies",
      "status": "ready",
      "rails": [
        {
          "id": "cpr_01JC2Z1B4D6F8H0K2M4P6R8T1V",
          "type": "bank",
          "bankName": "First National Bank",
          "accountNumber": "9876543210"
        },
        {
          "id": "cpr_01JC2Z1C5E7G9J1L3N5Q7S9U2W",
          "type": "wallet",
          "walletAddress": "0x7d3e2f1a0b4b5a9c8d7e6f3a2b1c0d9e8f7a6b5c",
          "network": "base",
          "asset": "usdc"
        }
      ]
    }
  ]
}
```
