---
title: "Use dynamic guest data in the API response for an interactive experience"
slug: "use-dynamic-guest-data-in-the-api-response-for-an-interactive-experience"
abstract: "Describes how to include dynamic guest data in the API response for an interactive experience (Sitecore Personalize)."
---
# Use dynamic guest data in the API response for an interactive experience

You can copy attributes or paths from the guest data model and use them in the API response.

To include dynamic guest data in the API response:

1. In the API editor, from the **API** tab, click the **Data** tab.
2. To insert dynamic data into the API response, enter a guest's email address or other identifier to search in the **Data Selector** search box. This enables you to access data model attributes and paths.

    > [!tip]
    > If there is a guest whose data you often use when configuring or testing code, just click the **star** icon to bookmark the guest so you no longer have to search for them.

3. Under **Guest data model**, click ![Copy icon](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/copy_data.png) next to the attribute or path and click **Copy Path as Freemarker**.

    ![Copying attributes from the guest data model](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/pers_exprespns.png)

4. Paste into the **API** tab.

    > [!tip]
    > There are some situations when you might want to insert a custom field in your API response, using FreeMarker. For example, you might want to retrieve the logged in state of the site visitor. To do this, create a custom field[create a custom field](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-experiences/introduction-to-interactive-experiences/compose-the-api-response-for-an-interactive-experience/using-custom-fields-in-an-interactive-experiment.html "Using custom fields in an interactive experiment") called `loggedInState`. Then use the following path in FreeMarker when configuring the API response: `"customField": "${request.params.customField}"`

5. Click **Save**.
6. Click ![back.png](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/back.png) to close the API editor.