> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.qdrant.tech/v-1-17-x/api-reference/snapshots/recover-shard-from-snapshot/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.qdrant.tech/_mcp/server. # Recover from a snapshot (shard) PUT http://localhost:6333/collections/{collection_name}/shards/{shard_id}/snapshots/recover Content-Type: application/json Recovers the shard of a local collection from a snapshot. This will overwrite any collection data, which is stored in this shard. Reference: https://api.qdrant.tech/api-reference/snapshots/recover-shard-from-snapshot ## Authentication - `api-key` header (required) — API Key authentication via header ## Servers - `http://localhost:6333` (http, default) - `https://localhost:6333` (https) ## Request ### Path parameters - `collection_name` (string, required) — Name of the collection - `shard_id` (integer, required) — Id of the shard to recover ### Query parameters - `wait` (boolean, optional) — If true, wait for changes to actually happen. If false - let changes happen in background. Default is true. ### Body (application/json) This endpoint expects a ShardSnapshotRecover. - `location` (ShardSnapshotLocation, required) - `priority` (ShardSnapshotRecoverPriority, optional) - `checksum` (string, optional, nullable) — Optional SHA256 checksum to verify snapshot integrity before recovery. - `api_key` (string, optional, nullable) — Optional API key used when fetching the snapshot from a remote URL. ## Response ### 200 successful operation - `time` (double, optional) — Time spent to process this request - `status` (string, optional) - `result` (boolean, optional) ## Types ### ShardSnapshotLocation ### ShardSnapshotRecoverPriority ## Examples **Request** ```json { "location": "string" } ``` **Response** ```json { "time": 0.002, "status": "ok", "result": true } ``` **SDK Code** ```python import requests url = "http://localhost:6333/collections/collection_name/shards/1/snapshots/recover" payload = { "location": "string" } headers = { "api-key": "", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'http://localhost:6333/collections/collection_name/shards/1/snapshots/recover'; const options = { method: 'PUT', headers: {'api-key': '', 'Content-Type': 'application/json'}, body: '{"location":"string"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://localhost:6333/collections/collection_name/shards/1/snapshots/recover" payload := strings.NewReader("{\n \"location\": \"string\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("http://localhost:6333/collections/collection_name/shards/1/snapshots/recover") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Put.new(url) request["api-key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"location\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("http://localhost:6333/collections/collection_name/shards/1/snapshots/recover") .header("api-key", "") .header("Content-Type", "application/json") .body("{\n \"location\": \"string\"\n}") .asString(); ``` ```php request('PUT', 'http://localhost:6333/collections/collection_name/shards/1/snapshots/recover', [ 'body' => '{ "location": "string" }', 'headers' => [ 'Content-Type' => 'application/json', 'api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://localhost:6333/collections/collection_name/shards/1/snapshots/recover"); var request = new RestRequest(Method.PUT); request.AddHeader("api-key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"location\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "api-key": "", "Content-Type": "application/json" ] let parameters = ["location": "string"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:6333/collections/collection_name/shards/1/snapshots/recover")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```