> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Guardians

> List the wallets that hold GUARDIAN_ROLE on a market, or check one address

Returns every wallet that holds `GUARDIAN_ROLE` on the market. Pass `address` to ask about one wallet. [Guardian and brakes](https://docs.trusset.org/endpoints/lending/introduction.md#guardian-and-brakes) says what the role can and cannot do.

The list is built from the lending index's record of `grantRole` and `revokeRole` on the market, then checked against the chain. Every listed wallet is read with `hasRole`, and a wallet the index no longer shows but the chain confirms is added without its grant details.

The market admin names a guardian after adoption, with [Set Access Role](https://docs.trusset.org/endpoints/operators/set-access-role.md) as `MARKET_GUARDIAN`. Trusset and the factory never hold the role, and no market has a guardian by default. The oracle reads the role off the market, so this list also says who may halt its prices with [Halt Prices](https://docs.trusset.org/endpoints/lending/halt-prices.md).

## Path Parameters

**marketId** `string` *required*

The market's record ID, as `id` on [List Markets](https://docs.trusset.org/endpoints/lending/list-markets.md), not its contract address. See [Market IDs](https://docs.trusset.org/endpoints/lending/list-markets.md#market-ids).

## Query Parameters

**address** `string`

A wallet to check, as a 0x-prefixed 40-character hex address. The response then carries `address` and `isGuardian` beside the list, and the wallet is read from the chain whether or not the index lists it. The zero address is ignored, as if none were sent.

## Response Fields

**data** `object`

**supported** `boolean`

`true`: the market carries `GUARDIAN_ROLE`. `null` when it could not be read.

**marketAddress** `string`

The market, lowercased.

**role** `string`

`GUARDIAN_ROLE`.

**roleHash** `string`

`keccak256("GUARDIAN_ROLE")`, the identifier the contract uses for the role.

**guardians** `array`

The wallets holding the role, lowercased. Empty when nobody holds it, or when neither the index nor the chain answered.

**address** `string`

The guardian wallet.

**grantedAt** `string`

When the index recorded the grant, ISO 8601. `null` when the chain confirms the role but the index does not show the grant.

**grantedBy** `string`

The admin wallet that signed the grant, or `null`.

**txHash** `string`

The grant transaction, or `null`.

**confirmed** `boolean`

`true` when the chain confirms the role. `null` when the chain read failed and the entry rests on the index alone.

**indexed** `boolean`

Whether the list is complete, which means the lending index answered. When `false`, the list holds at most the wallet `address` asked about.

**address** `string`

Present with the `address` query: the wallet asked about, lowercased.

**isGuardian** `boolean`

Present with the `address` query. Whether that wallet holds the role on chain. `null` when the read failed.

> [!WARNING]
>
> A wallet the index shows but the chain no longer confirms is dropped from the list. One whose chain read failed stays listed with `confirmed: null`. Treat that as unknown, not as a held role, and read again before relying on it.

```bash cURL theme={null}
curl "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/guardians?address=0x7d3c2b91e04a58f6c1d9a72b3c8f40e6d15a9c27" \
  -H "X-API-Key: trusset_your_key_here"
```

```typescript TypeScript theme={null}
const res = await fetch(
  `https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/guardians?address=${walletAddress}`,
  { headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await res.json();
if (data.isGuardian) {
  console.log(`${data.address} holds GUARDIAN_ROLE on this market`);
}
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "supported": true,
    "marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
    "role": "GUARDIAN_ROLE",
    "roleHash": "0x55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041",
    "guardians": [
      {
        "address": "0x7d3c2b91e04a58f6c1d9a72b3c8f40e6d15a9c27",
        "grantedAt": "2026-11-06T09:14:48.000Z",
        "grantedBy": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "txHash": "0x2d8f4b1a6c9e03758b1d4f7a2c6e9b0d3f5a8c1e4b7d0a3f6c9e2b5d8a1f4c70",
        "confirmed": true
      }
    ],
    "indexed": true,
    "address": "0x7d3c2b91e04a58f6c1d9a72b3c8f40e6d15a9c27",
    "isGuardian": true
  }
}
```

```json Error - Invalid Address theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_ADDRESS",
    "message": "Invalid address"
  }
}
```

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `NO_MARKET_ADDRESS` | `400` | The market has no on-chain address recorded |
| `INVALID_ADDRESS` | `400` | `address` is not a 0x-prefixed 40-character hex address |
| `GUARDIANS_READ_FAILED` | `500` | The list could not be read for a reason no other code covers |
| `MISSING_MARKET_ID` | `400` | `marketId` is longer than 100 characters |
| `MARKET_NOT_FOUND` | `404` | No market with this ID on your instance |
| `CHAIN_UNAVAILABLE` | `503` | The chain could not be read just now. Retry shortly |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.