# social.colibri.beta.channel.create

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.channel.create)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.channel.create/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.channel.create/examples)

## Definitions

### `social.colibri.beta.channel.create`

**Type**: `procedure`

Creates a channel. This creates a space for the channel, then writes the channel's configuration record at key 'self' inside that space.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes | The channel's name. |
| `type` | `string` (nsid) | Yes | The channel's space type. |
| `category` | `string` (record-key) | Yes | The category to list the channel under. |
| `community` | `string` (did) | Yes | The community the channel belongs to. |
| `ownerOnly` | `boolean` | No | Whether only community admins may post. |
| `description` | `string` | No | The channel's topic. |
| `allowedRoles` | `array` | No | Roles allowed to post here. |
| `allowedMembers` | `array` | No | Members allowed to post here in addition to allowedRoles. |
| `visibleToRoles` | `array` | No | Roles that may read this channel. Empty means every member may. |
| `visibleToMembers` | `array` | No | Members that may read this channel beyond visibleToRoles. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `channel` | `ref` → `social.colibri.beta.community.defs#channelView` | Yes | The newly created channel. |

#### Errors

- **AuthRequired**: The request has no valid service auth.
- **Forbidden**: The requesting user lacks the channel.create permission.
- **CommunityNotFound**: No community matches the given DID.
- **CategoryNotFound**: No category matches the given record key.
- **RoleHierarchy**: The requesting user cannot grant a role that outranks their own.
- **InvalidRequest**: The arguments are inconsistent or malformed beyond schema validation.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.
- **PdsUnavailable**: The community's PDS is unreachable or the AppView has no administrative access to it.
- **UpstreamFailure**: The community's PDS failed while creating the channel's space.

## Raw Schema

```json
{
  "id": "social.colibri.beta.channel.create",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "type",
            "name",
            "category"
          ],
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 32,
              "minLength": 1,
              "description": "The channel's name."
            },
            "type": {
              "type": "string",
              "format": "nsid",
              "description": "The channel's space type.",
              "knownValues": [
                "social.colibri.beta.channel.text",
                "social.colibri.beta.channel.voice"
              ]
            },
            "category": {
              "type": "string",
              "format": "record-key",
              "description": "The category to list the channel under."
            },
            "community": {
              "type": "string",
              "format": "did",
              "description": "The community the channel belongs to."
            },
            "ownerOnly": {
              "type": "boolean",
              "description": "Whether only community admins may post."
            },
            "description": {
              "type": "string",
              "maxLength": 256,
              "description": "The channel's topic."
            },
            "allowedRoles": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "record-key",
                "description": "A role permitted to post."
              },
              "description": "Roles allowed to post here."
            },
            "allowedMembers": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "did",
                "description": "A member permitted to post."
              },
              "description": "Members allowed to post here in addition to allowedRoles."
            },
            "visibleToRoles": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "record-key",
                "description": "A role."
              },
              "description": "Roles that may read this channel. Empty means every member may."
            },
            "visibleToMembers": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "did",
                "description": "A member."
              },
              "description": "Members that may read this channel beyond visibleToRoles."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthRequired",
          "description": "The request has no valid service auth."
        },
        {
          "name": "Forbidden",
          "description": "The requesting user lacks the channel.create permission."
        },
        {
          "name": "CommunityNotFound",
          "description": "No community matches the given DID."
        },
        {
          "name": "CategoryNotFound",
          "description": "No category matches the given record key."
        },
        {
          "name": "RoleHierarchy",
          "description": "The requesting user cannot grant a role that outranks their own."
        },
        {
          "name": "InvalidRequest",
          "description": "The arguments are inconsistent or malformed beyond schema validation."
        },
        {
          "name": "CredentialsUnavailable",
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable."
        },
        {
          "name": "PdsUnavailable",
          "description": "The community's PDS is unreachable or the AppView has no administrative access to it."
        },
        {
          "name": "UpstreamFailure",
          "description": "The community's PDS failed while creating the channel's space."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "channel"
          ],
          "properties": {
            "channel": {
              "ref": "social.colibri.beta.community.defs#channelView",
              "type": "ref",
              "description": "The newly created channel."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Creates a channel. This creates a space for the channel, then writes the channel's configuration record at key 'self' inside that space."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
