# Indexes

## Get Index

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

Get an index by ID.

### Path Parameters

- `index_id: string`

### Query Parameters

- `organization_id: optional string`

- `project_id: optional string`

### Cookie Parameters

- `session: optional string`

### Returns

- `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: optional string`

  Creation datetime

- `description: optional string`

  Index description.

- `last_exported_at: optional string`

  Last export time.

- `last_synced_at: optional string`

  Last sync time.

- `metadata: optional map[unknown]`

  Build state and diagnostic info.

- `updated_at: optional string`

  Update datetime

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/indexes/$INDEX_ID \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### 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

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

Delete an index.

### Path Parameters

- `index_id: string`

### Query Parameters

- `organization_id: optional string`

- `project_id: optional string`

### Cookie Parameters

- `session: optional string`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/indexes/$INDEX_ID \
    -X DELETE \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

## Create Index

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

Create a searchable index over a source directory.

### Query Parameters

- `organization_id: optional string`

- `project_id: optional string`

### Cookie Parameters

- `session: optional string`

### Body Parameters

- `source_directory_id: string`

  ID of the source directory containing your documents.

- `description: optional string`

  Optional description of the index.

- `name: optional string`

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

- `products: optional array of object { product_config_id, product_type }`

  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: optional array of string`

  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: optional string`

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

- `vector_target: optional "DEFAULT" or "DISABLED"`

  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

- `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: optional string`

  Creation datetime

- `description: optional string`

  Index description.

- `last_exported_at: optional string`

  Last export time.

- `last_synced_at: optional string`

  Last sync time.

- `metadata: optional map[unknown]`

  Build state and diagnostic info.

- `updated_at: optional string`

  Update datetime

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/indexes \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '{
          "source_directory_id": "dir-abc123"
        }'
```

#### 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

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

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

### Path Parameters

- `index_id: string`

### Query Parameters

- `organization_id: optional string`

- `project_id: optional string`

### Cookie Parameters

- `session: optional string`

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/indexes/$INDEX_ID/sync \
    -X POST \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### Response

```json
{}
```

## List Indexes

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

List indexes for the current project.

### Query Parameters

- `organization_id: optional string`

- `page_size: optional number`

- `page_token: optional string`

- `project_id: optional string`

- `source_directory_id: optional string`

### Cookie Parameters

- `session: optional string`

### Returns

- `items: array of object { id, export_config_id, name, 10 more }`

  The list of items.

  - `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: optional string`

    Creation datetime

  - `description: optional string`

    Index description.

  - `last_exported_at: optional string`

    Last export time.

  - `last_synced_at: optional string`

    Last sync time.

  - `metadata: optional map[unknown]`

    Build state and diagnostic info.

  - `updated_at: optional string`

    Update datetime

- `next_page_token: optional string`

  A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

- `total_size: optional number`

  The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only.

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/indexes \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
```

#### 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 object { id, export_config_id, name, 10 more }`

  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: optional string`

    Creation datetime

  - `description: optional string`

    Index description.

  - `last_exported_at: optional string`

    Last export time.

  - `last_synced_at: optional string`

    Last sync time.

  - `metadata: optional map[unknown]`

    Build state and diagnostic info.

  - `updated_at: optional string`

    Update datetime

### Index Create Response

- `IndexCreateResponse object { id, export_config_id, name, 10 more }`

  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: optional string`

    Creation datetime

  - `description: optional string`

    Index description.

  - `last_exported_at: optional string`

    Last export time.

  - `last_synced_at: optional string`

    Last sync time.

  - `metadata: optional map[unknown]`

    Build state and diagnostic info.

  - `updated_at: optional string`

    Update datetime

### Index Sync Response

- `IndexSyncResponse = unknown`

### Index List Response

- `IndexListResponse object { id, export_config_id, name, 10 more }`

  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: optional string`

    Creation datetime

  - `description: optional string`

    Index description.

  - `last_exported_at: optional string`

    Last export time.

  - `last_synced_at: optional string`

    Last sync time.

  - `metadata: optional map[unknown]`

    Build state and diagnostic info.

  - `updated_at: optional string`

    Update datetime
