> For the complete documentation index, see [llms.txt](https://docs.sonoransoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonoransoftware.com/bot/tutorials/sonoran-cms-integration/role-mapping.md).

# Role Mapping

## Mapping Discord Roles and CMS Ranks

In the **Administration** panel, navigate to **Integrations** > **Discord** > **Role Mapping**

Configure your CMS x Discord [One-to-One](#one-to-one-mapping) and [Category](#category-mapping) mappings below.

## One-to-One Mapping

<figure><img src="/files/IzEaDSFz2fnxbX3iSetl" alt="" width="375"><figcaption><p>CMS x Discord: One-to-One Mapping</p></figcaption></figure>

<details>

<summary>One-to-One Mapping Explained</summary>

One-to-one mapping allows you to map a CMS rank to one or more Discord roles. Adding or removing a one-to-one mapped rank in the CMS will add or remove the Discord role and vice versa.

**This mapping type is the most common.**

* CMS: `Admin` rank
* Discord: `Admin` role in one or more Discord guilds

<figure><img src="/files/oHyFiCkQBrSFYRRijeoa" alt=""><figcaption></figcaption></figure>

</details>

## Category Mapping

<figure><img src="/files/w0qwOG1ROllEBhgwJJsy" alt="" width="375"><figcaption><p>CMS x Discord: Category Mapping</p></figcaption></figure>

<details>

<summary>Category Mapping Explained</summary>

Category mapping allows you to map multiple CMS ranks to a single Discord role. If a user has any of the CMS ranks they will receive the Discord role. If a user has none of the CMS ranks the Discord role will be removed.

This mapping type is best used for role categories.

* CMS: Multiple staff ranks `Moderator`, `Admin` and `Director`
* Discord: A general `Staff` role

<figure><img src="/files/qZnjf9HXwXTMrGz468vF" alt=""><figcaption></figcaption></figure>

</details>

## Syncing the Role Map

{% hint style="info" %}
After modifying the mapping, your community will automatically be re-synced.\
This may take a couple of minutes to complete.
{% endhint %}

While changes are automatic, you can also manually re-sync users with the `/sync` command. Administrators can also run `/sync community: yes` to re-sync the entire community in all linked Discord guilds.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.sonoransoftware.com/bot/tutorials/sonoran-cms-integration/role-mapping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
