> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 2: Create Data App and Embed ID

> Configure a data app with AI Chat Mode by enabling access control, setting up semantic layer integration, and generating embed credentials for chat-enabled analytics.

* Navigate to the "Data" section in your app.
* Look for the "Data Apps" option and select it.
* Click on **"New Data App"** button. Provide the required information including naming it and configuring basic settings.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=79e2a1896ad8593c793333e5501b43dc" width="768" height="358" data-path="images/developer-docs/image-step2.png" />
</Frame>

Access Control is crucial for managing what users can do within your Data App. Navigate to the "Access Control" tab within your created Data App.

* Look for options related to "Metric Creation" and "Chat Mode".
* Enable the setting that allows users to create metrics and select chat mode.
* Select the Data Mart and provide the client column for each table.
* Click on "Save" to save the settings.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2ii.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=a99fc0233f18dfccc6ffeeff3ef0a58c" width="768" height="316" data-path="images/developer-docs/image-step2ii.png" />
</Frame>

Once access control settings are configured, click on **"Embed Info"** tab in the sidebar.

Refer to <Link href="https://docs.usedatabrain.com/developer-docs/helpers/dashboard-id">"Dashboard ID"</Link> for generating embed ID and refer <Link href="https://docs.usedatabrain.com/developer-docs/helpers/api-token">"API TOKEN"</Link> for generating API token that will be used to generate **"guest token"** later.

Once API Token is generated, create "guest token" with **"client ID"**.

* Guest tokens are used for allowing temporary, limited access to your Data App.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2iii.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=60c4b3782eef7ad2f1c017f60aad4038" width="768" height="273" data-path="images/developer-docs/image-step2iii.png" />
</Frame>

* Go to postman or any other API platform.
* Set the URL as [Guest Token API Endpoint](https://api.usedatabrain.com/api/v2/guest-token/create).
* In the Authorization tab, select type as **"Bearer Token"** and in token field add the "API token" that you created in your data app.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2iv.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=3b9c68cda61b113b237557a09c09374e" width="768" height="307" data-path="images/developer-docs/image-step2iv.png" />
</Frame>

* You'll need to specify a **Client ID** , which is a unique identifier for the client or user you're creating the token for and the **data app name** that you created above in the body.
* Click on **"Send"** . The generated guest token will be associated with the provided Client ID and data app.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2v.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=688c205491fd231ee852fc885cd818b9" width="768" height="183" data-path="images/developer-docs/image-step2v.png" />
</Frame>

Use the guest token and the embed ID to test your embed.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2vi.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=b1beebf0924c30ae9120ac6fca3d1fed" width="768" height="384" data-path="images/developer-docs/image-step2vi.png" />
</Frame>

Click on **"Chat Data"** button and start analyzing your data.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2vii.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=9965c21a28b10be3806d1449e53c78cb" width="768" height="362" data-path="images/developer-docs/image-step2vii.png" />
</Frame>

To verify your response, got to **"Data"** tab in your app, select **"Semantic Layer"** in the side bar, and click on the **"Lab"** button next to the datamart that you chose to create your data app.

Inside the semantic layer for you datamart, click on **"Logs"** tab. There you will see your response.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2viii.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=2878697ca6e2b86fe8dcb12438e1cffd" width="768" height="679" data-path="images/developer-docs/image-step2viii.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/rztAaW4K131jq2rk/images/developer-docs/image-step2ix.png?fit=max&auto=format&n=rztAaW4K131jq2rk&q=85&s=2bfc6ec331013616dadb9f4fd60ca90c" width="768" height="434" data-path="images/developer-docs/image-step2ix.png" />
</Frame>
