curl --request POST \
--url https://api.harvey.ai/api/v1/vault/semantic_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"include_file_names": false
}
'import requests
url = "https://api.harvey.ai/api/v1/vault/semantic_search"
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"include_file_names": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
query: '<string>',
include_file_names: false
})
};
fetch('https://api.harvey.ai/api/v1/vault/semantic_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvey.ai/api/v1/vault/semantic_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'query' => '<string>',
'include_file_names' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v1/vault/semantic_search"
payload := strings.NewReader("{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.harvey.ai/api/v1/vault/semantic_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/vault/semantic_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "COMPLETED",
"data": {
"file_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"chunks": [
{
"file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"chunk_id": "<string>",
"chunk_idx": 123,
"page_number": 123,
"start_idx": 123,
"end_idx": 123,
"file_name": "<string>"
}
]
}
}Semantic search over a vault project
Performs semantic search over documents in a single vault project. Returns the most relevant text chunks for the given natural-language query. Intended for use by external systems (e.g. a customer’s own assistant or LLM) that need to retrieve relevant passages and then generate responses using their own models.
Requires vault sharing to be enabled.
curl --request POST \
--url https://api.harvey.ai/api/v1/vault/semantic_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"include_file_names": false
}
'import requests
url = "https://api.harvey.ai/api/v1/vault/semantic_search"
payload = {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "<string>",
"include_file_names": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
query: '<string>',
include_file_names: false
})
};
fetch('https://api.harvey.ai/api/v1/vault/semantic_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvey.ai/api/v1/vault/semantic_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'query' => '<string>',
'include_file_names' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v1/vault/semantic_search"
payload := strings.NewReader("{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.harvey.ai/api/v1/vault/semantic_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/vault/semantic_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"query\": \"<string>\",\n \"include_file_names\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "COMPLETED",
"data": {
"file_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"chunks": [
{
"file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"chunk_id": "<string>",
"chunk_idx": 123,
"page_number": 123,
"start_idx": 123,
"end_idx": 123,
"file_name": "<string>"
}
]
}
}Permissions
RequiresVault API and Vault sharing permissions.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for semantic search over a vault project. Returns relevant document chunks for the query; clients can pass these chunks to their own LLM. Access requires Vault API permission; contact Harvey for permissioning needs.
UUID of the vault project to search in
Natural language search query.
1When true, each chunk in the response includes a file_name field (display name of the source file, or null if the file was deleted after indexing). Omit or set to false for backward compatibility.