curl --request POST \
--url https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rank_by": [
"answers.urgency.p",
"desc"
],
"top_k": 100,
"include": {
"attributes": [
"plan",
"account_id"
],
"answers": [
"urgency"
]
}
}
'import requests
url = "https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query"
payload = {
"rank_by": ["answers.urgency.p", "desc"],
"top_k": 100,
"include": {
"attributes": ["plan", "account_id"],
"answers": ["urgency"]
}
}
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({
rank_by: ['answers.urgency.p', 'desc'],
top_k: 100,
include: {attributes: ['plan', 'account_id'], answers: ['urgency']}
})
};
fetch('https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query', 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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query",
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([
'rank_by' => [
'answers.urgency.p',
'desc'
],
'top_k' => 100,
'include' => [
'attributes' => [
'plan',
'account_id'
],
'answers' => [
'urgency'
]
]
]),
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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query"
payload := strings.NewReader("{\n \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query")
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 \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{
"id": "<string>",
"revision": 1,
"attributes": {},
"answers": {},
"state": {}
}
],
"next_cursor": "<string>",
"more": true,
"usage": {
"bytes_written": 1,
"bytes_scanned": 1,
"judgment_units": 1,
"tokens_evaluated": 1
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}Query the documents that match a subscription now
Runs the subscription’s filter as a query, with your own
ranking, page size, cursor and fields, and bills like one. Use it
to seed a receiver, and to re-read the members after
subscription.synced. For a template’s subscription, call it on
the tenant namespace an event names.
curl --request POST \
--url https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rank_by": [
"answers.urgency.p",
"desc"
],
"top_k": 100,
"include": {
"attributes": [
"plan",
"account_id"
],
"answers": [
"urgency"
]
}
}
'import requests
url = "https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query"
payload = {
"rank_by": ["answers.urgency.p", "desc"],
"top_k": 100,
"include": {
"attributes": ["plan", "account_id"],
"answers": ["urgency"]
}
}
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({
rank_by: ['answers.urgency.p', 'desc'],
top_k: 100,
include: {attributes: ['plan', 'account_id'], answers: ['urgency']}
})
};
fetch('https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query', 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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query",
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([
'rank_by' => [
'answers.urgency.p',
'desc'
],
'top_k' => 100,
'include' => [
'attributes' => [
'plan',
'account_id'
],
'answers' => [
'urgency'
]
]
]),
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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query"
payload := strings.NewReader("{\n \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\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.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brussle.com/v1/namespaces/{ns}/subscriptions/{name}/query")
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 \"rank_by\": [\n \"answers.urgency.p\",\n \"desc\"\n ],\n \"top_k\": 100,\n \"include\": {\n \"attributes\": [\n \"plan\",\n \"account_id\"\n ],\n \"answers\": [\n \"urgency\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{
"id": "<string>",
"revision": 1,
"attributes": {},
"answers": {},
"state": {}
}
],
"next_cursor": "<string>",
"more": true,
"usage": {
"bytes_written": 1,
"bytes_scanned": 1,
"judgment_units": 1,
"tokens_evaluated": 1
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {
"reason": "<string>",
"suggested_context": {
"recipe": {
"fields": [
"<string>"
],
"last_n": {},
"window": {},
"max_tokens": 2,
"related": {},
"previous": {
"fields": [
"<string>"
],
"anchor": "<string>"
}
},
"cost_per_answer": 1,
"whole_state_cost_per_answer": 1,
"sampled_documents": 2,
"excluded": [
{
"path": "<string>",
"reason": "id"
}
]
}
}
}
}Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Path Parameters
The namespace name, with any / sent as %2F.
Up to 256 bytes. / separates levels of the hierarchy, as in acme/prod/tenant_123. Never exactly . or .., which a URL path can't carry.
1 - 256^(?!\.\.?$)[A-Za-z0-9._:/-]+$A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..
1 - 128^[A-Za-z0-9_-]+$Body
A query whose filter is the subscription's own. It takes everything a query does except filters.
One field and a direction. Ties are broken by id.
Show child attributes
Show child attributes
1 <= x <= 1000The previous page's next_cursor. Valid for 10 minutes; keeps pages consistent for the cursor's life.
The fields each row carries besides id and revision.
Show child attributes
Show child attributes
fresh_only excludes rows whose included answers are not fresh.
any, fresh_only eventual may serve a view of the namespace up to 60 seconds old.
strong, eventual