A *session* represents a conversation
between a Dialogflow CX agent and an end-user.
You can create special entities, called *session entities* ,
or *user entities*,
during a session.
Session entities can extend or replace custom entity types
and only exist during the session that they were created for.
All session data, including session entities,
is stored by Dialogflow CX for 30 minutes.

For example, if your agent has a `@fruit` entity type
that includes "pear" and "grape",
that entity type could be updated to include "apple" or "orange",
depending on the information your agent collects from the end-user.
The updated entity type would have the "apple" or "orange" entity entry
for the rest of the session.

## Managing session entities with the API

To manage session entities with the API,
use the methods for the `SessionEntity` type.


<button class="devsite-dialog-button cloud-button cloud-button--primary" style="display: block; padding: 10px; margin-top: 10px; margin-bottom: 10px;" data-modal-dialog-id="cx-agent-reference-dialog-SessionEntityType">Go to the SessionEntityType API reference</button>
**Select a protocol and version for the SessionEntityType reference:**

| Protocol | V3 | V3beta1 |
|---|---|---|
| REST | [SessionEntityType resource](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.sessions.entityTypes) | [SessionEntityType resource](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3beta1/projects.locations.agents.sessions.entityTypes) |
| RPC | [SessionEntityType interface](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#google.cloud.dialogflow.cx.v3.SessionEntityTypes) | [SessionEntityType interface](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3beta1#google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes) |
| C++ | [SessionEntityTypesClient](https://googleapis.dev/cpp/google-cloud-dialogflow_cx/latest/classgoogle_1_1cloud_1_1dialogflow__cx_1_1SessionEntityTypesClient.html) | Not available |
| C# | [SessionEntityTypesClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.Cx.V3/latest/Google.Cloud.Dialogflow.Cx.V3.SessionEntityTypesClient) | Not available |
| Go | [SessionEntityTypesClient](https://docs.cloud.google.com/go/docs/reference/cloud.google.com/go/dialogflow/latest/cx/apiv3#cloud_google_com_go_dialogflow_cx_apiv3_SessionEntityTypesClient) | Not available |
| Java | [SessionEntityTypesClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow-cx/latest/com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient) | [SessionEntityTypesClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow-cx/latest/com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient) |
| Node.js | [SessionEntityTypesClient](https://googleapis.dev/nodejs/dialogflow-cx/latest/v3.SessionEntityTypesClient.html) | [SessionEntityTypesClient](https://googleapis.dev/nodejs/dialogflow-cx/latest/v3beta1.SessionEntityTypesClient.html) |
| PHP | Not available | Not available |
| Python | [SessionEntityTypesClient](https://docs.cloud.google.com/python/docs/reference/dialogflow-cx/latest/google.cloud.dialogflowcx_v3.services.session_entity_types.SessionEntityTypesClient) | [SessionEntityTypesClient](https://docs.cloud.google.com/python/docs/reference/dialogflow-cx/latest/google.cloud.dialogflowcx_v3beta1.services.session_entity_types.SessionEntityTypesClient) |
| Ruby | Not available | Not available |

<button class="devsite-dialog-close">Close</button>

<br />