Skip to content

Create Index

POST/api/v1/indexes

Create a searchable index over a source directory.

Query ParametersExpand Collapse
organization_id: optional string
project_id: optional string
Cookie ParametersExpand Collapse
session: optional string
Body ParametersJSONExpand Collapse
source_directory_id: string

ID of the source directory containing your documents.

description: optional string

Optional description of the index.

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: "parse" or "extract"

Product type: parse or extract.

One of the following:
"parse"
"extract"
ReturnsExpand Collapse
id: string

Unique identifier

export_config_id: string

ID of the export configuration.

name: string

Index name.

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

formatdate-time
description: optional string

Index description.

last_exported_at: optional string

Last export time.

formatdate-time
last_synced_at: optional string

Last sync time.

formatdate-time
metadata: optional map[unknown]

Build state and diagnostic info.

updated_at: optional string

Update datetime

formatdate-time

Create Index

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"
        }'
{
  "id": "id",
  "export_config_id": "export_config_id",
  "name": "name",
  "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"
}
Returns Examples
{
  "id": "id",
  "export_config_id": "export_config_id",
  "name": "name",
  "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"
}