W Wiretalk Docs
Developer documentation

Data Lookup

Connect your database so visitors get real answers from your data.

Dashboard: Widget Settings → Data lookup

Connect your client database so visitors get real answers from your data — order status, account balance, ticket history, and more. Data lookup runs before bot templates and AI.

Database connection

Security: Use a read-only database user. Wiretalk never writes to your client database through data lookup.
1

Add connection details

Host, port, database name, username, and password. Supports MySQL and other configured drivers.

2

Test the connection

Use the built-in connection test before saving. Config is stored encrypted on your site.

3

Build lookup rules

Define rules that map visitor questions to SQL queries and format the response message.

Lookup rules

Message patterns

Match visitor messages with keywords or patterns. Each rule runs a query and formats the reply.

Visitor login

Require visitors to authenticate (e.g. customer ID + phone) before sensitive data is returned.

Joins & filters

Build multi-table queries with joins, WHERE clauses, and column mappings in the visual rule builder.

Row actions

Show paginated results in the widget with clickable row actions (e.g. “View invoice”).

Widget experience

Visitors can paginate through result sets and trigger row actions directly in the chat widget. Demo endpoints are available for testing row actions during setup.

API endpoints

EndpointPurpose
GET/PATCH /api/agent/data-lookupConfig & connection
GET /api/agent/data-lookup/schemaTable/column discovery
POST /api/agent/data-lookup/preview-ruleTest a rule before publish
GET /api/agent/data-lookup/logsExecution audit log
POST /api/widget/data-lookup/paginateVisitor pagination