# fyi.opensocial.createGroup

> 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.createGroup)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createGroup/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.createGroup/examples)

## Definitions

### `fyi.opensocial.createGroup`

**Type**: `procedure`

Host-level: create a new group on this host. Authenticated as the founder (service auth from their PDS). The founder and any listed stewards become its first admins. Mints the group DID, creates the meta and members spaces, writes the bootstrap records and, for a discoverable group, a declaration. Modality spaces are left to the apps that use them (createSpace).

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `description` | `string` | No |  |
| `displayName` | `string` | Yes |  |
| `handle` | `string` (handle) | Yes |  |
| `joinPolicy` | `string` | No |  |
| `metaReadableBy` | `array` | No | Defaults to ['public']. |
| `stewards` | `array` | No | Accounts that run the group alongside the founder, as admins from the start. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `members` | `string` (space-ref) | Yes |  |
| `meta` | `string` (space-ref) | Yes |  |

#### Errors

- **HandleTaken**

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Host-level: create a new group on this host. Authenticated as the founder (service auth from their PDS). The founder and any listed stewards become its first admins. Mints the group DID, creates the meta and members spaces, writes the bootstrap records and, for a discoverable group, a declaration. Modality spaces are left to the apps that use them (createSpace).",
      "errors": [
        {
          "name": "HandleTaken"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "description": {
              "maxGraphemes": 300,
              "maxLength": 3000,
              "type": "string"
            },
            "displayName": {
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "handle": {
              "format": "handle",
              "type": "string"
            },
            "joinPolicy": {
              "knownValues": [
                "fyi.opensocial.profile#open",
                "fyi.opensocial.profile#request",
                "fyi.opensocial.profile#invite"
              ],
              "type": "string"
            },
            "metaReadableBy": {
              "description": "Defaults to ['public'].",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "stewards": {
              "description": "Accounts that run the group alongside the founder, as admins from the start.",
              "items": {
                "format": "did",
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "handle",
            "displayName"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "did": {
              "format": "did",
              "type": "string"
            },
            "members": {
              "format": "space-ref",
              "type": "string"
            },
            "meta": {
              "format": "space-ref",
              "type": "string"
            }
          },
          "required": [
            "did",
            "meta",
            "members"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.createGroup",
  "lexicon": 1
}
```
