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

# Indexes

The API exposes a read-only view of your [indexes](/scanner/using-scanner-complete-feature-reference/data-ingestion/index-organization.md) — the named containers your ingested log events live in, referenced by `@index` / `@index_id` in queries. Only user-created indexes are returned; internal [system indexes](/scanner/using-scanner-complete-feature-reference/built-in-indexes.md) (e.g. detection, audit, usage) are not addressable through this API.

## List indexes

<mark style="color:blue;">**`GET`**</mark> `/v1/index`

List the searchable indexes for a tenant.

**Query parameters**

| Name                                                 | Type   | Description                                                                                                                                                    |
| ---------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tenant_id` <mark style="color:red;">required</mark> | string | Unique identifier for the tenant                                                                                                                               |
| `pagination[page_size]`                              | number | Maximum number of results to return in a page. Defaults to 100.                                                                                                |
| `pagination[page_token]`                             | string | Cursor for pagination. Pass back the `next_page_token` returned in a previous response's `pagination`. If omitted, paging starts at the beginning of the list. |

**Example**

```bash
curl -G $API_BASE/v1/index \
--data-urlencode "tenant_id=$TENANT_ID" \
--data-urlencode "pagination[page_size]=100" \
-H "Authorization: Bearer $API_KEY"
```

**Response**

Returns a paginated envelope whose `data.indexes` is a list of index objects. The `pagination` object carries the `next_page_token` to pass as the next request's `pagination[page_token]`; `next_page_token` is `null` when there are no more pages.

```json
{
  "data": {
    "indexes": [
      {
        "id": "00000000-0000-0000-0000-000000000001",
        "name": "cloudtrail_logs",
        "description": "AWS CloudTrail events"
      }
    ]
  },
  "pagination": {
    "next_page_token": null
  }
}
```

## Get an index

<mark style="color:blue;">**`GET`**</mark> `/v1/index/{id}`

Retrieve a single index by id. Returns `404` for ids that resolve to a non-user index (e.g. detection, audit, usage, or legacy query-record indexes), so internal indexes are not addressable through the public API.

**Path parameters**

| Name                                          | Type   | Description     |
| --------------------------------------------- | ------ | --------------- |
| `id` <mark style="color:red;">required</mark> | string | Unique index id |

**Example**

```bash
curl $API_BASE/v1/index/00000000-0000-0000-0000-000000000001 \
-H "Authorization: Bearer $API_KEY"
```

**Response**

Returns the index object.

```json
{
  "id": "00000000-0000-0000-0000-000000000001",
  "name": "cloudtrail_logs",
  "description": "AWS CloudTrail events"
}
```

## Response object reference

### Index

| Field         | Type   | Description                                     |
| ------------- | ------ | ----------------------------------------------- |
| `id`          | string | Unique index id. Use as `@index_id` in queries. |
| `name`        | string | Index name. Use as `@index` in queries.         |
| `description` | string | Human-readable description of the index.        |


---

# 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.scanner.dev/scanner/using-scanner-complete-feature-reference/developer-tools/api/indexes.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.
