# Differences between Role and Contact

## Overview

MaiAgent provides two permission setting methods: **Contact-based** and **Role-based**, supporting enterprises to precisely control knowledge base access permissions in different scenarios.

### Contact

A storage system in MaiAgent that synchronizes user information and creates Contact IDs to identify user conversation information.

{% hint style="info" %}
To learn more about contact information, please refer to [🌐Contact Introduction and Integration↗](/tech/maiagent-tech-en/authorization-integration/contacts.md)
{% endhint %}

<figure><img src="/files/1izUbakk7BW3Oo7Rv1x2" alt=""><figcaption><p>Without Contact name setting: Users default to anonymous</p></figcaption></figure>

### Role

Roles with permissions to edit AI assistant backend settings can be pre-defined within the enterprise, such as customer service representatives, administrative staff, interns, etc. Organizations can pre-establish permissions and reference databases for roles, allowing organization members to directly apply settings based on their needs by selecting roles.

<figure><img src="/files/5PQaOjCMK0dBsi8oGg8y" alt=""><figcaption><p>Role user basic information display</p></figcaption></figure>

## I. Permission Method Comparison

<figure><img src="/files/qLeVTbZmnBct1Pslzdmb" alt=""><figcaption><p>AI Assistant embedding screen</p></figcaption></figure>

|       Comparison Items       |               Contact-based              |                                 Role-based                                 |
| :--------------------------: | :--------------------------------------: | :------------------------------------------------------------------------: |
|  🎯 **Applicable Scenarios** |    External users, System integration    |                   Internal users, Organization management                  |
| 👤 **MaiAgent Registration** |        ❌ No registration required        |              ✅ Registration and organization joining required              |
|    📋 **Creation Method**    |    System automatic or manual creation   |                         Pre-defined role templates                         |
|    🔄 **Update Mechanism**   | Dynamic user information synchronization |                       Static role permission settings                      |
|        🎯 **Purpose**        |  Identify user conversation information  | Apply default permission settings, manage AI assistant backend permissions |
|      👥 **Target Users**     |        External visitors, Members        |                  Internal employees, Organization members                  |
|   ⚙️ **Management Method**   |      Managed through API integration     |                   Managed through backend role management                  |
|   📊 **Permission Control**  |    Dynamic control based on Contact ID   |                        Static control based on Role                        |

### Typical Application Scenarios

**Contact-based Scenarios: Suitable for scenarios requiring clear role division and permission definition**

* **Corporate Website**: Visitors receive different product information based on identity
* **Member Center**: Access corresponding service content based on membership level
* **Customer Service Center**: Provide differentiated support based on customer type

**Role-based Scenarios**

* **Internal Operations**: Employees handle work based on department roles
* **Customer Service Team**: Access knowledge base according to responsibilities
* **Management Level**: Content review and maintenance based on permissions

### Comprehensive Usage Strategy

External operations (where user identity clarity is not required) are suitable for Contact-based management

Internal operations (requiring clear permission division / multiple members using same permissions) are suitable for Role-based management

<figure><img src="/files/ki1hugLeAWkw9eZ6GzcX" alt=""><figcaption><p>Contact and Role authorization usage recommendations</p></figcaption></figure>


---

# Agent Instructions: 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://docs.maiagent.ai/tech/maiagent-tech-en/authorization-integration/role-vs-contact.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.
