curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerFeedback": "اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine"
payload = { "ownerFeedback": "اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔" }
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({
ownerFeedback: 'اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔'
})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine', 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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine",
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([
'ownerFeedback' => 'اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔'
]),
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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine"
payload := strings.NewReader("{\n \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine")
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 \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\n}"
response = http.request(request)
puts response.read_body{
"buildId": "e2f42d2b-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"assistantId": "befbca99-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "started"
}{
"message": [
"ownerFeedback must be shorter than or equal to 2000 characters",
"ownerFeedback must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Assistant has no build artifacts to refine",
"error": "Not Found",
"statusCode": 404
}Refine a built assistant's prompt
A finished refine regenerates the assistant’s name and its whole config from the brief, overwriting any edits you made by hand — only the prompt carries forward. It reruns the same rehearse-and-grade rounds as a build, so it takes minutes: poll the build status. Starting one while another build is in flight still returns 200, then surfaces as failed in that poll.
curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ownerFeedback": "اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine"
payload = { "ownerFeedback": "اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔" }
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({
ownerFeedback: 'اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔'
})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine', 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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine",
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([
'ownerFeedback' => 'اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔'
]),
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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine"
payload := strings.NewReader("{\n \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\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.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/builds/{assistantId}/refine")
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 \"ownerFeedback\": \"اپائنٹمنٹ کا وقت اور ڈاکٹر کا نام دو بار دہرائیں۔ اگر مریض کہے کہ وہ ابھی مصروف ہیں تو بحث نہ کریں، معذرت کر کے کال ختم کر دیں۔\"\n}"
response = http.request(request)
puts response.read_body{
"buildId": "e2f42d2b-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"assistantId": "befbca99-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"status": "started"
}{
"message": [
"ownerFeedback must be shorter than or equal to 2000 characters",
"ownerFeedback must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "invalid authorization",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Forbidden resource",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Assistant has no build artifacts to refine",
"error": "Not Found",
"statusCode": 404
}Authorizations
Project API key (sk_api_…).
Path Parameters
The assistantId the original build returned.
Body
What to change, in plain language. Carried into every grading round, so a later automated fix cannot quietly undo it.
2000Replaces the brief the original build stored, for this run and every one after — send the whole brief, not just the fields you are changing. Omit to keep the stored brief.
Show child attributes
Show child attributes
Response
The refine started; nothing here reflects its outcome. A run that cannot start — because a build is already in flight for this assistant — still returns 200, and surfaces as failed in the status poll.
