curl --request POST \
--url https://api.example.com/v0/saved-queries/{saved_query_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"definition": {
"corpus_ids": [
"<string>"
],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}
'import requests
url = "https://api.example.com/v0/saved-queries/{saved_query_id}/versions"
payload = {
"idempotency_key": "<string>",
"definition": {
"corpus_ids": ["<string>"],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}
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({
idempotency_key: '<string>',
definition: {
corpus_ids: ['<string>'],
expression: {},
retrieval_profile: '<string>',
temporal_policy: 'from_activation'
}
})
};
fetch('https://api.example.com/v0/saved-queries/{saved_query_id}/versions', 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.example.com/v0/saved-queries/{saved_query_id}/versions",
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([
'idempotency_key' => '<string>',
'definition' => [
'corpus_ids' => [
'<string>'
],
'expression' => [
],
'retrieval_profile' => '<string>',
'temporal_policy' => 'from_activation'
]
]),
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.example.com/v0/saved-queries/{saved_query_id}/versions"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\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.example.com/v0/saved-queries/{saved_query_id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/saved-queries/{saved_query_id}/versions")
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 \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"saved_query_id": "<string>",
"version_id": "<string>",
"definition": {
"corpus_ids": [
"<string>"
],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"field": "<string>",
"resync_url": "<string>"
}Create saved query version
Edit a Saved Query by committing a new immutable Version that becomes its current Version, with saved_query.updated in every Corpus of the previous and new scope. Subscriptions keep the Version they pin; a new Subscription Version moves one. The key must grant every Corpus of the current and new definitions. Replay of the same key and request returns the same Version; a changed request is 409 idempotency_conflict. A deleted Saved Query is 409 saved_query_deleted.
curl --request POST \
--url https://api.example.com/v0/saved-queries/{saved_query_id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"definition": {
"corpus_ids": [
"<string>"
],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}
'import requests
url = "https://api.example.com/v0/saved-queries/{saved_query_id}/versions"
payload = {
"idempotency_key": "<string>",
"definition": {
"corpus_ids": ["<string>"],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}
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({
idempotency_key: '<string>',
definition: {
corpus_ids: ['<string>'],
expression: {},
retrieval_profile: '<string>',
temporal_policy: 'from_activation'
}
})
};
fetch('https://api.example.com/v0/saved-queries/{saved_query_id}/versions', 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.example.com/v0/saved-queries/{saved_query_id}/versions",
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([
'idempotency_key' => '<string>',
'definition' => [
'corpus_ids' => [
'<string>'
],
'expression' => [
],
'retrieval_profile' => '<string>',
'temporal_policy' => 'from_activation'
]
]),
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.example.com/v0/saved-queries/{saved_query_id}/versions"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\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.example.com/v0/saved-queries/{saved_query_id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/saved-queries/{saved_query_id}/versions")
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 \"idempotency_key\": \"<string>\",\n \"definition\": {\n \"corpus_ids\": [\n \"<string>\"\n ],\n \"expression\": {},\n \"retrieval_profile\": \"<string>\",\n \"temporal_policy\": \"from_activation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"saved_query_id": "<string>",
"version_id": "<string>",
"definition": {
"corpus_ids": [
"<string>"
],
"expression": {},
"retrieval_profile": "<string>",
"temporal_policy": "from_activation"
}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"field": "<string>",
"resync_url": "<string>"
}Authorizations
API key, not necessarily a JWT. Server derives Organization, permitted actions and Corpus scope; every resource access is authorized.
Path Parameters
1Body
New immutable definition of an existing Saved Query. The name is unchanged (rename changes it).
Response
Successful response
11Immutable query definition. Expression semantics belong to the evaluator plugin; no core keyword or semantic threshold is implied. All Corpora belong to the authorized Organization.
Show child attributes
Show child attributes