---
title: "Set Collection Rerank Model"
method: PATCH
path: "/api/kb/collections/{collection}/rerank-model"
tags: ["kb"]
---

# Set Collection Rerank Model

`PATCH /api/kb/collections/{collection}/rerank-model`

Bind or clear the rerank model for a collection.

When set, ``knowledge_search`` adds a rerank stage for this KB using
the configured model. When cleared, no rerank is performed.

The rerank binding is user-scoped and stored in ``collection_config``,
so different users can have different rerank settings for the same
collection name.

## Path parameters

- `collection` string, required

## Request body

- BodySetCollectionRerankModelApiKbCollectionsCollectionRerankModelPatch
  - `rerank_model_id` string, nullable — Rerank model ID registered in the model hub. Pass null or an empty string to clear the binding (search will no longer rerank for this collection).

## Response `200`

Successful Response

- CollectionOperationResult — Response payload for collection-level management operations.
  - `status` string, required — Operation status: success|partial_success|error
  - `collection` string, required — Collection identifier affected by the operation
  - `message` string, required — Human-readable summary of the collection operation
  - `warnings` string[] — Non-fatal issues encountered while processing the collection
  - `affected_documents` CollectionOperationDetail[] — Subset of documents impacted by the collection operation
    - `doc_id` string, required — Document identifier affected by the operation
    - `status` 'pending' | 'running' | 'chunked' | 'partially_embedded' | 'success' | 'failed' | 'cancelled', required — States representing document ingestion lifecycle.
    - `message` string, nullable — Optional message describing individual document handling
  - `deleted_counts` object — Aggregated deletion counts per table when applicable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
