curl --request GET \
--url https://api.moonbounce.ai/v1/suggestions/{suggestion_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonbounce.ai/v1/suggestions/{suggestion_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonbounce.ai/v1/suggestions/{suggestion_id}', 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.moonbounce.ai/v1/suggestions/{suggestion_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.moonbounce.ai/v1/suggestions/{suggestion_id}"
req, _ := http.NewRequest("GET", 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.get("https://api.moonbounce.ai/v1/suggestions/{suggestion_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/suggestions/{suggestion_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"decision_id": "<string>",
"kind": "question_rewrite",
"target": "structure",
"summary": "<string>",
"environment": "production",
"base": {
"structure_hash": "<string>",
"engine_profile": "<string>"
},
"candidate": {
"structure_hash": "<string>",
"engine_profile": "<string>"
},
"requires": [
"<string>"
],
"candidate_structure": {
"questions": {},
"result": "questions.asks_for_refund",
"attributes": {},
"aggregations": {}
},
"diff": [
{
"op": "replace",
"path": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"evidence": {
"label": "starting_examples",
"frozen_at": "2023-11-07T05:31:56Z",
"by_split": {
"seed": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"train": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
}
},
"noise_rate": 0.5,
"action_mix": {
"before": {},
"after": {},
"on": "<string>",
"n": 1
},
"changed_items": [
{
"evaluation_id": "<string>",
"feedback_id": "<string>",
"split": "seed",
"change": "fix",
"before": {
"answers": {},
"outcome": "<string>",
"value": 123
},
"after": {
"answers": {},
"outcome": "<string>",
"value": 123
}
}
],
"credited_feedback": [
"<string>"
],
"by_source": {
"app_native": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"app_resolution": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"reviewer": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"owner": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"import": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"synthetic_review": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
}
}
},
"preview_id": "<string>",
"generator": {
"name": "<string>",
"version": "<string>",
"model": "<string>"
},
"status": "proposed",
"created_at": "2023-11-07T05:31:56Z",
"status_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"accepted_evaluation_id": "<string>",
"accepted_at": "2023-11-07T05:31:56Z",
"stale": {
"reason": "<string>",
"cases": 2
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}Get a suggestion
Returns one suggestion: the proposed structure change with its diff, candidate structure, evidence and status. Another environment’s suggestion is 404, like another organization’s. On a production key, acceptance is recorded before it is read. stale is set when feedback on a case it was evaluated on changed after its evidence was read; its evidence is never rescored, so preview it again.
curl --request GET \
--url https://api.moonbounce.ai/v1/suggestions/{suggestion_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonbounce.ai/v1/suggestions/{suggestion_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonbounce.ai/v1/suggestions/{suggestion_id}', 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.moonbounce.ai/v1/suggestions/{suggestion_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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.moonbounce.ai/v1/suggestions/{suggestion_id}"
req, _ := http.NewRequest("GET", 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.get("https://api.moonbounce.ai/v1/suggestions/{suggestion_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/suggestions/{suggestion_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"decision_id": "<string>",
"kind": "question_rewrite",
"target": "structure",
"summary": "<string>",
"environment": "production",
"base": {
"structure_hash": "<string>",
"engine_profile": "<string>"
},
"candidate": {
"structure_hash": "<string>",
"engine_profile": "<string>"
},
"requires": [
"<string>"
],
"candidate_structure": {
"questions": {},
"result": "questions.asks_for_refund",
"attributes": {},
"aggregations": {}
},
"diff": [
{
"op": "replace",
"path": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"evidence": {
"label": "starting_examples",
"frozen_at": "2023-11-07T05:31:56Z",
"by_split": {
"seed": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"train": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
}
},
"noise_rate": 0.5,
"action_mix": {
"before": {},
"after": {},
"on": "<string>",
"n": 1
},
"changed_items": [
{
"evaluation_id": "<string>",
"feedback_id": "<string>",
"split": "seed",
"change": "fix",
"before": {
"answers": {},
"outcome": "<string>",
"value": 123
},
"after": {
"answers": {},
"outcome": "<string>",
"value": 123
}
}
],
"credited_feedback": [
"<string>"
],
"by_source": {
"app_native": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"app_resolution": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"reviewer": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"owner": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"import": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
},
"synthetic_review": {
"n": 1,
"fixes": 1,
"breaks": 1,
"base_correct": 1,
"candidate_correct": 1
}
}
},
"preview_id": "<string>",
"generator": {
"name": "<string>",
"version": "<string>",
"model": "<string>"
},
"status": "proposed",
"created_at": "2023-11-07T05:31:56Z",
"status_at": "2023-11-07T05:31:56Z",
"rejection_reason": "<string>",
"accepted_evaluation_id": "<string>",
"accepted_at": "2023-11-07T05:31:56Z",
"stale": {
"reason": "<string>",
"cases": 2
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"reason": "<string>",
"param": "<string>",
"details": {
"issues": [
{
"param": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
}Authorizations
An API key, sent as Authorization: Bearer <key>. Each operation lists the scope its key needs: decisions:evaluate (evaluate and read evaluations), decisions:feedback (your app's feedback) or decisions:develop (everything else, including owner feedback and the review queue). An operation listing no scope takes any scoped key. A key with no scope, or without the operation's, gets 403 INSUFFICIENT_SCOPE.
Path Parameters
^sug_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Response
The suggestion
^sug_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$^[a-z][a-z0-9_.-]{0,127}$question_rewrite: new wording for one question (its question text and criteria). new_question: one new question, added as an input of the aggregation that feeds the result's bands or rules.
question_rewrite, new_question structure The environment of the key that made the call: production or test. Evaluations, feedback, reviews and suggestions are separate per environment; registered structures are shared.
production, test Show child attributes
Show child attributes
Show child attributes
Show child attributes
^sug_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Everything that defines a decision: questions, attribute declarations, aggregations and the result. Names are unique across all three maps.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
^run_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Show child attributes
Show child attributes
proposed, pulled, accepted, rejected, superseded ^evl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Present when feedback on cases this suggestion was evaluated on changed after its evidence was read: an answer it read was changed, withdrawn or corrected, or the owner, a reviewer or a seed judged one of its cases since, or any feedback since marked one's input as broken. Its evidence is as it was then; preview it again before relying on it.
Show child attributes
Show child attributes