> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/api-reference/tools.md).

# Tools

Utility endpoints that support common operational tasks: generating barcodes, managing the tenant cache, verifying email addresses, and querying the analytics database with KQL.

Utility endpoints that support common operational tasks: generating barcodes, managing the tenant cache, verifying email addresses, and querying the analytics database with KQL.

### Barcode

Generate barcode and QR code images server-side. Useful when you need to embed a scannable code in a PDF, email, receipt, or printed document — without relying on the client to render it.

Supported symbologies include QR Code, Code 128, PDF417, EAN-13, and Data Matrix. The response is an image in the requested format (PNG, SVG, or base64).

### Cache

The Wallet Crew caches rendered pass content to reduce latency at scale. The `Cache` endpoints let you invalidate cached content for a tenant or a specific pass when data changes outside the normal update flow.

| Operation          | Description                                    |
| ------------------ | ---------------------------------------------- |
| Flush tenant cache | Force re-render of all passes on next request. |
| Flush pass cache   | Force re-render of a specific pass.            |

> Use cache flush sparingly. Normal pass updates via the Pass API already invalidate the relevant cache entries automatically.

### EmailVerifier

Validate an email address in real time — before creating a customer profile or issuing a pass. The verifier checks:

* Syntax validity (RFC 5321).
* Domain existence and MX record resolution.
* Optionally, mailbox-level verification against the mail server.

This helps prevent duplicate or invalid profiles caused by typos at enrolment time.

### Insights

The `Insights` endpoint runs **Kusto Query Language (KQL)** queries against the tenant's analytics database. This is the programmatic access point for custom dashboards, BI pipelines, scheduled reports, and data exports.

#### Database tables

| Table     | Retention  | Description                                                                    |
| --------- | ---------- | ------------------------------------------------------------------------------ |
| `Events`  | Indefinite | Page views, API requests, pass lifecycle events, scan events, customer events. |
| `Metrics` | Indefinite | Hourly snapshots of system state (active passes, install counts, etc.).        |
| `Logs`    | 45 days    | Platform traces and error logs for debugging.                                  |

#### Common queries

```kql
// New customers over the last 30 days
Events
| where eventType == "Customer:Upserted" and timestamp > ago(30d)
| summarize NewCustomers = count() by bin(timestamp, 1d)
```

```kql
// Pass installation trend
Events
| where eventType == "Pass:Installed"
| summarize Installations = count() by bin(timestamp, 1d)
| order by timestamp asc
```

```kql
// Redirect performance by day
Events
| where eventType == "Redirect:Redirected"
| summarize Redirects = count() by bin(timestamp, 1d)
```

#### Key event types

| Category       | Event types                                                          |
| -------------- | -------------------------------------------------------------------- |
| Pass lifecycle | `Pass:Created`, `Pass:Updated`, `Pass:Installed`, `Pass:Uninstalled` |
| Customer       | `Customer:Upserted`                                                  |
| Wallet actions | `action:addToAppleWallet`, `action:addToGoogleWallet`                |
| Social sign-in | `action:loginWithGoogle`, `action:loginWithApple`                    |
| Tracking       | `Request`, `PageView`, `Redirect:Redirected`                         |

#### Authentication and limits

| Requirement  | Value                                                       |
| ------------ | ----------------------------------------------------------- |
| Scope        | `Insights.Read`                                             |
| Rate limit   | 60 requests / minute                                        |
| Query access | Single-tenant only — you cannot query another tenant's data |

### Further reading

* [Insights API guide](https://docs.thewalletcrew.io/developers-guides/integration-guides/insights-api) — KQL reference, tables, common queries, troubleshooting
* [Analytics dashboards guide](https://docs.thewalletcrew.io/guides-monitoring/monitor/analytics-dashboards)
* [KPI definitions](https://docs.thewalletcrew.io/guides-monitoring/monitor/kpi-definitions)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thewalletcrew.io/api-reference/tools.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
