curl --request POST \
--url https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"current_prompt": {
"segments": [
{
"text": "<string>",
"type": "text"
}
]
},
"instruction": "<string>",
"inputs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"saved_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/"
payload = {
"current_prompt": { "segments": [
{
"text": "<string>",
"type": "text"
}
] },
"instruction": "<string>",
"inputs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"saved_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
current_prompt: {segments: [{text: '<string>', type: 'text'}]},
instruction: '<string>',
inputs: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'}],
saved_agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/', 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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/",
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([
'current_prompt' => [
'segments' => [
[
'text' => '<string>',
'type' => 'text'
]
]
],
'instruction' => '<string>',
'inputs' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
]
],
'saved_agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/"
payload := strings.NewReader("{\n \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/")
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 \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Revise an agent prompt from a natural-language change, streaming the work
The streaming form of the revision: the same full revised prompt and one-sentence summary, sent as Server-Sent Events. The first frame is turn, carrying the edit_id a Stop is sent to; then a step frame for each thing the assistant actually did (read_feedback when saved_agent_id names an agent whose complaints to read, rewrite_prompt for the model call, finish with the line counts once any thread record has committed), each with its measured duration; then one result frame with the revision as the plain route returns it. Send conversation_id to record the revision as a turn on one of your agent builder threads before the result frame.
Failures arrive as an error frame, because the stream has already answered 200: reason limit or paused when the workspace’s daily AI Assistant allowance refused the revision, not_found for the thread the plain route answers 404 to, stopped when the caller stopped it, and no reason for anything else. Counts against the allowance; a stopped or failed revision gives its turn back.
Closing the connection does not stop the revision; the Stop route does. Requires a signed-in person; the plain route serves API keys.
curl --request POST \
--url https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"current_prompt": {
"segments": [
{
"text": "<string>",
"type": "text"
}
]
},
"instruction": "<string>",
"inputs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"saved_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/"
payload = {
"current_prompt": { "segments": [
{
"text": "<string>",
"type": "text"
}
] },
"instruction": "<string>",
"inputs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"saved_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
current_prompt: {segments: [{text: '<string>', type: 'text'}]},
instruction: '<string>',
inputs: [{id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'}],
saved_agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/', 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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/",
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([
'current_prompt' => [
'segments' => [
[
'text' => '<string>',
'type' => 'text'
]
]
],
'instruction' => '<string>',
'inputs' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>'
]
],
'saved_agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/"
payload := strings.NewReader("{\n \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/table-enrichments/saved-agents/prompt/edit/stream/")
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 \"current_prompt\": {\n \"segments\": [\n {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n ]\n },\n \"instruction\": \"<string>\",\n \"inputs\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\"\n }\n ],\n \"saved_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
One of your agent builder threads to record this revision on, as a turn with its line counts. Leave it out to record nothing.
Body
A natural-language change to make to an existing agent prompt.
A saved agent's prompt: literal text with references between the runs.
The same convention every other stored prompt in the product uses
(EnrichmentPromptTemplate for columns, template segments for
sequences): identity-keyed segments, so renaming what a reference points
at never rewrites the prompt. Structurally parallel to the enrichment
template rather than importing it — an agent prompt references INPUTS,
an enrichment prompt references COLUMNS, and the import hierarchy keeps
the two domains apart.
Show child attributes
Show child attributes
1 - 400020Show child attributes
Show child attributes
Revise in the light of what people said was wrong with this agent's real results. The complaints are read server-side from stored feedback, so the client cannot put words in their mouths.
Response
A stream of Server-Sent Events; the final result frame's data is the revised prompt.
The revised prompt and a one-line account of what changed.
Was this page helpful?