Skip to main content
Embed Ana directly into your own application using an iframe, or access her programmatically via the TextQL API. This guide covers authentication, access control, API usage, and security.

Quick Start

The fastest way to embed Ana is an iframe with an API key.
1

Create an API key

Go to Settings → Developers and click + Create API Key. Copy it immediately — the full key is only shown once.
2

Test the embed URL

Open this URL in an incognito window to confirm the key works:
3

Add the iframe to your app

Ana embedded in an application via iframe

Ana embedded in an application

For production, never expose a long-lived API key in frontend code. See Security for the recommended architecture.

Authentication

Personal API Keys vs Service Accounts

TextQL has two types of identities for programmatic access: Personal API Keys — Go to Settings → Developers → API Keys and click + Create API Key. You can optionally set a key name, expiry (e.g., 3600 for 1 hour), and assumed roles.
Personal API Keys settings page

Personal API Keys

Service Accounts — Go to Settings → Developers and click the Service Accounts tab. Set a name, description, roles (immutable after creation), and owner. Once created, generate API keys from the service account’s detail page — these keys act as the service account, not as you.
Create service account modal

Create service account modal

Service account detail page

Service account detail page

Admins can view and revoke all keys across the org under Settings → Developers → API Keys.

Access Control

How Roles Work

Roles control which connectors and context an API key can access. The embedded experience shows exactly the data the key’s identity has access to. Context can be scoped at three levels:
Settings Roles page

Settings → Roles

Assigning Roles to context files in Ontology

Assigning Roles to context files in Ontology

Programmatic Role Scoping

Your backend can mint scoped API keys on demand with the Create API Key endpoint — no separate TextQL user accounts needed per role or per tenant. Step 1 — List available roles:
Step 2 — Create a scoped key:
The response returns key — the full bearer secret, shown exactly once — plus an api_key object with the key’s id and metadata. Use key as the Authorization: Bearer credential for API calls, or as the ?authKey= value for embed URLs. Revoke a key before it expires with Revoke API Key. Row-level security with clientId: the clientId string is stored on the key and, when it is a JSON object string, saved TQL queries can read each field as _tql.client_attributes_json.<field>. Mint one key per tenant or end-user session and a single saved query serves all of them — each key only ever sees its own rows:
See fail-closed row-level scoping for the recommended pattern that refuses to render unscoped SQL. Pattern — mint a scoped key per user session:

SSO and Role Mapping

For organizations using SSO (Okta, Azure AD, Ping Identity), roles can be mapped from your identity provider’s groups so new users are automatically assigned the correct TextQL role on first login.
Settings Security Add OIDC Provider dialog

Settings → Security → OIDC Identity Providers

Embedding via iframe

Iframe Attributes

Query Parameters

All parameters are optional. Absent parameters fall back to the org/role defaults configured in TextQL settings. Authentication & session Connector selection Tool toggles — each accepts true or false; omit to use the org/role default. Example — SQL-only embed locked to two connectors:

Embedding in Tableau

  1. In Tableau, create a new workbook and add a dashboard
  2. From the Objects panel, drag a Web Page object onto the dashboard
  3. Enter your embed URL: https://app.textql.com/embed?authKey=YOUR_API_KEY
  4. Resize the Web Page object to fit your layout
Ana embedded in a Tableau dashboard

Ana embedded in a Tableau dashboard

One-Click Tableau Collection Chats

TextQL supports direct links to start chats with a specific Tableau collection already attached. Generating embed links (Admin only)
  1. Open any chat and click Attach Tableau
  2. Hover over a collection card and click the link icon in the top-left corner
  3. The embed URL is automatically copied to your clipboard
URL format
  • authKey — your organization’s Embed User API key (auto-generated)
  • tableauDatasetId — the ID of the Tableau collection to attach
  • message — an optional initial message to auto-send when the chat opens
Optional connector & tool parameters By default the chat is scoped to the Tableau collection only. To also give Ana access to your warehouse or semantic layer, attach the relevant connectors and enable the tools explicitly: sqlEnabled=true requires connectorIds — SQL resolves against the attached warehouse connectors, so enabling it without connectors fails the chat. ontologyEnabled=true works on its own: it defaults to the ontology of the Tableau collection’s connector, and connectorIds can additionally attach other connectors whose ontologies should be available.
Embed links use a dedicated service account with restricted permissions. Rotate the Embed User’s API key from Settings → Developers → API Keys if compromised.

Embedding in Other BI Tools

The same iframe pattern works in any tool that supports embedded web content:
  • Internal portals — React, Angular, Vue, etc.
  • Confluence / SharePoint — via HTML embed macros
  • Retool / Appsmith — via iframe components

API Reference

All API requests use base URL https://app.textql.com/v1 with a Bearer token in the Authorization header.

Endpoints

One-Shot Chat

Best for backend automations and scripts where you don’t need to show partial results.
  • question — the natural-language question for Ana
  • chatId — pass an existing ID to continue a conversation, or omit to start a new one
  • tools — configure which tools Ana can use (defaults applied if omitted)

Streaming Chat

Uses Connect-RPC to deliver tokens in real-time — ideal for user-facing apps with a live typing experience.
The streaming endpoint requires a Connect-RPC client and cannot be tested with a simple curl. Use the official SDKs.
Stream flow: initialize transport → send StreamRequest → receive metadata → stream text tokens and preview URLs → final QUERY_STATUS_COMPLETE

Client SDKs

Tool Configuration

Tool configuration is locked for the duration of a chat. Start a new chat if you need different tools.

Security

The core principle: never expose a long-lived API key in frontend code.
Recommended — Short-lived scoped keys (Pattern B): Your backend mints a fresh key per user session via CreateApiKey. Keys expire automatically, each session is auditable, and roles are scoped per key. See the code example above. Most secure — Backend proxy (Pattern A): Your frontend never sees a TextQL key at all. Your backend proxies all API calls, adding the Authorization: Bearer header server-side. Simpler alternative — Role-based static keys (Pattern C): Create a dedicated TextQL user and key per user group. Your backend selects the right key based on the authenticated user’s role. Security checklist:
  • API keys stored server-side only (env vars, secrets manager)
  • Frontend never contains hardcoded API keys
  • Each embed use case has its own dedicated key
  • Keys rotated on a regular schedule and unused keys revoked promptly
  • SSO role mappings configured so new users get appropriate access automatically

Quick Reference

API usage consumes ACUs just like interactive usage. Each chat sandbox stays warm for 1 hour after last activity (500 ACUs/hour), plus inference costs. See Pricing for the full rate table.