Skip to main content
POST
Error

Authorizations

X-API-Key
string
header
required

Body

application/json

Schema used for creating feedback.

key
string
required

The feedback key: the metric, tag, or aspect being scored, for example correctness.

Maximum string length: 180
created_at
string<date-time>

When the feedback was created, as an ISO 8601 timestamp. Defaults to now.

modified_at
string<date-time>

When the feedback was last modified, as an ISO 8601 timestamp. Defaults to now.

score

The numeric or boolean score. Numbers must be between -99999.9999 and 99999.9999 with at most 4 decimal places.

value

A non-numeric value, such as a category label or a JSON object. Dropped if it exceeds the feedback size limit.

comment
string | null

A free-text comment explaining the feedback. Truncated at the feedback size limit.

correction

The corrected output for the run, as a string or a JSON object. Dropped if it exceeds the feedback size limit.

feedback_group_id
string<uuid> | null

Groups feedback written together, such as one comparison in a pairwise experiment.

comparative_experiment_id
string<uuid> | null

The ID of the comparative (pairwise) experiment this feedback was written for.

run_id
string<uuid> | null

The ID of the run the feedback is about. Omit it for feedback on a whole tracing project or a thread.

session_id
string<uuid> | null

Required unless the feedback is addressed by address. The ID of the tracing project (session) the feedback belongs to.

address
string

Addresses the tracing project through an Agent environment, as lrn:agents/{id}/environments/{environment}, instead of session_id. The id is 1 to 63 lowercase ASCII letters, digits, or hyphens, starting with a letter and ending with a letter or digit. The environment is local, development, staging, or production, matched case-insensitively. Never combined with session_id. The Agent and the environment must already exist; sending feedback does not create them. Self-hosted deployments need LangSmith v0.18 or later.

Example:

"lrn:agents/support-agent/environments/production"

trace_id
string<uuid> | null

The ID of the trace that contains run_id. With session_id and start_time, it lets the server write run feedback without looking the run up.

start_time
string<date-time> | null

The start time of run_id, as an ISO 8601 timestamp. With session_id and trace_id, it lets the server write run feedback without looking the run up.

feedback_thread_id
string | null

The ID of the thread the feedback is about. Requires session_id (or address) and cannot be combined with run_id.

extend_trace_retention
boolean
default:true

Whether writing this feedback may upgrade the trace to extended retention. Defaults to true.

id
string<uuid>

The ID to give the feedback. Defaults to a new random UUID.

feedback_source
AppFeedbackSource · object

Feedback from the LangChainPlus App.

feedback_config
FeedbackConfig · object | null

The scale the score is checked against. If the feedback key already has a feedback config, this must match it exactly or the request is rejected; if it has none, this becomes the key's feedback config.

feedback_config_id
string<uuid> | null

The ID of the feedback config this feedback was written against. It must be a feedback config for this feedback key in the same workspace, or the feedback is rejected. It doesn't change how the score is checked; feedback_config does that. If omitted, the server may record the key's enforced feedback config, or the one created for the key by this request.

error
boolean | null
deprecated

Deprecated. Use extra.error instead. If both values are provided, error takes precedence.

extra
Extra · object | null

Additional metadata to store with the feedback, as a JSON object.

Response

Successful Response

Schema for getting feedback.

key
string
required

The feedback key: the metric, tag, or aspect being scored, for example correctness.

id
string<uuid>
required
created_at
string<date-time>

When the feedback was created, as an ISO 8601 timestamp. Defaults to now.

modified_at
string<date-time>

When the feedback was last modified, as an ISO 8601 timestamp. Defaults to now.

score

The numeric or boolean score. Numbers must be between -99999.9999 and 99999.9999 with at most 4 decimal places.

value

A non-numeric value, such as a category label or a JSON object. Dropped if it exceeds the feedback size limit.

comment
string | null

A free-text comment explaining the feedback. Truncated at the feedback size limit.

correction

The corrected output for the run, as a string or a JSON object. Dropped if it exceeds the feedback size limit.

feedback_group_id
string<uuid> | null

Groups feedback written together, such as one comparison in a pairwise experiment.

comparative_experiment_id
string<uuid> | null

The ID of the comparative (pairwise) experiment this feedback was written for.

run_id
string<uuid> | null

The ID of the run the feedback is about. Omit it for feedback on a whole tracing project or a thread.

session_id
string<uuid> | null

The ID of the tracing project (session) the feedback belongs to.

trace_id
string<uuid> | null
start_time
string<date-time> | null
is_root
boolean
default:false
feedback_source
FeedbackSource · object | null

The feedback source loaded from the database.

extra
Extra · object | null
feedback_thread_id
string | null