curl --request POST \
--url https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"callbackUrl": "<string>"
}
'import requests
url = "https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix"
payload = { "callbackUrl": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callbackUrl: '<string>'})
};
fetch('https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix', 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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix",
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([
'callbackUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix"
payload := strings.NewReader("{\n \"callbackUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callbackUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"status": "idle",
"result": {
"analysis": "<string>",
"changesSummary": [
"<string>"
],
"suggestedPrompt": "<string>",
"currentPrompt": "<string>",
"rubricIssues": [
"<string>"
],
"edits": [
{
"find": "<string>",
"replace": "<string>"
}
]
},
"stale": true,
"stage": "analyzing",
"progress": {
"outputChars": 123,
"promptChars": 123
}
}
}{
"data": {
"status": "idle",
"result": {
"analysis": "<string>",
"changesSummary": [
"<string>"
],
"suggestedPrompt": "<string>",
"currentPrompt": "<string>",
"rubricIssues": [
"<string>"
],
"edits": [
{
"find": "<string>",
"replace": "<string>"
}
]
},
"stale": true,
"stage": "analyzing",
"progress": {
"outputChars": 123,
"promptChars": 123
}
}
}{
"error": "unauthorized"
}{
"error": "not_found"
}Suggest a Fix
Ask for a prompt change that would make a failed test attempt pass.
Preparing a suggestion takes time, especially for agents with long prompts, so this starts the work and waits up to 105 seconds. If the suggestion is ready in that time it is returned directly; if not, the response is status: running and you fetch it with Get Suggested Fix.
Pass wait=0 to skip the wait and always get status: running straight away. This is the recommended pattern, because the request never depends on how long preparation takes.
Asking again while a suggestion is already being prepared joins the one in progress instead of starting another, and a suggestion prepared within the last 10 minutes is returned immediately, so repeating a request after a timeout is instant. Suggestions are available for failed attempts only.
curl --request POST \
--url https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"callbackUrl": "<string>"
}
'import requests
url = "https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix"
payload = { "callbackUrl": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callbackUrl: '<string>'})
};
fetch('https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix', 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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix",
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([
'callbackUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix"
payload := strings.NewReader("{\n \"callbackUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callbackUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/v1/test-suites/{id}/attempts/{attemptId}/suggest-fix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"status": "idle",
"result": {
"analysis": "<string>",
"changesSummary": [
"<string>"
],
"suggestedPrompt": "<string>",
"currentPrompt": "<string>",
"rubricIssues": [
"<string>"
],
"edits": [
{
"find": "<string>",
"replace": "<string>"
}
]
},
"stale": true,
"stage": "analyzing",
"progress": {
"outputChars": 123,
"promptChars": 123
}
}
}{
"data": {
"status": "idle",
"result": {
"analysis": "<string>",
"changesSummary": [
"<string>"
],
"suggestedPrompt": "<string>",
"currentPrompt": "<string>",
"rubricIssues": [
"<string>"
],
"edits": [
{
"find": "<string>",
"replace": "<string>"
}
]
},
"stale": true,
"stage": "analyzing",
"progress": {
"outputChars": 123,
"promptChars": 123
}
}
}{
"error": "unauthorized"
}{
"error": "not_found"
}Authorizations
API key for authentication. Generate API keys from the RevRing dashboard.
Path Parameters
Test suite ID
Test attempt ID, from a test run's attempts
Query Parameters
Set to 0 to return immediately instead of waiting for the suggestion.
0 Body
Optional URL to notify when the suggestion finishes. We POST the completed job there (event test.suggestion.completed, with the same fields as the GET response), so you can stop polling. One delivery attempt, 8 second timeout.
Response
The suggestion, when it was ready in time. The suggestion fields are also present at the top level of data.
A proposed prompt change that would make a failed test pass.
Show child attributes
Show child attributes