curl --request POST \
--url http://localhost:3000/api/v1/observers/rules/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"observerAgentId": "<string>",
"delivery": "<string>",
"disabled": true,
"events": "<string>",
"meta": "<string>",
"mode": "<string>",
"model": "<string>",
"permissions": "<string>",
"priority": "<string>",
"profile": "<string>",
"provider": "<string>",
"role": "<string>",
"scope": "<string>",
"sourceAgent": "<string>",
"sourceProfile": "<string>",
"sourceProject": "<string>",
"sourceSession": "<string>",
"sourceTask": "<string>",
"tag": "<string>",
"tagInherited": true,
"tagTarget": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/observers/rules/set"
payload = {
"id": "<string>",
"observerAgentId": "<string>",
"delivery": "<string>",
"disabled": True,
"events": "<string>",
"meta": "<string>",
"mode": "<string>",
"model": "<string>",
"permissions": "<string>",
"priority": "<string>",
"profile": "<string>",
"provider": "<string>",
"role": "<string>",
"scope": "<string>",
"sourceAgent": "<string>",
"sourceProfile": "<string>",
"sourceProject": "<string>",
"sourceSession": "<string>",
"sourceTask": "<string>",
"tag": "<string>",
"tagInherited": True,
"tagTarget": "<string>"
}
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({
id: '<string>',
observerAgentId: '<string>',
delivery: '<string>',
disabled: true,
events: '<string>',
meta: '<string>',
mode: '<string>',
model: '<string>',
permissions: '<string>',
priority: '<string>',
profile: '<string>',
provider: '<string>',
role: '<string>',
scope: '<string>',
sourceAgent: '<string>',
sourceProfile: '<string>',
sourceProject: '<string>',
sourceSession: '<string>',
sourceTask: '<string>',
tag: '<string>',
tagInherited: true,
tagTarget: '<string>'
})
};
fetch('http://localhost:3000/api/v1/observers/rules/set', 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/observers/rules/set",
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([
'id' => '<string>',
'observerAgentId' => '<string>',
'delivery' => '<string>',
'disabled' => true,
'events' => '<string>',
'meta' => '<string>',
'mode' => '<string>',
'model' => '<string>',
'permissions' => '<string>',
'priority' => '<string>',
'profile' => '<string>',
'provider' => '<string>',
'role' => '<string>',
'scope' => '<string>',
'sourceAgent' => '<string>',
'sourceProfile' => '<string>',
'sourceProject' => '<string>',
'sourceSession' => '<string>',
'sourceTask' => '<string>',
'tag' => '<string>',
'tagInherited' => true,
'tagTarget' => '<string>'
]),
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 := "http://localhost:3000/api/v1/observers/rules/set"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\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("http://localhost:3000/api/v1/observers/rules/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/observers/rules/set")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}Create or overwrite an observer rule
curl --request POST \
--url http://localhost:3000/api/v1/observers/rules/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"observerAgentId": "<string>",
"delivery": "<string>",
"disabled": true,
"events": "<string>",
"meta": "<string>",
"mode": "<string>",
"model": "<string>",
"permissions": "<string>",
"priority": "<string>",
"profile": "<string>",
"provider": "<string>",
"role": "<string>",
"scope": "<string>",
"sourceAgent": "<string>",
"sourceProfile": "<string>",
"sourceProject": "<string>",
"sourceSession": "<string>",
"sourceTask": "<string>",
"tag": "<string>",
"tagInherited": true,
"tagTarget": "<string>"
}
'import requests
url = "http://localhost:3000/api/v1/observers/rules/set"
payload = {
"id": "<string>",
"observerAgentId": "<string>",
"delivery": "<string>",
"disabled": True,
"events": "<string>",
"meta": "<string>",
"mode": "<string>",
"model": "<string>",
"permissions": "<string>",
"priority": "<string>",
"profile": "<string>",
"provider": "<string>",
"role": "<string>",
"scope": "<string>",
"sourceAgent": "<string>",
"sourceProfile": "<string>",
"sourceProject": "<string>",
"sourceSession": "<string>",
"sourceTask": "<string>",
"tag": "<string>",
"tagInherited": True,
"tagTarget": "<string>"
}
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({
id: '<string>',
observerAgentId: '<string>',
delivery: '<string>',
disabled: true,
events: '<string>',
meta: '<string>',
mode: '<string>',
model: '<string>',
permissions: '<string>',
priority: '<string>',
profile: '<string>',
provider: '<string>',
role: '<string>',
scope: '<string>',
sourceAgent: '<string>',
sourceProfile: '<string>',
sourceProject: '<string>',
sourceSession: '<string>',
sourceTask: '<string>',
tag: '<string>',
tagInherited: true,
tagTarget: '<string>'
})
};
fetch('http://localhost:3000/api/v1/observers/rules/set', 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/observers/rules/set",
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([
'id' => '<string>',
'observerAgentId' => '<string>',
'delivery' => '<string>',
'disabled' => true,
'events' => '<string>',
'meta' => '<string>',
'mode' => '<string>',
'model' => '<string>',
'permissions' => '<string>',
'priority' => '<string>',
'profile' => '<string>',
'provider' => '<string>',
'role' => '<string>',
'scope' => '<string>',
'sourceAgent' => '<string>',
'sourceProfile' => '<string>',
'sourceProject' => '<string>',
'sourceSession' => '<string>',
'sourceTask' => '<string>',
'tag' => '<string>',
'tagInherited' => true,
'tagTarget' => '<string>'
]),
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 := "http://localhost:3000/api/v1/observers/rules/set"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\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("http://localhost:3000/api/v1/observers/rules/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/observers/rules/set")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"observerAgentId\": \"<string>\",\n \"delivery\": \"<string>\",\n \"disabled\": true,\n \"events\": \"<string>\",\n \"meta\": \"<string>\",\n \"mode\": \"<string>\",\n \"model\": \"<string>\",\n \"permissions\": \"<string>\",\n \"priority\": \"<string>\",\n \"profile\": \"<string>\",\n \"provider\": \"<string>\",\n \"role\": \"<string>\",\n \"scope\": \"<string>\",\n \"sourceAgent\": \"<string>\",\n \"sourceProfile\": \"<string>\",\n \"sourceProject\": \"<string>\",\n \"sourceSession\": \"<string>\",\n \"sourceTask\": \"<string>\",\n \"tag\": \"<string>\",\n \"tagInherited\": true,\n \"tagTarget\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Runtime context-key (rctx_*) issued by the Ravi gateway. Required for every non-open scope. Bootstrap the first key with ravi daemon init-admin-key; rotate, derive, and revoke via the ravi context family. Specs: runtime/context-keys, sdk/auth.
Body
Observer rule id
Agent id for the observer session
realtime|debounce|end_of_turn|manual
Create rule disabled
Comma-separated observation event types
Free JSON metadata for the rule
observe|summarize|report
Runtime model for observer execution; use 'clear' to inherit the observer agent model
Comma-separated permission grants for observer
Lower priority wins
Observer profile id for Markdown prompt rendering; use 'clear' to use the default profile
Runtime provider id for observer execution; use 'clear' to inherit the observer agent provider
Observer role. Defaults to rule id.
global|agent|session|task|profile|project|tag
Match source agent id
Match source task profile id
Match source project id
Match source session name/key
Match source task id
Match tag slug for scope=tag
Allow inherited tag matching
agent|session|task|project|contact|profile|any
Response
Success — no @Returns schema declared; payload shape is loose.
The response is of type object.