# Indexes

## Get Index

`client.beta.indexes.get(stringindexID, IndexGetParamsquery?, RequestOptionsoptions?): IndexGetResponse`

**get** `/api/v1/indexes/{index_id}`

Get an index by ID.

### Parameters

- `indexID: string`

- `query: IndexGetParams`

  - `organization_id?: string | null`

  - `project_id?: string | null`

### Returns

- `IndexGetResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const index = await client.beta.indexes.get('index_id');

console.log(index.id);
```

#### Response

```json
{
  "id": "id",
  "export_config_id": "export_config_id",
  "name": "name",
  "output_directory_id": "output_directory_id",
  "project_id": "project_id",
  "source_directory_id": "source_directory_id",
  "sync_config_id": "sync_config_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "last_exported_at": "2019-12-27T18:11:19.117Z",
  "last_synced_at": "2019-12-27T18:11:19.117Z",
  "metadata": {
    "foo": "bar"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Delete Index

`client.beta.indexes.delete(stringindexID, IndexDeleteParamsparams?, RequestOptionsoptions?): void`

**delete** `/api/v1/indexes/{index_id}`

Delete an index.

### Parameters

- `indexID: string`

- `params: IndexDeleteParams`

  - `organization_id?: string | null`

  - `project_id?: string | null`

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

await client.beta.indexes.delete('index_id');
```

## Create Index

`client.beta.indexes.create(IndexCreateParamsparams, RequestOptionsoptions?): IndexCreateResponse`

**post** `/api/v1/indexes`

Create a searchable index over a source directory.

### Parameters

- `params: IndexCreateParams`

  - `source_directory_id: string`

    Body param: ID of the source directory containing your documents.

  - `organization_id?: string | null`

    Query param

  - `project_id?: string | null`

    Query param

  - `description?: string | null`

    Body param: Optional description of the index.

  - `name?: string | null`

    Body param: Optional display name for the index. If omitted, the index is named after the source directory.

  - `products?: Array<Product> | null`

    Body param: Product configurations for syncing. Omit to use a default parse configuration. Include an explicit entry per product type (e.g. parse, extract) to override the default.

    - `product_config_id: string`

      ID of the product configuration.

    - `product_type: string`

      Product type. One of: parse, extract.

  - `store_attachments?: Array<string> | null`

    Body param: Attachment kinds to store alongside parsed output. Each entry must be one of: screenshots, items. For example, ['screenshots'] renders and stores per-page screenshots; ['items'] stores structured items with bounding boxes. Omit or pass an empty list to skip attachments.

  - `sync_frequency?: string`

    Body param: How often to re-run the sync. One of: manual, daily, on_source_change. Defaults to manual.

  - `vector_target?: "DEFAULT" | "DISABLED"`

    Body param: Vector export destination for the index. 'DEFAULT' exports to the managed vector DB destination resolved from configuration. 'DISABLED' skips vector export — the export destination falls back to 'Download'.

    - `"DEFAULT"`

    - `"DISABLED"`

### Returns

- `IndexCreateResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const index = await client.beta.indexes.create({ source_directory_id: 'dir-abc123' });

console.log(index.id);
```

#### Response

```json
{
  "id": "id",
  "export_config_id": "export_config_id",
  "name": "name",
  "output_directory_id": "output_directory_id",
  "project_id": "project_id",
  "source_directory_id": "source_directory_id",
  "sync_config_id": "sync_config_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "last_exported_at": "2019-12-27T18:11:19.117Z",
  "last_synced_at": "2019-12-27T18:11:19.117Z",
  "metadata": {
    "foo": "bar"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Sync Index

`client.beta.indexes.sync(stringindexID, IndexSyncParamsparams?, RequestOptionsoptions?): IndexSyncResponse`

**post** `/api/v1/indexes/{index_id}/sync`

Trigger a sync and export for an existing index, re-parsing changed files and exporting updated chunks.

### Parameters

- `indexID: string`

- `params: IndexSyncParams`

  - `organization_id?: string | null`

  - `project_id?: string | null`

### Returns

- `IndexSyncResponse = unknown`

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const response = await client.beta.indexes.sync('index_id');

console.log(response);
```

#### Response

```json
{}
```

## List Indexes

`client.beta.indexes.list(IndexListParamsquery?, RequestOptionsoptions?): PaginatedCursor<IndexListResponse>`

**get** `/api/v1/indexes`

List indexes for the current project.

### Parameters

- `query: IndexListParams`

  - `organization_id?: string | null`

  - `page_size?: number | null`

  - `page_token?: string | null`

  - `project_id?: string | null`

  - `source_directory_id?: string | null`

### Returns

- `IndexListResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const indexListResponse of client.beta.indexes.list()) {
  console.log(indexListResponse.id);
}
```

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "export_config_id": "export_config_id",
      "name": "name",
      "output_directory_id": "output_directory_id",
      "project_id": "project_id",
      "source_directory_id": "source_directory_id",
      "sync_config_id": "sync_config_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "last_exported_at": "2019-12-27T18:11:19.117Z",
      "last_synced_at": "2019-12-27T18:11:19.117Z",
      "metadata": {
        "foo": "bar"
      },
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```

## Domain Types

### Index Get Response

- `IndexGetResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime

### Index Create Response

- `IndexCreateResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime

### Index Sync Response

- `IndexSyncResponse = unknown`

### Index List Response

- `IndexListResponse`

  A searchable index over a directory of documents.

  - `id: string`

    Unique identifier

  - `export_config_id: string`

    ID of the export configuration.

  - `name: string`

    Index name.

  - `output_directory_id: string`

    ID of the output directory holding the indexed files.

  - `project_id: string`

    Project this index belongs to.

  - `source_directory_id: string`

    ID of the source directory.

  - `sync_config_id: string`

    ID of the sync configuration.

  - `created_at?: string | null`

    Creation datetime

  - `description?: string | null`

    Index description.

  - `last_exported_at?: string | null`

    Last export time.

  - `last_synced_at?: string | null`

    Last sync time.

  - `metadata?: Record<string, unknown>`

    Build state and diagnostic info.

  - `updated_at?: string | null`

    Update datetime
