Redact a revision
curl --request POST \
--url https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact', 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.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"seq": 123,
"op": "save",
"restoredFromSeq": 123,
"title": "<string>",
"description": "<string>",
"content": "<string>",
"contentTruncated": true,
"authorKind": "user",
"authorUserId": "<string>",
"authorEmail": "<string>",
"conversationId": "<string>",
"turnId": "<string>",
"redactedAt": "2023-11-07T05:31:56Z",
"redactedByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>"
}Memories
Redact a revision
Scrubs an old snapshot’s content in place (for example after a secret was pasted). The revision row stays, marked with redactedAt.
POST
/
agents
/
{agentId}
/
memories
/
{memoryId}
/
revisions
/
{revisionId}
/
redact
Redact a revision
curl --request POST \
--url https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact', 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.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/agents/{agentId}/memories/{memoryId}/revisions/{revisionId}/redact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"seq": 123,
"op": "save",
"restoredFromSeq": 123,
"title": "<string>",
"description": "<string>",
"content": "<string>",
"contentTruncated": true,
"authorKind": "user",
"authorUserId": "<string>",
"authorEmail": "<string>",
"conversationId": "<string>",
"turnId": "<string>",
"redactedAt": "2023-11-07T05:31:56Z",
"redactedByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.
Response
The redacted revision
Available options:
save, restore Full content on the single-revision read; a preview on the list (see contentTruncated).
List reads only. True when content was clipped.
Available options:
user, agent