> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Structure And Hierarchy

> Understand the various message categories, types, and statuses in CometChat — including message, custom, action, call, and interactive messages.

<Info>
  **Quick Reference** - Message categories and their common types:

  ```javascript theme={null}
  // Check message category and type
  const category = message.getCategory(); // "message" | "custom" | "action" | "call" | "interactive"
  const type = message.getType();         // "text" | "image" | "video" | "audio" | "file" | custom type
  ```
</Info>

The diagram below helps you understand the various message categories and types that a CometChat message can belong to.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-v6-beta2-flutter-uikit/4ucxtIPTMjv_Z4iZ/images/826e0908-chatsdk-12bedefdc00fab14fcf19611607bd064.jpg?fit=max&auto=format&n=4ucxtIPTMjv_Z4iZ&q=85&s=66029ad1ea9dbff87dc46497ae05be63" width="3552" height="2456" data-path="images/826e0908-chatsdk-12bedefdc00fab14fcf19611607bd064.jpg" />
</Frame>

As you can see in the above diagram, every message belongs to a particular category. A message can belong to one of the 5 categories:

1. Message
2. Custom
3. Action
4. Call
5. Interactive

Each category can be further classified into types.

## Message

A message belonging to the category `message` can be classified into one of the following types:

| Type  | Description          |
| ----- | -------------------- |
| text  | A plain text message |
| image | An image message     |
| video | A video message      |
| audio | An audio message     |
| file  | A file message       |

## Custom

In the case of messages that belong to the `custom` category, there are no predefined types. Custom messages can be used by developers to send messages that do not fit in the default category and types provided by CometChat. For messages with the category `custom`, the developers can set their own type to uniquely identify the custom message.

A good example of a custom message would be sharing location coordinates. In this case, the developer can decide to use the custom message with type set to `location`.

## Interactive

An InteractiveMessage is a specialized object that encapsulates an interactive unit within a chat message, such as an embedded form that users can fill out directly within the chat interface. This enhances user engagement by making the chat experience more interactive and responsive to user input.

| Type              | Description                     |
| ----------------- | ------------------------------- |
| form              | For interactive form messages   |
| card              | For interactive card messages   |
| customInteractive | For custom interaction messages |

<Note>
  To learn more about Interactive messages, please refer to the [Interactive Messages](/sdk/react-native/interactive-messages) guide.
</Note>

## Action

Action messages are system-generated messages. Messages belonging to the `action` category can further be classified into one of the below types:

| Type        | Description                        |
| ----------- | ---------------------------------- |
| groupMember | Action performed on a group member |
| message     | Action performed on a message      |

Action messages hold another property called `action` which determines the action that has been performed.

### groupMember Actions

| Action       | Description                                    |
| ------------ | ---------------------------------------------- |
| joined       | When a group member joins a group              |
| left         | When a group member leaves a group             |
| kicked       | When a group member is kicked from the group   |
| banned       | When a group member is banned from the group   |
| unbanned     | When a group member is unbanned from the group |
| added        | When a user is added to the group              |
| scopeChanged | When the scope of a group member is changed    |

### message Actions

| Action  | Description               |
| ------- | ------------------------- |
| edited  | When a message is edited  |
| deleted | When a message is deleted |

## Call

Messages with the category `call` are calling-related messages. These can belong to either one of the 2 types:

| Type  | Description |
| ----- | ----------- |
| audio | Audio call  |
| video | Video call  |

The call messages have a property called `status` that helps you determine the status of the call:

| Status     | Description                                                        |
| ---------- | ------------------------------------------------------------------ |
| initiated  | When a call is initiated to a user/group                           |
| ongoing    | When the receiver of the call has accepted the call                |
| canceled   | When the call has been canceled by the initiator of the call       |
| rejected   | When the call has been rejected by the receiver of the call        |
| unanswered | When the call was not answered by the receiver                     |
| busy       | When the receiver of the call was busy on another call             |
| ended      | When the call was successfully completed and ended by either party |

## Next Steps

<CardGroup cols={2}>
  <Card title="Send Messages" icon="paper-plane" href="/sdk/react-native/messaging">
    Start sending text, media, and custom messages
  </Card>

  <Card title="Interactive Messages" icon="hand-pointer" href="/sdk/react-native/interactive-messages">
    Build forms, cards, and custom interactive messages
  </Card>

  <Card title="Receive Messages" icon="inbox" href="/sdk/react-native/receive-messages">
    Listen for and handle incoming messages in real-time
  </Card>

  <Card title="Key Concepts" icon="book" href="/sdk/react-native/key-concepts">
    Review the fundamental building blocks of CometChat
  </Card>
</CardGroup>
