Skip to main content
POST
/
spans
/
{span_id}
/
feedback
cURL
curl --request POST \
  --url https://api.opper.ai/v2/spans/{span_id}/feedback \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "score": 0.5
}'
{
  "span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "score": 123,
  "example_saved": true,
  "comment": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

span_id
string<uuid>
required

The ID of the span to provide feedback on

Body

application/json
score
number
required

Feedback score (0.0=negative, 1.0=positive)

Required range: 0 <= x <= 1
Examples:

1

0

comment
string | null

Optional comment explaining the feedback

Example:

"Great output, exactly what I needed"

save_to_dataset
boolean | null

Force save to dataset (True=force save, False=never save, None=use auto-save config)

Response

Successful Response

span_id
string<uuid>
required

The ID of the span

score
number
required

The feedback score that was submitted

example_saved
boolean
required

Whether the example was saved to the dataset

comment
string | null

The feedback comment that was submitted