Clone Index

Clone Index
Clone an index and all currently stored data.

Trigger the cloning of an index from one knowledge base into another.

Cloning creates a new index in the target knowledge base with the same configuration as the source, then starts a background task to copy all documents, metadata, and embeddings. The cloned index functions independently of the original.

If an indexing is already active for the target knowledge base, the request will fail with a conflict error.

Request
URI
POST
https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/clone
COPY
Path Parameters
string
knowledge_base_id
Required

knowledge_base_id

string
index_id
Required

index_id


Request Body
IndexCloneRequest of type(s) application/json
Required
{
    "clone_into_knowledge_base_id": "string"
}
string As uuid As uuid
clone_into_knowledge_base_id
Required

ID of the knowledge base to clone into.

Authentication
This operation uses the following authentication methods.
Responses
201

Successful Response

Returns Index of type(s) application/json
{
    "id": "string",
    "name": "string",
    "description": "string",
    "embeddings_model_endpoint": "string",
    "text_splitting": "string",
    "chunk_size": 0,
    "chunk_overlap": 0,
    "hybrid_search": false,
    "text_search_config": "simple",
    "knowledge_base_id": "string",
    "object": "string",
    "created_at": 0,
    "last_indexed_at": 0,
    "last_indexed_by_id": "string",
    "num_documents": 0,
    "status": "string",
    "status_errors": [
        "string"
    ]
}
string As uuid As uuid
id
Required

ID of the index.

string
name
Optional
Constraints: maxLength: 256

Name of the index.

string
description
Optional

Description of the index.

string
embeddings_model_endpoint
Required

ID of the model to be used by the index for generating embeddings.

string
text_splitting
Required

Method for chunking text for embedding

integer
chunk_size
Required
Constraints: minimum: 100

Maximum size (in tokens) of the text chunks. This must be at least 100 to accommodate for content metadata embedded alongside each chunk of text.

integer
chunk_overlap
Optional
Constraints: minimum: 0 default: 0

Size of the chunk overlap (in tokens) when splitting text.

boolean
hybrid_search
Optional

Enable or disable hybrid search. If enabled, text_search_config must be provided.

string
text_search_config
Optional

The text search configuration to use for hybrid search. The available values depend on the version of the database server used by this Private AI Services instances. Please refer to the PostgreSQL server documentation for available values. For example: 'simple', 'english', 'french'.

string As uuid As uuid
knowledge_base_id
Required

ID of the knowledge base of the index.

string
object
Optional
Constraints: default: index

Object type, which is always index.

integer
created_at
Required

Unix timestamp (in seconds) when the index was created.

integer
last_indexed_at
Optional

Unix timestamp (in seconds) when the index contents were last indexed.

string As uuid As uuid
last_indexed_by_id
Optional

ID of the most recent indexing job that affected this index.

integer
num_documents
Optional
Constraints: minimum: 0 default: 0

Total number of documents in the index.

string
status
Required

Availability status of the index.

Possible values are : AVAILABLE, ERROR,
array of string
status_errors
Optional

Details of the index error status, if the index is not available.

Possible values are : AGENT_ID_NOT_FOUND, FAILED_TO_PAGINATE_LIST, AGENT_SESSION_ID_NOT_FOUND, INDEX_NOT_FOUND, INDEX_NOT_REACHABLE, ROUTE_TO_MODEL_NOT_FOUND, INVALID_MODEL_TYPE_FOR_AGENT, AGENT_SESSION_EXPIRED, UNEXPECTED_MODEL, INVALID_RESPONSE_FROM_MODEL_ENDPOINT, INVALID_INFERENCE_REQUEST_FOR_MODEL_TYPE, VALIDATION_ERROR, MAX_LENGTH_METADATA_REACHED, INVALID_AGENT_ATTRIBUTE, KNOWLEDGE_BASE_INVALID_STATE, DATA_SOURCE_NOT_FOUND, DATA_SOURCE_STILL_LINKED_TO_KNOWLEDGE_BASE, KNOWLEDGE_BASE_NOT_FOUND, DOCUMENT_NOT_FOUND, EMPTY_DOCUMENT_FILE, DOCUMENT_EXCEEDS_MAX_UPLOAD_SIZE, INDEXING_NOT_FOUND, NO_ACTIVE_INDEXING, ERROR_NOT_FOUND, INDEX_FOR_KNOWLEDGE_BASE_ALREADY_EXISTS, UNSUPPORTED_CONFIGURATION, PENDING_INDEXING_ALREADY_EXISTS_FOR_KB, CREATING_INDEXING_FOR_LOCAL_FILES_KB_NOT_ALLOWED, KNOWLEDGE_BASE_DATA_SOURCE_NOT_UNLINKING, KNOWLEDGE_BASE_DATA_SOURCE_NOT_FOUND, KNOWLEDGE_BASE_DATA_SOURCE_ALREADY_EXISTS, KNOWLEDGE_BASE_LINK_DATA_SOURCE_NOT_SUPPORTED, KNOWLEDGE_BASE_UPLOAD_NOT_SUPPORTED_FOR_DATA_SOURCE, KNOWLEDGE_BASE_DELETE_NOT_SUPPORTED_FOR_DATA_SOURCE, KNOWLEDGE_BASE_DELETE_NOT_SUPPORTED_WHILE_AGENT_IS_LINKED, KNOWLEDGE_BASE_DELETE_CONFLICT, DOCUMENT_NOT_IN_DELETABLE_STATE, COMPLETION_MODEL_ENDPOINT_UNAVAILABLE, EMBEDDING_MODEL_ENDPOINT_UNAVAILABLE, EMBEDDING_MODEL_ENDPOINT_BAD_TYPE, MCP_SERVER_NOT_FOUND, MCP_TOOLS_IN_USE, TOOL_NOT_FOUND, INVALID_MODEL_CONFIGURATION, TOOL_NOT_APPROVED, TOOL_NOT_AVAILABLE, INVALID_TOOL_CONFIGURATION, MCP_SERVER_HEADER_NOT_FOUND, AGENT_COMPLETION_FAILED, DISALLOWED_ROLE,

404

Invalid knowledge base or index ID.

Operation doesn't return any data structure

409

An active Indexing already exists for this knowledge base ID.

Operation doesn't return any data structure

422

Validation Error

Returns HTTPValidationError of type(s) application/json
{
    "detail": [
        {
            "loc": [
                {}
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
array of object
detail
Optional

detail


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"clone_into_knowledge_base_id":"string"}' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/clone