# Message structure

Messages are sent as a JSON string.  The fields in the JSON object vary depending on the type of message, but they always include:

* [messageGroupId](/message-structure/entity-messages/message-group.md)
* [action](/message-structure/entity-messages/action.md)
* audit information (createdBy, createdDate, lastUpdatedBy, lastUpdatedDate, etc.)

### Entity Messages

Entity messages, no matter the char type or action, will contain an entity field with details of the entity that the action was performed on. For instance:

```
"entity": {
    "entityId": 3830,
    "charTypeId": 1,
    "template": {
        "templateId": 1,
        "templateName": "Feature"
    },
    "status": {
        "statusId": 1,
        "statusName": "Development"
    }
}
```

#### Component Entity Messages

Component entity messages are entity messages that are performed specifically on component records. The component char types can be identified in [this table](/message-structure/entity-messages/message-group.md). A component char type is a record that cannot exist on it's own. It must exist as a child of another record. Therefore, there is an additional field on component entity messages called `rootEntity`.  The root entity is the parent of the component record, and contains the parents char type ID and record ID:

```
"rootEntity": {
    "entityId": 3830,
    "charTypeId": 1
}
```

### Relationship Messages

Relationship messages will have fields for both the `parentEntity` and `childEntity` such as:

```
"parentEntity": {
    "entityId": 3830,
    "charTypeId": 1,
    "template": {
        "templateId": 1,
        "templateName": "Feature"
    },
    "status": {
        "statusId": 1,
        "statusName": "Development"
    }
},
"childEntity": {
    "entityId": 2978,
    "charTypeId": 3,
    "template": {
        "templateId": 1,
        "templateName": "Rights In"
    },
    "status": {
        "statusId": 1,
        "statusName": "Active"
    }
}
```

Examples of each of the messages can be found [here](/message-structure/entity-messages/examples.md).


---

# 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://queue-docs.rightsline.com/message-structure.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.
