# lol.dids.manage.connectSpace

> Published by [ngerakines.me](https://lexicon.garden/identity/did:plc:cbkjy5n7bk3ax2wplmtjofq2)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.connectSpace)
- [Documentation](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.connectSpace/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:cbkjy5n7bk3ax2wplmtjofq2/lol.dids.manage.connectSpace/examples)

## Definitions

### `lol.dids.manage.connectSpace`

**Type**: `procedure`

Connect a space so bard reads and publishes the authority's site and tile records from it. Authority only, and the delegation token must be the authority's own. Bard exchanges the token for a credential under its own key, registers for notifications, bootstraps the authority's repo, and records the space. Idempotent.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `space` | `string` (at-uri) | Yes | The space, at://{authority}/space/lol.dids.sites.space/{skey}. |
| `delegationToken` | `string` | Yes | A delegation token minted by the authority for this space; spent immediately and never stored. |

#### Output

**Encoding**: `application/json`

#### Errors

- **NotSpaceAuthority**: Only the space's authority may connect it.
- **GrantIssuerMismatch**: The delegation token's issuer is not the calling identity.
- **GrantExpired**: The delegation token is past its lifetime.
- **GrantRefused**: The space host refused the exchange.
- **AppNotAllowed**: The space's app access does not admit bard; the space is recorded and will sync once it does.
- **SpaceQuotaExceeded**: This identity has reached its connected-space limit.
- **SpacesDisabled**: Space support is disabled on this deployment.

## Raw Schema

```json
{
  "id": "lol.dids.manage.connectSpace",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "space",
            "delegationToken"
          ],
          "properties": {
            "space": {
              "type": "string",
              "format": "at-uri",
              "description": "The space, at://{authority}/space/lol.dids.sites.space/{skey}."
            },
            "delegationToken": {
              "type": "string",
              "description": "A delegation token minted by the authority for this space; spent immediately and never stored."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "NotSpaceAuthority",
          "description": "Only the space's authority may connect it."
        },
        {
          "name": "GrantIssuerMismatch",
          "description": "The delegation token's issuer is not the calling identity."
        },
        {
          "name": "GrantExpired",
          "description": "The delegation token is past its lifetime."
        },
        {
          "name": "GrantRefused",
          "description": "The space host refused the exchange."
        },
        {
          "name": "AppNotAllowed",
          "description": "The space's app access does not admit bard; the space is recorded and will sync once it does."
        },
        {
          "name": "SpaceQuotaExceeded",
          "description": "This identity has reached its connected-space limit."
        },
        {
          "name": "SpacesDisabled",
          "description": "Space support is disabled on this deployment."
        }
      ],
      "output": {
        "schema": {
          "ref": "lol.dids.defs#spaceView",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Connect a space so bard reads and publishes the authority's site and tile records from it. Authority only, and the delegation token must be the authority's own. Bard exchanges the token for a credential under its own key, registers for notifications, bootstraps the authority's repo, and records the space. Idempotent."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
