# fyi.opensocial.createSpace

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createSpace)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createSpace/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createSpace/examples)

## Definitions

### `fyi.opensocial.createSpace`

**Type**: `procedure`

Add a modality space to the group. Requires space.create.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `credentialScopes` | `array` | No | Which collections each role may write as the group DID in this space. Copied into the space's access record. |
| `group` | `string` (did) | Yes | The group DID. Every method is served by the group's host and authorized against that group's roles. |
| `name` | `string` | No |  |
| `readableBy` | `array` | Yes |  |
| `skey` | `string` (record-key) | No |  |
| `type` | `string` (nsid) | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (space-ref) | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Add a modality space to the group. Requires space.create.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "credentialScopes": {
              "description": "Which collections each role may write as the group DID in this space. Copied into the space's access record.",
              "items": {
                "ref": "fyi.opensocial.access#roleScopes",
                "type": "ref"
              },
              "type": "array"
            },
            "group": {
              "description": "The group DID. Every method is served by the group's host and authorized against that group's roles.",
              "format": "did",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "readableBy": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "skey": {
              "format": "record-key",
              "type": "string"
            },
            "type": {
              "format": "nsid",
              "type": "string"
            }
          },
          "required": [
            "group",
            "type",
            "readableBy"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "uri": {
              "format": "space-ref",
              "type": "string"
            }
          },
          "required": [
            "uri"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.createSpace",
  "lexicon": 1
}
```
