Skip to content

Kind 9021: Group Join Request

Overview

This event is used by users to request admission to a relay-based group. It functions as a formal application to join a group, which may be automatically approved or require manual review by group administrators.

Specification

PropertyValue
Kind Number9021
Event RangeRegular
Defined inNIP-29

Content Format

The content field can contain an optional reason or message explaining why the user wants to join the group.

Schema

"optional reason"

Tags

Tag NameDescriptionFormatRequired
hGroup identifier["h", "<group-id>"]Yes
codeInvite code["code", "<invite-code>"]No

Client Behavior

Users can send this event to request admission to a group. The client should include the group ID in the h tag and, if available, an invite code in the code tag.

For closed groups, including a valid invite code can allow automatic approval of the request.

Relay Behavior

Relays should validate that:

  1. The event contains a valid h tag with the group ID.
  2. If the group is closed, check if: a. The request includes a valid code tag with an active invite code, in which case the user should be automatically admitted. b. If no code is provided or the code is invalid, the request should be queued for manual review by group administrators.
  3. If the group is open, the user should be automatically admitted.
  4. If the user is already a member, the relay must reject the event with a duplicate: error message prefix.

After validation, the relay should:

  1. For automatic approvals, issue a kind 9000 event adding the user to the group.
  2. For manual review cases, store the request and possibly notify group administrators.
  3. For rejections, return an appropriate error message explaining whether the rejection is final, the request is pending review, or if some other special handling is relevant.

Use Cases

  • Requesting to join a group that requires manual approval.
  • Using an invite code to join a closed group.
  • Automatically joining an open group.

Example

json
{
  "id": "...",
  "pubkey": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "created_at": 1671217411,
  "kind": 9021,
  "tags": [
    ["h", "vegans-united"],
    ["code", "LETTUCE2040"]
  ],
  "content": "I am passionate about joining this group to connect with like-minded individuals and contribute to the community's goals."
  "sig": "..."
}

References

Notes

According to NIP-29, relays must reject this request if the user has already been added to the group, with a duplicate: error message prefix.

For open groups, the join request should be automatically approved. For closed groups, approval depends on either providing a valid invite code or receiving manual approval from a group administrator.