curl --request POST \
--url http://localhost:3000/api/v1/bases/subscribe \
--header 'Content-Type: application/json' \
--data '
{
"base": "<string>",
"agent": "<string>",
"console": "<string>",
"events": "<string>",
"message": "<string>",
"project": "<string>",
"props": "<string>",
"session": "<string>",
"trigger": true,
"view": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/bases/subscribe"
payload = {
"base": "<string>",
"agent": "<string>",
"console": "<string>",
"events": "<string>",
"message": "<string>",
"project": "<string>",
"props": "<string>",
"session": "<string>",
"trigger": True,
"view": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
base: '<string>',
agent: '<string>',
console: '<string>',
events: '<string>',
message: '<string>',
project: '<string>',
props: '<string>',
session: '<string>',
trigger: true,
view: '<string>'
})
};
fetch('http://localhost:3000/api/v1/bases/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/bases/subscribe",
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([
'base' => '<string>',
'agent' => '<string>',
'console' => '<string>',
'events' => '<string>',
'message' => '<string>',
'project' => '<string>',
'props' => '<string>',
'session' => '<string>',
'trigger' => true,
'view' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/v1/bases/subscribe"
payload := strings.NewReader("{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/bases/subscribe")
.header("Content-Type", "application/json")
.body("{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/bases/subscribe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"consoleUrl": "<string>",
"delivery": {
"category": "<string>",
"natsSubject": "<string>"
},
"filter": {
"events": [
"<string>"
],
"properties": [
"<string>"
],
"viewId": "<string>"
},
"projectRef": "<string>",
"subscription": {
"baseId": "<string>",
"createdAt": "<string>",
"id": "<string>",
"installationName": "<string>",
"localInstallationId": "<string>",
"revokedAt": "<string>",
"status": "<string>",
"userId": "<string>",
"events": [
"<string>"
],
"properties": [
"<string>"
],
"viewId": "<string>"
},
"success": true,
"trigger": {
"agentId": "<string>",
"created": true,
"draft": true,
"enableCommand": "<string>",
"enabled": true,
"filter": "<string>",
"id": "<string>",
"name": "<string>",
"session": "<string>",
"topic": "<string>"
}
}Deliver this base's row events to this installation's inbox, optionally filtered and with a trigger
curl --request POST \
--url http://localhost:3000/api/v1/bases/subscribe \
--header 'Content-Type: application/json' \
--data '
{
"base": "<string>",
"agent": "<string>",
"console": "<string>",
"events": "<string>",
"message": "<string>",
"project": "<string>",
"props": "<string>",
"session": "<string>",
"trigger": true,
"view": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/bases/subscribe"
payload = {
"base": "<string>",
"agent": "<string>",
"console": "<string>",
"events": "<string>",
"message": "<string>",
"project": "<string>",
"props": "<string>",
"session": "<string>",
"trigger": True,
"view": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
base: '<string>',
agent: '<string>',
console: '<string>',
events: '<string>',
message: '<string>',
project: '<string>',
props: '<string>',
session: '<string>',
trigger: true,
view: '<string>'
})
};
fetch('http://localhost:3000/api/v1/bases/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/bases/subscribe",
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([
'base' => '<string>',
'agent' => '<string>',
'console' => '<string>',
'events' => '<string>',
'message' => '<string>',
'project' => '<string>',
'props' => '<string>',
'session' => '<string>',
'trigger' => true,
'view' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/v1/bases/subscribe"
payload := strings.NewReader("{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/v1/bases/subscribe")
.header("Content-Type", "application/json")
.body("{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/bases/subscribe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"base\": \"<string>\",\n \"agent\": \"<string>\",\n \"console\": \"<string>\",\n \"events\": \"<string>\",\n \"message\": \"<string>\",\n \"project\": \"<string>\",\n \"props\": \"<string>\",\n \"session\": \"<string>\",\n \"trigger\": true,\n \"view\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"consoleUrl": "<string>",
"delivery": {
"category": "<string>",
"natsSubject": "<string>"
},
"filter": {
"events": [
"<string>"
],
"properties": [
"<string>"
],
"viewId": "<string>"
},
"projectRef": "<string>",
"subscription": {
"baseId": "<string>",
"createdAt": "<string>",
"id": "<string>",
"installationName": "<string>",
"localInstallationId": "<string>",
"revokedAt": "<string>",
"status": "<string>",
"userId": "<string>",
"events": [
"<string>"
],
"properties": [
"<string>"
],
"viewId": "<string>"
},
"success": true,
"trigger": {
"agentId": "<string>",
"created": true,
"draft": true,
"enableCommand": "<string>",
"enabled": true,
"filter": "<string>",
"id": "<string>",
"name": "<string>",
"session": "<string>",
"topic": "<string>"
}
}Body
Base id or slug
With --trigger: the agent the trigger wakes (required)
Console base URL
Only these events, comma-separated: row.created, row.updated, row.archived, row.restored, approval.requested, approval.decided, agent.requested, agent.backfill
With --trigger: prompt template ({{data.}}); default: a short Bases event prompt
Console project id or slug; overrides the saved Console scope
Only changes to these properties, comma-separated keys or ids (1-20)
With --trigger: session to run in, by name or template (e.g. bases-{{data.payload.rowId}}); default: the current session, or the agent main session
Also create a local trigger on ravi.console.inbox.item for these events; from an agent session it is a disabled draft
Only rows that pass this view's filter, evaluated for you (after the write; before an archive)