# REST Resource: projects.locations.conversations

- [Resource: Conversation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations#Conversation)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations#Conversation.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations#METHODS_SUMMARY)

## Resource: Conversation

Represents a conversation. A conversation is an interaction between an agent, including live agents and Dialogflow agents, and a support customer. Conversations can include phone calls and text-based chat sessions.

| JSON representation |
|---|
| ``` { "name": string, "lifecycleState": enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.LifecycleState`), "conversationProfile": string, "phoneNumber": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationPhoneNumber`) }, "startTime": string, "endTime": string, "conversationStage": enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage`), "telephonyConnectionInfo": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.TelephonyConnectionInfo`) }, "initialConversationProfile": { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversationProfiles#ConversationProfile`) }, "ingestedContextReferences": { string: { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ContextReference`) }, ... }, "initialGeneratorContexts": { string: { object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.GeneratorContext`) }, ... } } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. The unique identifier of this conversation. Format: `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>`. |
| `lifecycleState` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.LifecycleState`)`` Output only. The current state of the Conversation. |
| `conversationProfile` | `string` Required. The Conversation Profile to be used to configure this Conversation. This field cannot be updated. Format: `projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>`. |
| `phoneNumber` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationPhoneNumber`)`` Output only. It will not be empty if the conversation is to be connected over telephony. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time the conversation was 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"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time the conversation was finished. 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"`. |
| `conversationStage` | ``enum (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage`)`` Optional. The stage of a conversation. It indicates whether the virtual agent or a human agent is handling the conversation. If the conversation is created with the conversation profile that has Dialogflow config set, defaults to `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage.ENUM_VALUES.VIRTUAL_AGENT_STAGE`; Otherwise, defaults to `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage.ENUM_VALUES.HUMAN_ASSIST_STAGE`. If the conversation is created with the conversation profile that has Dialogflow config set but explicitly sets conversationStage to `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage.ENUM_VALUES.HUMAN_ASSIST_STAGE`, it skips `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage.ENUM_VALUES.VIRTUAL_AGENT_STAGE` stage and directly goes to `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ConversationStage.ENUM_VALUES.HUMAN_ASSIST_STAGE`. |
| `telephonyConnectionInfo` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.TelephonyConnectionInfo`)`` Output only. The telephony connection information. |
| `initialConversationProfile` | ``object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversationProfiles#ConversationProfile`)`` Optional. Output only. The initial conversation profile to be used to configure this conversation, which is a copy of the conversation profile config read at conversation creation time. |
| `ingestedContextReferences` | ``map (key: string, value: object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.ContextReference`))`` Output only. The context reference updates provided by external systems. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `initialGeneratorContexts` | ``map (key: string, value: object (`https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.conversations#Conversation.GeneratorContext`))`` Output only. A map with generator name as key and generator context as value. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations/complete` | Completes the specified conversation. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations/create` | Creates a new conversation. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations/get` | Retrieves the specific conversation. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations/ingestContextReferences` | Data ingestion API. |
| ### `https://docs.cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.locations.conversations/list` | Returns the list of all conversations in the specified project. |