## Get Index

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

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

Get an index by ID.

### Parameters

- `indexID: string`

- `query: IndexGetParams`

  - `expand?: Array<"sync_in_progress">`

    Fields to expand. Supported value: sync_in_progress.

    - `"sync_in_progress"`

  - `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.

  - `sync_in_progress?: boolean | null`

    Whether the index is syncing its source or exporting the result. Requires `expand=sync_in_progress`.

  - `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.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"
  },
  "sync_in_progress": true,
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
