> For the complete documentation index, see [llms.txt](https://keykeeper.gitbook.io/keykeeper-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://keykeeper.gitbook.io/keykeeper-docs/server-admin-guide.md).

# Server Admin Guide

As a server admin, you have full control over the groups, keys, and user access. You can create groups, generate keys, assign roles, and manage access to groups with the KeyKeeper bot.

## Commands:

* **/create-group \[group\_name] \[display\_name]**: Create a new group to manage access and keys.
* **/generate-codes \[group\_id] \[amount]**: Generate a batch of keys for a specific group.
* **/claim-key \[group\_id]**: Assign a specific key to a user.
* **/revoke-keys \[group\_id]**: Revoke keys and remove access from users.
* **/remove-group \[group\_id]**: Delete a group and revoke all keys associated with it.
* **/restrict-group \[group\_id]**: Restrict a group so that only users with a valid key can join.
* **/export-codes \[group\_id] \[status]**: Export a list of keys in a specific status (unused, redeemed, or all).
* **/set-group-role \[group\_id] \[role\_id]**: Assign a role to a specific group.
* **/import-keys \[group\_id] \[file]**: Import game keys from a file to distribute among users.
* **/list-groups**: List all available groups and their current status.

### Managing Groups and Keys:

* When a group is created, a set of keys can be generated for it. These keys can be assigned to users.
* You can revoke keys to remove user access from the group. This action will also delete the user’s record from the database and remove any roles they have.
* Restricted groups only allow users with a valid key to join. Use the `/restrict-group` command to set this restriction.
* Export codes to generate a list of keys, including their status (unused, all, or redeemed).

### Role Management:

Admins can link specific roles to groups using the `/set-group-role` command. This ensures that users who join the group will automatically receive the corresponding role.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://keykeeper.gitbook.io/keykeeper-docs/server-admin-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
