curl --request POST \
--url https://api.example.com/v0/subscription-previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"saved_query_id": "<string>",
"saved_query_version_id": "<string>",
"limit": 20,
"accepted_after": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v0/subscription-previews"
payload = {
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"saved_query_id": "<string>",
"saved_query_version_id": "<string>",
"limit": 20,
"accepted_after": "2023-11-07T05:31:56Z"
}
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({
evaluator: {plugin_id: '<string>', version: '<string>', configuration: {}},
saved_query_id: '<string>',
saved_query_version_id: '<string>',
limit: 20,
accepted_after: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v0/subscription-previews', 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/subscription-previews",
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([
'evaluator' => [
'plugin_id' => '<string>',
'version' => '<string>',
'configuration' => [
]
],
'saved_query_id' => '<string>',
'saved_query_version_id' => '<string>',
'limit' => 20,
'accepted_after' => '2023-11-07T05:31:56Z'
]),
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/subscription-previews"
payload := strings.NewReader("{\n \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\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/subscription-previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/subscription-previews")
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 \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"evaluated": 1,
"matched": 1,
"not_ready": 1,
"complete": true,
"matches": [
{
"corpus_id": "<string>",
"record_id": "<string>",
"record_version_id": "<string>",
"accepted_at": "2023-11-07T05:31:56Z",
"evidence": {
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"explanation": "<string>",
"part_keys": [
"<string>"
],
"details": {}
}
}
],
"oldest_accepted_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}Preview subscription
Dry run of a proposed Subscription. Runs the evaluator on the most recently accepted current eligible Record Versions of the Saved Query’s Corpora, newest first, and returns what it would have matched. Nothing is written - no Saved Query, Subscription, Match, Delivery or event - and it is not idempotent. The Saved Query is an inline definition or an existing Saved Query Version; the pair is validated as at Subscription creation (422 unsupported_evaluator, invalid_expression, invalid_subscription_configuration). Each Record Version costs one evaluator call, sent with the synthetic Subscription reference preview. At most limit Record Versions (1 to 50, default 20) are judged, within a four-second budget including preparation and storage reads; those still undecided when it runs out are left out and complete is false. An evaluator that cannot be reached or reports a transient failure fails the preview with 503 evaluator_unavailable, and one that refuses or breaks an evaluation with 502 evaluator_error. A deadline during preparation or an earlier caller deadline returns retryable 504 preview_deadline_exceeded. A storage failure remains 503 storage_unavailable. Quivr applies no rate or cost rule; a layer above can limit who previews and how often.
curl --request POST \
--url https://api.example.com/v0/subscription-previews \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"saved_query_id": "<string>",
"saved_query_version_id": "<string>",
"limit": 20,
"accepted_after": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v0/subscription-previews"
payload = {
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"saved_query_id": "<string>",
"saved_query_version_id": "<string>",
"limit": 20,
"accepted_after": "2023-11-07T05:31:56Z"
}
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({
evaluator: {plugin_id: '<string>', version: '<string>', configuration: {}},
saved_query_id: '<string>',
saved_query_version_id: '<string>',
limit: 20,
accepted_after: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v0/subscription-previews', 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/subscription-previews",
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([
'evaluator' => [
'plugin_id' => '<string>',
'version' => '<string>',
'configuration' => [
]
],
'saved_query_id' => '<string>',
'saved_query_version_id' => '<string>',
'limit' => 20,
'accepted_after' => '2023-11-07T05:31:56Z'
]),
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/subscription-previews"
payload := strings.NewReader("{\n \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\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/subscription-previews")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/subscription-previews")
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 \"evaluator\": {\n \"plugin_id\": \"<string>\",\n \"version\": \"<string>\",\n \"configuration\": {}\n },\n \"saved_query_id\": \"<string>\",\n \"saved_query_version_id\": \"<string>\",\n \"limit\": 20,\n \"accepted_after\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"evaluated": 1,
"matched": 1,
"not_ready": 1,
"complete": true,
"matches": [
{
"corpus_id": "<string>",
"record_id": "<string>",
"record_version_id": "<string>",
"accepted_at": "2023-11-07T05:31:56Z",
"evidence": {
"evaluator": {
"plugin_id": "<string>",
"version": "<string>",
"configuration": {}
},
"explanation": "<string>",
"part_keys": [
"<string>"
],
"details": {}
}
}
],
"oldest_accepted_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}Authorizations
Body
A proposed Subscription to preview. Give either definition, an inline Saved Query definition, or saved_query_id with saved_query_version_id, an existing Saved Query Version; not both.
Response
Successful response
What a proposed Subscription would have matched among recent Record Versions.