# town.muni.arbiter.listSpaces

> Published by [zicklag.dev](https://lexicon.garden/identity/did:plc:ulg2bzgrgs7ddjjlmhtegk3v)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ulg2bzgrgs7ddjjlmhtegk3v/town.muni.arbiter.listSpaces)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ulg2bzgrgs7ddjjlmhtegk3v/town.muni.arbiter.listSpaces/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ulg2bzgrgs7ddjjlmhtegk3v/town.muni.arbiter.listSpaces/examples)

## Definitions

### `town.muni.arbiter.listSpaces`

**Type**: `query`

Get the members that have been assigned to the space.

This is not a flat membership list, but a list of the direct members
of the space, including DIDs, local spaces, and remote spaces that have
been added as members, without doing any resolution of remote spaces.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `arbiterDid` | `string` (did) | Yes | The DID of the arbiter that the space is in. |
| `resolverDepth` | `integer` | No | The maximum depth to allow when doing remote resolutions.  Because spaces are allowed to have members resolved from remote spaces, all of the arbiter endpoints have an optional resolution depth parameter that can be used to limit how many chained remote calls can be resolved.  This applies both to queries and procedures. Queries may need to resolve external members to complete the member list, and procedures may need to resolve external members if the requesting member is not in the local member list, to see if the member has access through a remote list. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `spaces` | `array` | Yes | The list of spaces on the arbiter that the requesting user has access to. |

#### Errors

- **ErrArbiterNotExists**: The specified arbiter does not exist on this server.
- **ErrSpaceNotExists**: The specified space does not exist on this arbiter.
- **ErrPermissionDenied**: The requesting user is not allowed to make the request.

## Raw Schema

```json
{
  "id": "town.muni.arbiter.listSpaces",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "ErrArbiterNotExists",
          "description": "The specified arbiter does not exist on this server."
        },
        {
          "name": "ErrSpaceNotExists",
          "description": "The specified space does not exist on this arbiter."
        },
        {
          "name": "ErrPermissionDenied",
          "description": "The requesting user is not allowed to make the request."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "spaces"
          ],
          "properties": {
            "spaces": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "spaceKey",
                  "spaceType"
                ],
                "properties": {
                  "config": {
                    "refs": [],
                    "type": "union",
                    "description": "The space config.\n\nThis may not be returned if the server does not want to allow the requesting user\nto read it."
                  },
                  "spaceKey": {
                    "type": "string",
                    "maxLength": 1024,
                    "description": "The space's key."
                  },
                  "spaceType": {
                    "type": "string",
                    "format": "nsid",
                    "description": "The type of the space."
                  }
                }
              },
              "description": "The list of spaces on the arbiter that the requesting user has access to."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "arbiterDid"
        ],
        "properties": {
          "arbiterDid": {
            "type": "string",
            "format": "did",
            "description": "The DID of the arbiter that the space is in."
          },
          "resolverDepth": {
            "type": "integer",
            "description": "The maximum depth to allow when doing remote resolutions.\n\nBecause spaces are allowed to have members resolved from remote spaces,\nall of the arbiter endpoints have an optional resolution depth parameter\nthat can be used to limit how many chained remote calls can be resolved.\n\nThis applies both to queries and procedures. Queries may need to resolve\nexternal members to complete the member list, and procedures may need\nto resolve external members if the requesting member is not in the local\nmember list, to see if the member has access through a remote list."
          }
        }
      },
      "description": "Get the members that have been assigned to the space.\n\nThis is not a flat membership list, but a list of the direct members\nof the space, including DIDs, local spaces, and remote spaces that have\nbeen added as members, without doing any resolution of remote spaces."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
