> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wryft.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Servers & Channels

> Organize conversations with Discord-like server structure

## Overview

Servers (guilds) are communities with multiple channels for organized conversations.

## Server Features

<CardGroup cols={2}>
  <Card title="Text Channels" icon="message">
    Organized text conversations
  </Card>

  <Card title="Voice Channels" icon="microphone">
    Real-time voice communication
  </Card>

  <Card title="Categories" icon="folder">
    Group channels together
  </Card>

  <Card title="Permissions" icon="shield">
    Role-based access control
  </Card>
</CardGroup>

## Creating a Server

```javascript theme={null}
POST /api/guilds
{
  "name": "My Server",
  "icon": "https://...",
  "is_public": false
}
```

## Channels

### Text Channels

Create organized text channels:

```javascript theme={null}
POST /api/guilds/:guild_id/channels
{
  "name": "general",
  "type": "text",
  "category_id": null
}
```

### Voice Channels

Create voice channels:

```javascript theme={null}
POST /api/guilds/:guild_id/channels
{
  "name": "Voice Chat",
  "type": "voice"
}
```

## Categories

Group channels into categories:

```javascript theme={null}
POST /api/guilds/:guild_id/categories
{
  "name": "Text Channels",
  "position": 0
}
```

## Permissions

### Channel Permissions

Set permissions per channel:

```javascript theme={null}
POST /api/guilds/:guild_id/channels/:channel_id/permissions
{
  "role_id": "...",
  "allow": ["VIEW_CHANNEL", "SEND_MESSAGES"],
  "deny": ["MANAGE_MESSAGES"]
}
```

### Available Permissions

* `VIEW_CHANNEL` - See the channel
* `SEND_MESSAGES` - Send messages
* `MANAGE_MESSAGES` - Delete others' messages
* `MANAGE_CHANNELS` - Edit channel settings
* `MANAGE_GUILD` - Edit server settings
* `KICK_MEMBERS` - Kick members
* `BAN_MEMBERS` - Ban members

## Invites

Create invite links:

```javascript theme={null}
POST /api/guilds/:guild_id/invites
{
  "max_uses": 10,
  "expires_at": "2024-12-31T23:59:59Z"
}
```

## Server Discovery

Public servers appear in discovery:

```javascript theme={null}
GET /api/guilds/public
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Roles" icon="user-shield" href="/features/servers#permissions">
    Learn about role permissions
  </Card>

  <Card title="Voice" icon="microphone" href="/features/voice">
    Set up voice channels
  </Card>
</CardGroup>
