Skip to main content
POST
/
feedback
/
replace
Feedback Replace
curl --request POST \
  --url https://api.example.com/feedback/replace \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "weave_ref": "<string>",
  "feedback_type": "<string>",
  "payload": {},
  "feedback_id": "<string>",
  "id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
  "creator": "Jane Smith",
  "annotation_ref": "weave:///entity/project/object/name:digest",
  "runnable_ref": "weave:///entity/project/op/name:digest",
  "call_ref": "weave:///entity/project/call/call_id",
  "trigger_ref": "weave:///entity/project/object/name:digest",
  "queue_id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
  "scorer_tags": [
    "<string>"
  ],
  "scorer_tag_reasons": {},
  "scorer_tag_confidences": {},
  "scorer_ratings": {},
  "scorer_rating_reasons": {},
  "scorer_rating_confidences": {},
  "wb_user_id": "<string>"
}
'
import requests

url = "https://api.example.com/feedback/replace"

payload = {
"project_id": "<string>",
"weave_ref": "<string>",
"feedback_type": "<string>",
"payload": {},
"feedback_id": "<string>",
"id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
"creator": "Jane Smith",
"annotation_ref": "weave:///entity/project/object/name:digest",
"runnable_ref": "weave:///entity/project/op/name:digest",
"call_ref": "weave:///entity/project/call/call_id",
"trigger_ref": "weave:///entity/project/object/name:digest",
"queue_id": "018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b",
"scorer_tags": ["<string>"],
"scorer_tag_reasons": {},
"scorer_tag_confidences": {},
"scorer_ratings": {},
"scorer_rating_reasons": {},
"scorer_rating_confidences": {},
"wb_user_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
weave_ref: '<string>',
feedback_type: '<string>',
payload: {},
feedback_id: '<string>',
id: '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
creator: 'Jane Smith',
annotation_ref: 'weave:///entity/project/object/name:digest',
runnable_ref: 'weave:///entity/project/op/name:digest',
call_ref: 'weave:///entity/project/call/call_id',
trigger_ref: 'weave:///entity/project/object/name:digest',
queue_id: '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
scorer_tags: ['<string>'],
scorer_tag_reasons: {},
scorer_tag_confidences: {},
scorer_ratings: {},
scorer_rating_reasons: {},
scorer_rating_confidences: {},
wb_user_id: '<string>'
})
};

fetch('https://api.example.com/feedback/replace', 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.example.com/feedback/replace",
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([
'project_id' => '<string>',
'weave_ref' => '<string>',
'feedback_type' => '<string>',
'payload' => [

],
'feedback_id' => '<string>',
'id' => '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
'creator' => 'Jane Smith',
'annotation_ref' => 'weave:///entity/project/object/name:digest',
'runnable_ref' => 'weave:///entity/project/op/name:digest',
'call_ref' => 'weave:///entity/project/call/call_id',
'trigger_ref' => 'weave:///entity/project/object/name:digest',
'queue_id' => '018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b',
'scorer_tags' => [
'<string>'
],
'scorer_tag_reasons' => [

],
'scorer_tag_confidences' => [

],
'scorer_ratings' => [

],
'scorer_rating_reasons' => [

],
'scorer_rating_confidences' => [

],
'wb_user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.example.com/feedback/replace"

payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"feedback_id\": \"<string>\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"creator\": \"Jane Smith\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"scorer_tag_reasons\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_ratings\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_rating_confidences\": {},\n \"wb_user_id\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
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.example.com/feedback/replace")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"feedback_id\": \"<string>\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"creator\": \"Jane Smith\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"scorer_tag_reasons\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_ratings\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_rating_confidences\": {},\n \"wb_user_id\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/feedback/replace")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"weave_ref\": \"<string>\",\n \"feedback_type\": \"<string>\",\n \"payload\": {},\n \"feedback_id\": \"<string>\",\n \"id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"creator\": \"Jane Smith\",\n \"annotation_ref\": \"weave:///entity/project/object/name:digest\",\n \"runnable_ref\": \"weave:///entity/project/op/name:digest\",\n \"call_ref\": \"weave:///entity/project/call/call_id\",\n \"trigger_ref\": \"weave:///entity/project/object/name:digest\",\n \"queue_id\": \"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b\",\n \"scorer_tags\": [\n \"<string>\"\n ],\n \"scorer_tag_reasons\": {},\n \"scorer_tag_confidences\": {},\n \"scorer_ratings\": {},\n \"scorer_rating_reasons\": {},\n \"scorer_rating_confidences\": {},\n \"wb_user_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "wb_user_id": "<string>",
  "payload": {}
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
project_id
string
required
Example:

"entity/project"

weave_ref
string
required
Example:

"weave:///entity/project/object/name:digest"

feedback_type
string
required
Example:

"custom"

payload
Payload · object
required
Example:
{ "key": "value" }
feedback_id
string
required
id
string | null

If provided by the client, this ID will be used for the feedback row instead of a server-generated one.

Example:

"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b"

creator
string | null
Example:

"Jane Smith"

annotation_ref
string | null
Example:

"weave:///entity/project/object/name:digest"

runnable_ref
string | null
Example:

"weave:///entity/project/op/name:digest"

call_ref
string | null
Example:

"weave:///entity/project/call/call_id"

trigger_ref
string | null
Example:

"weave:///entity/project/object/name:digest"

queue_id
string | null

The annotation queue ID this feedback was created from. References annotation_queues.id. NULL when feedback is created outside of queues.

Example:

"018f1f2a-9c2b-7d3e-b5a1-8c9d2e4f6a7b"

scorer_tags
string[]

Tags applied to the ref by a scorer

Example:
["nsfw", "high-quality"]
scorer_tag_reasons
Scorer Tag Reasons · object

reason text per tag, keyed by tag name

Example:
{ "nsfw": "Contains explicit language" }
scorer_tag_confidences
Scorer Tag Confidences · object

confidence (0-1) per tag, keyed by tag name

Example:
{ "nsfw": 0.92 }
scorer_ratings
Scorer Ratings · object

numeric ratings (0-1) keyed by rating name

Example:
{ "_rating_": 0.87 }
scorer_rating_reasons
Scorer Rating Reasons · object

reason text per rating, keyed by rating name

Example:
{ "_rating_": "very confident response" }
scorer_rating_confidences
Scorer Rating Confidences · object

confidence (0-1) per rating, keyed by rating name

Example:
{ "_rating_": 0.92 }
wb_user_id
string | null

Do not set directly. Server will automatically populate this field.

Response

Successful Response

id
string
required
created_at
string<date-time>
required
wb_user_id
string
required
payload
Payload · object
required