- [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#SCHEMA_REPRESENTATION)
- [MessageAnnotation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#MessageAnnotation)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#MessageAnnotation.SCHEMA_REPRESENTATION)
- [AnnotatedMessagePart](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#AnnotatedMessagePart)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#AnnotatedMessagePart.SCHEMA_REPRESENTATION)

Represents a message posted into a conversation.

| JSON representation |
|---|
| ``` { "name": string, "content": string, "responseMessages": [ { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/ResponseMessage`) } ], "languageCode": string, "participant": string, "participantRole": enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.participants#Participant.Role`), "createTime": string, "sendTime": string, "messageAnnotation": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#MessageAnnotation`) }, "sentimentAnalysis": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Optional. The unique identifier of the message. Format: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>/messages/<Message ID>`. |
| `content` | `string` Optional. The message content. Only one of `content` and `companionQuery` should be set - not both. |
| `responseMessages[]` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/ResponseMessage`)`` Optional. Automated agent responses. |
| `languageCode` | `string` Optional. The message language. This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". |
| `participant` | `string` Output only. The participant that sends this message. |
| `participantRole` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations.participants#Participant.Role`)`` Output only. The role of the participant. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the message was created in Contact Center AI. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `sendTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. The time when the message was sent. For voice messages, this is the time when an utterance started. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `messageAnnotation` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#MessageAnnotation`)`` Output only. The annotation for the message. |
| `sentimentAnalysis` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/SentimentAnalysisResult`)`` Output only. The sentiment analysis result for the message. |

## MessageAnnotation

Represents the result of annotation for the message.

| JSON representation |
|---|
| ``` { "parts": [ { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#AnnotatedMessagePart`) } ], "containEntities": boolean } ``` |

| Fields ||
|---|---|
| `parts[]` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/Message#AnnotatedMessagePart`)`` The collection of annotated message parts ordered by their position in the message. You can recover the annotated message by concatenating \[AnnotatedMessagePart.text\]. |
| `containEntities` | `boolean` Indicates whether the text message contains entities. |

## AnnotatedMessagePart

Represents a part of a message possibly annotated with an entity. The part can be an entity or purely a part of the message between two entities or message start/end.

| JSON representation |
|---|
| ``` { "text": string, "entityType": string, "formattedValue": value } ``` |

| Fields ||
|---|---|
| `text` | `string` A part of a message possibly annotated with an entity. |
| `entityType` | `string` The [Dialogflow system entity type](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. If this is empty, Dialogflow could not annotate the phrase part with a system entity. |
| `formattedValue` | ``value (`https://protobuf.dev/reference/protobuf/google.protobuf#value` format)`` The [Dialogflow system entity formatted value](https://cloud.google.com/dialogflow/docs/reference/system-entities) of this message part. For example for a system entity of type `@sys.unit-currency`, this may contain: ``` { "amount": 5, "currency": "USD" } ``` |