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

# Embedding TextQL

> Embed Ana into your application using API Keys

## Overview

TextQL can be embedded directly into your own applications, allowing your users to interact with Ana without leaving your platform. This is done using API Keys for authentication.

## Creating an API Key

### Step 1: Navigate to API Keys

From the left sidebar, click on **Settings**. In the Configuration tab, locate the **API** section and click **API Keys**.

<Frame caption="Click API Keys under the API section in Settings">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/APIKEY.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=3ea0767fa61e5426ef30c354dd451794" alt="API section in Settings with API Keys button highlighted" data-path="images/admin/embed/APIKEY.png" />
</Frame>

### Step 2: Create a New API Key

Click **Create New API Key** and give your API key a name. This API key will have the same permissions as the user creating it.

<Frame caption="Create a new API key with a descriptive name">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/makekey.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=529ed856843611467eff67d0cfd56d1b" alt="API Keys Management modal showing key creation" data-path="images/admin/embed/makekey.png" />
</Frame>

<Warning>
  Copy your API key immediately after creation. For security reasons, you won't be able to see the full key again.
</Warning>

## Testing Your Embed

Once you have your API key, you can test the embed functionality:

1. Construct the embed URL by appending your API key to the base URL:
   ```
   https://app.textql.com/embed?authKey=YOUR_API_KEY
   ```

2. Replace `YOUR_API_KEY` with the API key you just created.

3. Open this URL in a new browser tab or incognito window.

4. If successful, you should see a new chat with Ana. This confirms your API key is working correctly.

## Embedding in Your Application

After testing, you can embed TextQL in your application using an iframe:

```html theme={null}
<iframe
  src="https://app.textql.com/embed?authKey=YOUR_API_KEY"
  width="100%"
  height="600px"
  frameBorder="0"
  allow="clipboard-write"
></iframe>
```

The authenticated user will have the same data access and permissions as the user who created the API key.

## What Ana Produces in an Embed

Embedded chats answer inline. Prose, markdown tables, and charts all render inside the iframe.

Dashboards and Data Apps are not available in an embed. They run in a sandbox that the embedded page cannot authenticate, so the artifact fails to load with an authorization error inside the iframe even though it opens correctly in the full application. Ana's dashboard and data app tools are disabled in embedded chats, and it answers with an inline chart or table instead. Build dashboards and data apps from the full application.

Add `fileGenerationDisabled=true` to the embed URL to also suppress charts and other file artifacts, for example when the embed window is small or your network blocks the file preview domain. Ana then answers with text and tables only.

## Embedding in Tableau

You can embed TextQL directly into Tableau dashboards using the Web Page object.

### Step 1: Create a New Workbook

In Tableau, click **New** and select **Workbook** to create a new workbook.

<Frame caption="Create a new workbook in Tableau">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/makeworkbook.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=247ac87415d55f60df62e3c213ead076" alt="Tableau home with New Workbook option highlighted" data-path="images/admin/embed/makeworkbook.png" />
</Frame>

### Step 2: Create a Dashboard

Click **New Dashboard** at the bottom of the screen to add a dashboard to your workbook.

<Frame caption="Create a new dashboard">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/dashboardsheet.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=d2f3aa22c3aba24ba521fac882018841" alt="Tableau workbook showing New Dashboard button" data-path="images/admin/embed/dashboardsheet.png" />
</Frame>

### Step 3: Add a Web Page Object

From the **Objects** panel on the left, drag the **Web Page** object onto your dashboard.

<Frame caption="Select Web Page from the Objects panel">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/selectwebpage.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=5b834c8631dd92ea6aef453875cac8bd" alt="Objects panel with Web Page option highlighted" data-path="images/admin/embed/selectwebpage.png" />
</Frame>

### Step 4: Enter the Embed URL

In the **Edit URL** dialog, paste your embed URL with your API key:

```
https://app.textql.com/embed?authKey=YOUR_API_KEY
```

<Frame caption="Paste your embed URL with the API key">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/addurl.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=296726777b07370abff8b7c70c64ca1c" alt="Edit URL dialog in Tableau" data-path="images/admin/embed/addurl.png" />
</Frame>

Click **OK** to embed TextQL into your dashboard.

### Step 5: Chat with Ana in Tableau

Once embedded, you can interact with Ana directly within your Tableau dashboard. Ask questions, analyze data, and get insights without leaving Tableau.

<Frame caption="TextQL embedded in Tableau dashboard">
  <img height="200" src="https://mintcdn.com/textql/-kuNLzBXuxrO-dZ8/images/admin/embed/embeddemo.png?fit=max&auto=format&n=-kuNLzBXuxrO-dZ8&q=85&s=d79f7cdbed54cf7c5865f1afe7f80a92" alt="Ana chat interface embedded in Tableau dashboard" data-path="images/admin/embed/embeddemo.png" />
</Frame>

## One-Click Tableau Collection Chats

TextQL supports direct links to start chats with specific Tableau collections already attached. This is perfect for embedding in Tableau dashboards or sharing with team members.

### Generating Embed Links (Admin Only)

Admins can generate secure embed links directly from the Tableau Collections modal:

1. Open any chat and click **Attach Tableau**
2. Hover over a collection card
3. Click the **link icon** in the top-left corner
4. The embed URL is automatically copied to your clipboard

The generated link uses your organization's dedicated **Embed User** credentials, which have minimal permissions (read-only access to Tableau collections). This keeps your personal API keys secure.

### URL Format

```
https://app.textql.com/tableau?authKey=EMBED_USER_KEY&tableauDatasetId=COLLECTION_ID&message=OPTIONAL_MESSAGE
```

### Parameters

* `authKey` (required): Your organization's Embed User API key (auto-generated)
* `tableauDatasetId` (required): The ID of the Tableau collection to attach
* `message` (optional): An initial message to auto-send when the chat opens
* `fileGenerationDisabled` (optional): Set to `true` to prevent the agent from generating file artifacts (charts, CSVs, PDFs) — it answers with text and tables instead. Useful when the embed window is small or your network blocks the file preview domain

### Example

```
https://app.textql.com/tableau?authKey=NWM3Mjc2ZDU...&tableauDatasetId=019a7096-5059-7768-81a8-36a12e7640d5&message=Summarize%20key%20insights
```

This will:

1. Authenticate using the Embed User key
2. Open a new chat
3. Automatically attach the specified Tableau collection
4. Optionally send an initial message

### Embedding in Tableau Dashboards

You can embed these direct links in Tableau using the Web Page object:

```html theme={null}
<iframe
  src="https://app.textql.com/tableau?authKey=EMBED_USER_KEY&tableauDatasetId=COLLECTION_ID"
  width="100%"
  height="600px"
  frameBorder="0"
  allow="clipboard-write"
></iframe>
```

### Security Notes

* Embed links use a dedicated service account (Embed User) with restricted permissions
* The Embed User only has read access to Tableau collections
* Links do not expose personal admin credentials
* Rotate the Embed User's API key from Settings → API Keys if compromised


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.