Document Indexes

Create

Beta
POST
https://api.vellum.ai/v1/document-indexes
Creates a new document index.

Request

This endpoint expects an object.
label
string
A human-readable label for the document index
name
string
A name that uniquely identifies this index within its workspace
indexing_config
map from strings to any
Configuration representing how documents should be indexed
status
optional enum

The current status of the document index

  • ACTIVE - Active
  • ARCHIVED - Archived
Allowed values: ACTIVEARCHIVED
environment
optional enum

The environment this document index is used in

  • DEVELOPMENT - Development
  • STAGING - Staging
  • PRODUCTION - Production
Allowed values: DEVELOPMENTSTAGINGPRODUCTION
copy_documents_from_index_id
optional string
Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index

Response

This endpoint return an object.
id
string
created
datetime
label
string
A human-readable label for the document index
name
string
A name that uniquely identifies this index within its workspace
indexing_config
map from strings to any
Configuration representing how documents should be indexed
status
optional enum

The current status of the document index

  • ACTIVE - Active
  • ARCHIVED - Archived
Allowed values: ACTIVEARCHIVED
environment
optional enum

The environment this document index is used in

  • DEVELOPMENT - Development
  • STAGING - Staging
  • PRODUCTION - Production
Allowed values: DEVELOPMENTSTAGINGPRODUCTION
POST
/v1/document-indexes
curl -X POST https://api.vellum.ai/v1/document-indexes \
-H "X_API_KEY: <apiKey>" \
-H "Content-Type: application/json" \
-d '{
"label": "My Document Index",
"name": "my-document-index",
"indexing_config": {
"chunking": {
"chunker_name": "sentence-chunker",
"chunker_config": {
"character_limit": 1000,
"min_overlap_ratio": 0.5
}
},
"vectorizer": {
"model_name": "hkunlp/instructor-xl",
"config": {
"instruction_domain": "",
"instruction_document_text_type": "plain_text",
"instruction_query_text_type": "plain_text"
}
}
}
}'
Response
{
"id": "id",
"created": "2024-01-15T09:30:00Z",
"label": "label",
"name": "name",
"indexing_config": {
"indexing_config": {
"key": "value"
}
},
"status": "ACTIVE",
"environment": "DEVELOPMENT"
}