> For the complete documentation index, see [llms.txt](https://docs.vectra.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vectra.ai/operations/event-search/investigate-api-user-guide.md).

# Investigate API user guide

Query Vectra network metadata and cloud logs with the Investigate API. Available with a Vectra AI Pro Platform license in a Respond UX (RUX) deployment.

## Investigate API User Guide

Query Vectra network metadata and cloud logs with SQL over REST. This guide covers the request and response contract and how to discover what you can query. The endpoint reference is in the API documentation.

{% hint style="warning" %}
**Please Note:**

The Investigate API is available for Respond UX (RUX) deployments and requires a Vectra AI Pro Platform subscription. If you are unfamiliar with your deployment type, please see [Analyst UX options (RUX vs QUX)](/deployment/getting-started/analyst-ux-options-rux-vs-qux.md).

If an API client makes requests without the tenant being license for the Vectra AI Pro Platform, it will receive `403 Forbidden` .
{% endhint %}

{% hint style="info" %}
**Please Note:**

It is recommended to use API version v3.5. This guide uses v3.5 endpoints throughout. Some Investigate API support is also being back-ported to v3.4, but v3.5 is the version to use for the most complete and up-to-date experience.
{% endhint %}

## Where to Find What

| You want                                              | Go to                                                                                                              |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Exact request and response schemas for every endpoint | [Investigations API reference (v3.5)](https://apidocs.vectra.ai/api/v-3-5-investigations)                          |
| The tables and fields available to you right now      | The discovery endpoints in this guide. They are the source of truth.                                               |
| Field descriptions in a readable page                 | [Investigate API metadata schema reference](/operations/event-search/investigate-api-metadata-schema-reference.md) |
| How to build and run queries                          | This guide                                                                                                         |

{% hint style="success" %}
**Tables and fields change.** Vectra adds fields and new tables over time. This guide does not list them. Ask the API: it always reflects what your tenant can query today.
{% endhint %}

## Overview

The Investigate API (also called the Metadata API) runs SQL-like queries against the network metadata and cloud logs that Vectra collects. In your Vectra AI UI, this same data can be found in the Event Search area. This is the same data behind Vectra detections, available for threat hunting, incident response, and ad-hoc investigation.

* Query back through **your tenant's data retention period**. Each submit response reports it as `searchable_range.searchable_days_allowed`.
* Query network sessions and protocol metadata, and cloud audit logs. Which tables you can query depends on the data sources connected to your tenant. See [Discover what you can query](#discover-what-you-can-query).
* Filter, aggregate (`GROUP BY`, `HAVING`), combine with `UNION` or `UNION ALL`, use subqueries and `CASE WHEN`.
* Retrieve up to **10,000 rows** per query, with pagination.

The query API is asynchronous: **submit** a query, **poll** until it finishes, then **retrieve** results by page.

## Quick Start

Every step uses `https://{tenant_hostname}`, to signify the hostname of your Vectra AI Pro Platform tenant. You will also require a bearer token from [Authentication](#authentication).

{% stepper %}
{% step %}

#### List the Tables You Can Query

```bash
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://{tenant_hostname}/api/v3.5/investigations/tables/"
```

{% endstep %}

{% step %}

#### Read the Schema of One Table

Use the table's `name` from the previous step.

```bash
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://{tenant_hostname}/api/v3.5/investigations/schemas/isession/"
```

{% endstep %}

{% step %}

#### Submit a Query

```bash
curl -s -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  "https://{tenant_hostname}/api/v3.5/investigations/" \
  -d @- <<'EOF'
{
  "query": "SELECT timestamp, id.orig_h AS src, id.resp_h AS dst, id.resp_p AS dport FROM network.isession WHERE timestamp > date_add('hour', -1, now()) LIMIT 10",
  "version": "1.0"
}
EOF
```

The response contains a `request_id`.
{% endstep %}

{% step %}

#### Poll Until the Query Finishes

Wait until `meta.query_status` is `SUCCESS`, then read the rows.

```bash
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://{brain}/api/v3.5/investigations/{request_id}/"
```

{% endstep %}
{% endstepper %}

## Authentication

{% hint style="info" %}
**Please Note:**

Additional documentation is available at <https://apidocs.vectra.ai/resources/authentication>.

It details how to securely authenticate and interact with the API and covers everything you need to know about tokens, headers, and session management.
{% endhint %}

The API uses OAuth 2.0 bearer tokens. Create an API client in you Vectra AI UI at *Configuration → Access → API Clients* (it needs Investigations API access), then request a token:

```bash
curl -s -X POST "https://{tenant_hostname}/oauth2/token" \
  -d "grant_type=client_credentials" \
  -d "client_id={client_id}" \
  -d "client_secret={client_secret}"
```

```json
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}
```

Send the token on every request as `Authorization: Bearer {access_token}`. Tokens last 3,600 seconds (1 hour). Request a new one before it expires, or when you receive `401 Unauthorized`.

## Discover What You Can Query

Use these endpoints before you write a query, and again whenever a query fails with `COLUMN_NOT_FOUND`.

<table><thead><tr><th width="285.11328125">Action</th><th>Method and path</th></tr></thead><tbody><tr><td>List tables available to your tenant</td><td><code>GET /api/v3.5/investigations/tables/</code></td></tr><tr><td>Get one table</td><td><code>GET /api/v3.5/investigations/tables/{table}/</code></td></tr><tr><td>List every table that has a schema</td><td><code>GET /api/v3.5/investigations/schemas/</code></td></tr><tr><td>Get the schema for one table</td><td><code>GET /api/v3.5/investigations/schemas/{table_name}/</code></td></tr></tbody></table>

### List Tables

`GET /api/v3.5/investigations/tables/` returns the tables your tenant can query, which depends on the data sources you have connected. Optional filters:

<table><thead><tr><th width="134.8359375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>category</code></td><td>Restrict to one category. Use an <code>id</code> from the <code>categories</code> array in the response, for example <code>network</code>.</td></tr><tr><td><code>source_type</code></td><td>Restrict to one source type, for example <code>network</code> or <code>aws</code>.</td></tr><tr><td><code>source_id</code></td><td>Restrict to one source instance. Requires <code>source_type</code>. Copy it from <code>connectors[].id</code> in a table record.</td></tr></tbody></table>

Example response (shortened):

```json
{
  "categories": [
    { "id": "network", "label": "Network" },
    { "id": "aws", "label": "AWS" }
  ],
  "tables": [
    {
      "name": "dns",
      "label": "DNS Records",
      "category_id": "network",
      "aliases": ["dnsrecordinfo"],
      "connectors": [{ "id": "a6915784734f4963aa0d78868cc81b41", "source_type": "network" }],
      "internal": false
    }
  ]
}
```

A filter combination that matches nothing returns `200` with an empty `tables` array.

### Get a Schema

`GET /api/v3.5/investigations/schemas/{table_name}/` returns every field of one table with its type and description. The `table_name` is the table's `name` from the tables list.

```json
{
  "results": {
    "table_name": "ssl",
    "schema": {
      "server_name": {
        "type": "string",
        "description": "Value of the Server Name Indicator SSL/TLS extension"
      },
      "id.orig_h": {
        "type": "string",
        "description": "Originating endpoint IP address",
        "usage": ["ip_address"]
      },
      "client_extension[]": {
        "type": "int",
        "description": "Client extensions"
      }
    }
  }
}
```

How to read a schema:

* **Field names are the paths you write in a query.** A nested field is a dotted path, for example `id.orig_h`.
* **`[]` after a name marks an array.** Use the name without the brackets in SQL. See [Query language](#query-language).
* **`usage` is a hint about the value** (for example `ip_address`). It is not a different type.
* **Types vary by table.** Do not assume a fixed list of type names.
* **Ignore properties you do not recognize.** More can be added.

The schema catalog (`GET .../schemas/`) is the same for every tenant and can list tables that have no data on yours. The tables list is specific to your tenant. Use the tables list to decide what you can query, and the schema to learn the fields.

### Table Names in Queries

The API returns a table's `name` (for example `ssl`) without its source prefix. Write queries with the prefix, `FROM network.ssl`:

* Network tables use the `network.` prefix: `network.dns`, `network.ssl`.
* Cloud tables use the name of their source: `aws.cloudtrail`, `azurecp.operations`, `entra.signins`, `entra.directoryaudits`, `m365.exchange`, `m365.sharepoint`, `m365.general`, `m365.active_directory`.

{% hint style="info" %}
The `._all` suffix (`network.dns._all`) is optional. Both forms return the same results.
{% endhint %}

If you are not sure of a query name, run `SELECT * FROM <name> LIMIT 1`. An unknown table returns an error.

## How the Query API Works

```
1. Submit    POST /api/v3.5/investigations/
             body: { "query": "SELECT ...", "version": "1.0" }
             returns: { "request_id": "...", "searchable_range": {...} }

2. Poll      GET  /api/v3.5/investigations/{request_id}/
             repeat every 1 to 3 seconds until meta.query_status is SUCCESS

3. Retrieve  GET  /api/v3.5/investigations/{request_id}/?page=2&page_size=500
             repeat until you have meta.num_rows_available rows
```

Most queries finish in 5 to 15 seconds.

### Submit a Query

`POST /api/v3.5/investigations/`

<table><thead><tr><th width="100.75">Field</th><th width="94.59375">Type</th><th width="111.3828125">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code></td><td>string</td><td>Yes</td><td>The query. See <a href="#query-language">Query language</a>.</td></tr><tr><td><code>version</code></td><td>string</td><td>No</td><td>Query language version. Use <code>"1.0"</code> (the default).</td></tr></tbody></table>

```json
{
  "query": "SELECT timestamp, id.orig_h, id.resp_h, id.resp_p FROM network.isession WHERE timestamp > date_add('hour', -24, now()) AND local_orig = true AND local_resp = false LIMIT 100",
  "version": "1.0"
}
```

Response, `200 OK`:

```json
{
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "searchable_range": { "searchable_days_allowed": 14 }
}
```

The query runs against your whole retention period unless you narrow it with a `timestamp` filter, which you should always do.

### Retrieve Results

`GET /api/v3.5/investigations/{request_id}/`

<table><thead><tr><th width="139.87890625">Parameter</th><th width="121.91796875">Type</th><th width="105.07421875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>page</code></td><td>integer</td><td>1</td><td>Page number, starting at 1</td></tr><tr><td><code>page_size</code></td><td>integer</td><td>50</td><td>Rows per page (maximum 10,000)</td></tr></tbody></table>

Response when the query has finished:

```json
{
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "data": [
    ["2026-10-30T15:19:31.675Z", "10.232.100.150", "64.236.29.118", 443],
    ["2026-10-30T15:19:23.110Z", "10.232.100.32", "8.8.8.8", 53]
  ],
  "meta": {
    "page": 1,
    "page_size": 50,
    "num_rows_available": 2,
    "estimated_file_size_bytes": 220,
    "query_status": "SUCCESS",
    "columns": [
      ["timestamp", [{"type": "timestamp"}, ""]],
      ["src",       [{"type": "string"}, ""]],
      ["dst",       [{"type": "string"}, ""]],
      ["dport",     [{"type": "number"}, ""]]
    ]
  }
}
```

<table><thead><tr><th width="296.796875">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>data</code></td><td>The rows. Each row is an <strong>array of values</strong>.</td></tr><tr><td><code>meta.columns</code></td><td>One entry per selected column, in order: <code>[name, [{"type": ...}, hint]]</code>.</td></tr><tr><td><code>meta.query_status</code></td><td>Progress of the query. See below.</td></tr><tr><td><code>meta.num_rows_available</code></td><td>Total rows the query returned, across all pages.</td></tr><tr><td><code>meta.page</code>, <code>meta.page_size</code></td><td>The page you received.</td></tr><tr><td><code>meta.estimated_file_size_bytes</code></td><td>Estimated size of the full result.</td></tr></tbody></table>

While the query is running, the response is the same shape with empty `data` and `columns`, and `num_rows_available` of 0.

### Read the Rows

**Each value's position in a row matches its position in `meta.columns`.** Row values are not labeled. Build the mapping from `columns` for every response; do not hard-code positions.

* Column names are the **last part** of the field path: `SELECT id.orig_h` returns a column named `orig_h`. Give columns explicit names with `AS` (for example `id.orig_h AS src`). Aliases keep names unique and stable if fields are renamed or added.
* Types in `columns` describe the result values (for example `string`, `number`, `boolean`, `timestamp`). They can differ from the schema's storage types. For an array column, the type slot holds a list: `["answers", [[{"type": "string"}], ""]]`. The second element of the pair is an optional hint and is often empty.
* A missing value is `null`. Struct fields for external addresses with no host record, such as `orig_hostname`, are `null`.
* **The row itself is always an array.** A structured or array value inside a row can be a JSON array or an object, and an object's values are keyed by name. Read the top level by position and nested values by key or index.

```python
def to_dicts(resp):
    names = [c[0] for c in resp["meta"]["columns"]]
    return [dict(zip(names, row)) for row in resp["data"]]
```

### Query Status

<table data-header-hidden><thead><tr><th width="304.93359375"></th><th></th></tr></thead><tbody><tr><td><code>meta.query_status</code></td><td>Meaning</td></tr><tr><td><code>PENDING</code> or <code>RUNNING</code></td><td>The query has not finished. Keep polling.</td></tr><tr><td><code>SUCCESS</code></td><td>Finished. <code>data</code> holds the first page.</td></tr></tbody></table>

Treat any other status as not finished, and stop polling when you receive an error response. Poll every 1 to 3 seconds. The API responds `202` while the query is still processing.

### Pagination

If `meta.num_rows_available` is larger than `meta.page_size`, there are more pages. There is no `next_page` field. Request pages in order until you have collected `num_rows_available` rows:

```
GET /api/v3.5/investigations/{request_id}/?page=1&page_size=500
GET /api/v3.5/investigations/{request_id}/?page=2&page_size=500
...
```

A `page_size` of 500 to 1,000 balances payload size against the number of requests.

## Errors

Errors are reported at two points. Both carry an `errorId`. Include it when you ask for help.

**Syntax errors come back in the POST response** (`400`), before the query runs:

```json
{
  "error": {
    "errorCode": "SYNTAX_ERROR",
    "errorId": "SAA23Q",
    "extra": [
      {
        "line": 1,
        "column": 96,
        "offending_symbol": "WHERE",
        "message": "query parsing failed: mismatched input 'WHERE' expecting '.'"
      }
    ]
  }
}
```

**Runtime errors come back when you poll** (`400` on the GET), after the query parses:

```json
{
  "error": {
    "errorCode": "DATABASE_ERROR",
    "errorId": "5WOPVA",
    "extra": [
      {
        "column": "orig_bytes",
        "error_name": "COLUMN_NOT_FOUND",
        "error_type": "USER_ERROR"
      }
    ]
  }
}
```

<table><thead><tr><th width="185.71484375">Error Name</th><th>Meaning</th></tr></thead><tbody><tr><td><code>COLUMN_NOT_FOUND</code></td><td>A field in the query does not exist in that table. <code>column</code> names it. Check the table's schema.</td></tr><tr><td><code>TYPE_MISMATCH</code></td><td>A comparison, <code>CAST</code>, or function argument has the wrong type.</td></tr></tbody></table>

`error_type: USER_ERROR` means the query is the problem. Other runtime error names can occur. Treat any `error` object as a failed query.

<table><thead><tr><th width="157.296875">HTTP status</th><th>Cause</th></tr></thead><tbody><tr><td><code>400</code></td><td>Invalid syntax, an unsupported clause, or a runtime query error</td></tr><tr><td><code>401</code></td><td>Missing or expired token</td></tr><tr><td><code>403</code></td><td>The API client lacks Investigations API access, or the tenant has no Vectra AI Pro Platform subscription</td></tr><tr><td><code>404</code></td><td>Unknown <code>request_id</code>, or unknown table in a discovery request</td></tr><tr><td><code>413</code></td><td>Result too large. Narrow the <code>WHERE</code> clause or reduce <code>LIMIT</code>.</td></tr><tr><td><code>429</code></td><td>Rate limit exceeded</td></tr><tr><td><code>500</code>, <code>503</code>, <code>504</code></td><td>Service error or timeout. Retry later with a narrower query.</td></tr></tbody></table>

Discovery endpoints report errors as an `errors` array of `{ "field", "code", "message" }` objects.

## Query Language

Queries are SQL-like. One `SELECT` statement per request.

| Clause                       | Supported | Notes                                                                |
| ---------------------------- | --------- | -------------------------------------------------------------------- |
| `SELECT`, `FROM`, `WHERE`    | Yes       | One table per `FROM`. There is no `JOIN`.                            |
| `ORDER BY`, `LIMIT`          | Yes       | Always set `LIMIT` (maximum 10,000).                                 |
| `GROUP BY`, `HAVING`         | Yes       |                                                                      |
| `UNION`, `UNION ALL`         | Yes       | Combine queries on different tables. Branches need matching columns. |
| Subqueries, `CASE WHEN`      | Yes       |                                                                      |
| `JOIN`                       | No        | Use `UNION` or a subquery.                                           |
| `INSERT`, `UPDATE`, `DELETE` | No        | The API is read-only.                                                |

Functions follow the usual SQL families: aggregate (`COUNT`, `SUM`, `AVG`, `MAX`, `MIN`), string, time (`now`, `date_add`, `date_diff`, `date_trunc`), regular expression, JSON, type casting (`CAST`, `TRY_CAST`), and array predicates (`ANY_MATCH`, `CARDINALITY`). Use the error response to find out whether a function is available on your tenant.

{% hint style="info" %}
**Query language support grows over time.** Vectra continues to add clauses and functions, and this documentation describes the product at a point in time. If a clause or function you expect is not accepted, check the error response.
{% endhint %}

### Always Filter by Time

Every query should have a `timestamp` condition:

```sql
WHERE timestamp > date_add('hour', -24, now())
WHERE timestamp > date_add('day', -7, now())
WHERE timestamp >= '2026-10-01T00:00:00Z' AND timestamp < '2026-10-02T00:00:00Z'
```

### Field Names

* In **`WHERE`**, write the full path of a nested field: `id.resp_h`, not `resp_h`. A flat name returns `COLUMN_NOT_FOUND`.
* In **`SELECT`**, either form works. The result column is named after the last part of the path.
* In **`ORDER BY`**, either form works if the column is in the `SELECT` list. Use an alias to be safe.
* Array fields marked `[]` in a schema are written without the brackets. Use array functions on them, for example `ANY_MATCH` or `CARDINALITY`. To use a regular expression on an array, `CAST` it to `VARCHAR` first.

```sql
-- Correct
SELECT id.orig_h AS src FROM network.http WHERE id.resp_h = '203.0.113.9' ORDER BY src

-- COLUMN_NOT_FOUND: resp_h is not a field name in WHERE
SELECT id.orig_h FROM network.http WHERE resp_h = '203.0.113.9'
```

## Sample Queries

Each sample is a complete request body. Field names come from table schemas, so confirm them on your tenant with [Get a schema](#get-a-schema) before you adapt a query.

**Outbound connections in the last 24 hours**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, id.resp_h AS dst, id.resp_p AS dport, orig_ip_bytes, resp_ip_bytes FROM network.isession WHERE timestamp > date_add('hour', -24, now()) AND local_orig = true AND local_resp = false ORDER BY timestamp DESC LIMIT 100",
  "version": "1.0"
}
```

**DNS lookups from one host**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, query, qtype_name, answers FROM network.dns WHERE id.orig_h = '198.51.100.20' AND timestamp > date_add('hour', -24, now()) ORDER BY timestamp DESC LIMIT 100",
  "version": "1.0"
}
```

**HTTP requests to one domain**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, host, uri, method, status_code, user_agent FROM network.http WHERE timestamp > date_add('day', -3, now()) AND host = 'example.com' ORDER BY timestamp DESC LIMIT 100",
  "version": "1.0"
}
```

**Failed Kerberos authentication (possible password spraying)**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, client, service, error_msg FROM network.kerberos WHERE timestamp > date_add('hour', -6, now()) AND success = false ORDER BY timestamp DESC LIMIT 500",
  "version": "1.0"
}
```

**Hosts that sent a lot of data outside (GROUP BY and HAVING)**

```json
{
  "query": "SELECT id.orig_h AS src, id.resp_h AS dst, COUNT(*) AS sessions, SUM(orig_ip_bytes) AS bytes_sent FROM network.isession WHERE timestamp > date_add('hour', -24, now()) AND local_orig = true AND local_resp = false GROUP BY id.orig_h, id.resp_h HAVING SUM(orig_ip_bytes) > 10000000 ORDER BY bytes_sent DESC LIMIT 100",
  "version": "1.0"
}
```

**Long DNS names or TXT lookups (tunneling indicators)**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, query, qtype_name, LENGTH(query) AS query_length FROM network.dns WHERE timestamp > date_add('hour', -24, now()) AND (LENGTH(query) > 50 OR qtype_name = 'TXT') ORDER BY query_length DESC LIMIT 200",
  "version": "1.0"
}
```

**Internal RDP sessions (lateral movement)**

```json
{
  "query": "SELECT timestamp, id.orig_h AS src, id.resp_h AS dst, orig_hostname.name AS src_host, resp_hostname.name AS dst_host FROM network.rdp WHERE timestamp > date_add('hour', -24, now()) AND local_orig = true AND local_resp = true ORDER BY timestamp DESC LIMIT 200",
  "version": "1.0"
}
```

**Changes made through AWS IAM**

```json
{
  "query": "SELECT timestamp, event_name, user_identity.arn AS actor, source_ip_address, error_code FROM aws.cloudtrail WHERE timestamp > date_add('day', -7, now()) AND event_source = 'iam.amazonaws.com' AND read_only = 'false' ORDER BY timestamp DESC LIMIT 200",
  "version": "1.0"
}
```

**Entra sign-ins from specific countries**

```json
{
  "query": "SELECT timestamp, user_principal_name, ip_address, location.country_or_region AS country FROM entra.signins WHERE timestamp > date_add('day', -7, now()) AND location.country_or_region IN ('RU', 'KP') ORDER BY timestamp DESC LIMIT 500",
  "version": "1.0"
}
```

**Source IPs seen on either of two protocols (UNION removes duplicates; UNION ALL keeps them)**

```json
{
  "query": "SELECT id.orig_h AS ip FROM network.http WHERE timestamp > date_add('day', -1, now()) UNION SELECT id.orig_h AS ip FROM network.dns WHERE timestamp > date_add('day', -1, now()) ORDER BY ip LIMIT 100",
  "version": "1.0"
}
```

**Group HTTP status codes (CASE WHEN)**

Repeat the `CASE` expression in `GROUP BY`. An alias cannot be reused there.

```json
{
  "query": "SELECT CASE WHEN status_code < 300 THEN 'success' WHEN status_code < 400 THEN 'redirect' WHEN status_code < 500 THEN 'client_error' ELSE 'server_error' END AS status_category, COUNT(*) AS request_count FROM network.http WHERE timestamp > date_add('day', -1, now()) GROUP BY CASE WHEN status_code < 300 THEN 'success' WHEN status_code < 400 THEN 'redirect' WHEN status_code < 500 THEN 'client_error' ELSE 'server_error' END ORDER BY request_count DESC LIMIT 20",
  "version": "1.0"
}
```

## Limits

<table><thead><tr><th width="246.6484375">Limit</th><th>Value</th></tr></thead><tbody><tr><td>Query submissions (<code>POST</code>)</td><td>5 per minute per user</td></tr><tr><td>Rows per query</td><td>10,000</td></tr><tr><td>Lookback</td><td>Your tenant's data retention period (<code>searchable_days_allowed</code>)</td></tr><tr><td>Polling interval</td><td>At least 1 second. 2 to 3 seconds is typical.</td></tr><tr><td>Token lifetime</td><td>3,600 seconds</td></tr></tbody></table>

**More than 10,000 rows:** split the query into time windows and submit them one after another, for example 4-hour windows across 24 hours.

## Troubleshooting

| Symptom                                | Likely cause                                                                        | What to do                                                                                         |
| -------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `SYNTAX_ERROR` on submit               | Malformed SQL, unsupported keyword such as `JOIN`                                   | Read `extra[].offending_symbol` and `extra[].message`                                              |
| `COLUMN_NOT_FOUND` on poll             | The field is not in that table, or a flat name was used in `WHERE`                  | Get the table's schema. Use the full path in `WHERE`.                                              |
| `TYPE_MISMATCH` on poll                | Incompatible types in a comparison, cast, or function                               | Check the field types in the schema. `CAST` array fields to `VARCHAR` before a regular expression. |
| `EXPRESSION_NOT_AGGREGATE` on poll     | Aggregate and plain columns mixed without `GROUP BY`                                | Add the plain columns to `GROUP BY`                                                                |
| `401`                                  | Expired or missing token                                                            | Request a new token                                                                                |
| `403`                                  | No Investigations API access, or no Vectra AI Pro Platform subscription             | Check the API client in Vectra Admin and your subscription                                         |
| `413`                                  | Result too large                                                                    | Narrow `WHERE`, lower `LIMIT`, or use a smaller `page_size`                                        |
| `429`                                  | More than 5 submissions in a minute                                                 | Wait 60 seconds                                                                                    |
| 0 rows                                 | Time range too narrow, wrong table, or range beyond retention                       | Widen the time range. Check `searchable_days_allowed`.                                             |
| A struct field is `null`               | An external IP has no Vectra host record                                            | Expected for `orig_hostname` and `resp_hostname`                                                   |
| Rows do not match your column names    | Positions were assumed                                                              | Map each row with `meta.columns`                                                                   |
| `UNION` column mismatch                | Branches differ in column count or aliases                                          | Give both branches the same columns and aliases                                                    |
| A table or field you expect is missing | The tenant has no source for it, or the field is newer than your copy of the schema | List tables and get the schema again                                                               |

## API Endpoint Summary

<table><thead><tr><th width="172.703125">Action</th><th width="75.75">Method</th><th width="522.45703125">Endpoint</th></tr></thead><tbody><tr><td>Get an access token</td><td><code>POST</code></td><td><code>https://{tenant_hostname}/oauth2/token</code></td></tr><tr><td>List tables</td><td><code>GET</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/tables/</code></td></tr><tr><td>Get a table</td><td><code>GET</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/tables/{table}/</code></td></tr><tr><td>List schemas</td><td><code>GET</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/schemas/</code></td></tr><tr><td>Get a schema</td><td><code>GET</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/schemas/{table_name}/</code></td></tr><tr><td>Submit a query</td><td><code>POST</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/</code></td></tr><tr><td>Poll and retrieve</td><td><code>GET</code></td><td><code>https://{tenant_hostname}/api/v3.5/investigations/{request_id}/?page=1&#x26;page_size=500</code></td></tr></tbody></table>

Full request and response schemas: [Investigations API reference (v3.5)](https://apidocs.vectra.ai/api/v-3-5-investigations).


---

# 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.vectra.ai/operations/event-search/investigate-api-user-guide.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.
