> 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-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 (collection) PUT http://localhost:6333/collections/{collection_name}/snapshots/recover Content-Type: application/json Recovers local collection data from a snapshot. This will overwrite any collection data stored on the node. If the collection does not exist, it will be created. Reference: https://api.qdrant.tech/api-reference/snapshots/recover-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 ### 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 SnapshotRecover. - `location` (string, required) — Examples: - URL `http://localhost:8080/collections/my_collection/snapshots/my_snapshot` - Local path `file:///qdrant/snapshots/test_collection-2022-08-04-10-49-10.snapshot` - `priority` (SnapshotRecoverPriority, optional) — Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to `Snapshot`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to `Replica`, the current state will be used as a source of truth, and after recovery if will be synchronized with the snapshot. - `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 ### SnapshotRecoverPriority Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to `Snapshot`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to `Replica`, the current state will be used as a source of truth, and after recovery if will be synchronized with the snapshot. ## Examples **Request** ```json { "location": "string" } ``` **Response** ```json { "time": 0.002, "status": "ok", "result": true } ``` **SDK Code** ```python from qdrant_client import QdrantClient client = QdrantClient(url="http://localhost:6333") client.recover_snapshot( "{collection_name}", "http://example.com/path/to/snapshot.shapshot", ) ``` ```typescript import { QdrantClient } from "@qdrant/js-client-rest"; const client = new QdrantClient({ host: "localhost", port: 6333 }); client.recoverSnapshot("{collection_name}", { location: "http://example.com/path/to/snapshot.shapshot", }); ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://localhost:6333/collections/collection_name/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/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/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/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/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/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() ```