# dev.cocore.account.listAccounts

> Published by [cocore.dev](https://lexicon.garden/identity/did:plc:5quuhkmwe2q4k3azfsgg7kdz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.account.listAccounts)
- [Documentation](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.account.listAccounts/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:5quuhkmwe2q4k3azfsgg7kdz/dev.cocore.account.listAccounts/examples)

## Definitions

### `dev.cocore.account.listAccounts`

**Type**: `query`

Discovery directory of every signed-up DID (any DID with a record under `dev.cocore.*`), joined with profile + provider counts so a card grid can render without further fan-out. DIDs without a local profile record are hydrated from the public Bluesky AppView.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `q` | `string` | No | Case-insensitive substring on profile handle and/or DID. A leading @ is ignored. |
| `limit` | `integer` | No |  |
| `offset` | `integer` | No |  |
| `sortBy` | `string` | No | `recent` = last activity descending; `newest` = signup order. |
| `viewerDid` | `string` (did) | No | Excludes the caller's own DID from results. |
| `providersOnly` | `boolean` | No |  |
| `excludeViewerFriends` | `boolean` | No | With `viewerDid`, also omits DIDs the viewer has already published a friend record for. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `q` | `string` | No |  |
| `limit` | `integer` | Yes |  |
| `total` | `integer` | Yes |  |
| `offset` | `integer` | Yes |  |
| `sortBy` | `string` | Yes |  |
| `accounts` | `array` | Yes |  |
| `providersOnly` | `boolean` | Yes |  |
| `excludeViewerFriends` | `boolean` | Yes |  |

## Raw Schema

```json
{
  "id": "dev.cocore.account.listAccounts",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "accounts",
            "total",
            "limit",
            "offset",
            "sortBy",
            "providersOnly",
            "excludeViewerFriends"
          ],
          "properties": {
            "q": {
              "type": "string"
            },
            "limit": {
              "type": "integer"
            },
            "total": {
              "type": "integer"
            },
            "offset": {
              "type": "integer"
            },
            "sortBy": {
              "enum": [
                "recent",
                "newest"
              ],
              "type": "string"
            },
            "accounts": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "did"
                ],
                "properties": {
                  "did": {
                    "type": "string",
                    "format": "did"
                  },
                  "handle": {
                    "type": "string"
                  },
                  "avatarUrl": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "providerCount": {
                    "type": "integer"
                  },
                  "lastActivityAt": {
                    "type": "string",
                    "format": "datetime"
                  }
                }
              }
            },
            "providersOnly": {
              "type": "boolean"
            },
            "excludeViewerFriends": {
              "type": "boolean"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "q": {
            "type": "string",
            "description": "Case-insensitive substring on profile handle and/or DID. A leading @ is ignored."
          },
          "limit": {
            "type": "integer",
            "default": 24,
            "maximum": 100,
            "minimum": 1
          },
          "offset": {
            "type": "integer",
            "default": 0,
            "minimum": 0
          },
          "sortBy": {
            "enum": [
              "recent",
              "newest"
            ],
            "type": "string",
            "default": "recent",
            "description": "`recent` = last activity descending; `newest` = signup order."
          },
          "viewerDid": {
            "type": "string",
            "format": "did",
            "description": "Excludes the caller's own DID from results."
          },
          "providersOnly": {
            "type": "boolean",
            "default": false
          },
          "excludeViewerFriends": {
            "type": "boolean",
            "default": false,
            "description": "With `viewerDid`, also omits DIDs the viewer has already published a friend record for."
          }
        }
      },
      "description": "Discovery directory of every signed-up DID (any DID with a record under `dev.cocore.*`), joined with profile + provider counts so a card grid can render without further fan-out. DIDs without a local profile record are hydrated from the public Bluesky AppView."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
