> 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/automation-and-data.md).

# Automation and data

Run work on a schedule, react to events as they happen, and query the analytics behind your programme.

### Automations

An automation is a scheduled background task: data sync, pass updates, report exports. Reading automations and their executions needs `tenant.configuration.automation:read`, changing them needs `tenant.configuration.automation:write`. Deleting an automation keeps its execution history queryable.

### Webhooks

A webhook subscription delivers events such as a pass installed, a pass updated or a scan recorded to your endpoint, which must be an absolute `http` or `https` URL.

* Delivery is fire and forget: at most once, with no retry when your endpoint fails or answers with a non-2xx status.
* `events` match a name exactly or by a trailing `*`.
* Creating a subscription returns its `id` and a `signatureSecret`; listing or reading a subscription returns the `signatureSecret` too. It is created disabled unless you send `enabled: true`, and `PUT` replaces the whole subscription, so leaving `enabled` out disables it.
* The endpoints answer `403` until the feature is enabled for the tenant.

Every delivery carries these headers:

| Header                 | Content                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| `x-neostore-signature` | HMAC-SHA256 of the raw request body, hex-encoded in uppercase, keyed with the `signatureSecret`. |
| `x-neostore-eventname` | The event that triggered the delivery.                                                           |
| `x-neostore-tenantid`  | The tenant that emitted the event.                                                               |

The prefix `neostore` is the platform's former name and is kept in technical identifiers.

### Insights

`POST /api/{tenantId}/insights/query` runs a **Kusto Query Language (KQL)** query against your tenant's analytics data: custom dashboards, BI pipelines, scheduled reports, data exports.

The body is `{ query, parameters, options }`. Pass user-supplied values in `parameters` rather than building them into `query`. `options.maxRows` (1 to 100,000, default 100,000) is a limit, not a cap: a result with more rows returns `400` instead of being truncated, and a query that runs too long returns `504`.

The tables are `Events`, `Logs`, `Requests` and `PageViews`. Column names are case-sensitive.

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

The call needs `tenant.insights:read`, is limited to 60 requests per minute by default, and only sees your own tenant's data.

### Further reading

* [Webhooks guide](https://docs.thewalletcrew.io/developers-guides/integration-guides/webhooks)
* [Webhooks configuration](https://docs.thewalletcrew.io/developers-guides/integration-guides/webhooks/webhooks-configure)
* [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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/api-reference/automation-and-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
