# Invites

Invites allow you to add users to a channel with a pending state. The invited user receives a notification and can accept or reject the invite.

Unread counts are not incremented for channels with a pending invite.

## Invite Users

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.update_channel("messaging", "general", Models::UpdateChannelRequest.new(
  invites: [Models::ChannelMemberRequest.new(user_id: 'thierry')]
))
```

## Accept an Invite

Call `acceptInvite` to accept a pending invite. You can optionally include a `message` parameter to post a system message when the user joins (e.g., "Nick joined this channel!").

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.update_channel("messaging", "general", Models::UpdateChannelRequest.new(
  accept_invite: true,
  user_id: 'thierry'
))
```

## Reject an Invite

Call `rejectInvite` to decline a pending invite. Client-side calls use the currently connected user. Server-side calls require a `user_id` parameter.

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.update_channel("messaging", "general", Models::UpdateChannelRequest.new(
  reject_invite: true,
  user_id: 'thierry'
))
```

## Query Invites by Status

Use `queryChannels` with the `invite` filter to retrieve channels based on invite status. Valid values are `pending`, `accepted`, and `rejected`.

### Query Accepted Invites

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.query_channels(Models::QueryChannelsRequest.new(
  filter_conditions: { 'invite' => 'accepted' }
))
```

### Query Rejected Invites

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.query_channels(Models::QueryChannelsRequest.new(
  filter_conditions: { 'invite' => 'rejected' }
))
```

### Query Pending Invites

```ruby label="Ruby"
require 'getstream_ruby'

Models = GetStream::Generated::Models

client.chat.query_channels(Models::QueryChannelsRequest.new(
  filter_conditions: { 'invite' => 'pending' }
))
```


---

This page was last updated at 2026-08-11T17:19:23.970Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/ruby/channel-invites/](https://getstream.io/chat/docs/ruby/channel-invites/).