Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Attach feedback to a run

Explicit or implicit feedback on a run, or a specific span within it the start of the learning loop from production behaviour.

POST/api/v2/runs/{runId}/feedback
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Path parameters
runIdstringrequired

Public run id (run_xxx).

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Idempotency-Keystring

Stable retry key for a mutation. The key is claimed atomically before the handler runs, so concurrent retries execute the side effect at most once. Replaying the key for the same request (same method, path, workspace and JSON body) returns the original response with an X-Idempotent-Replay: true header. Reusing the key for a different request returns 409 with error code idempotency_key_reuse. A duplicate arriving while the first is still in flight waits and then replays; if the first does not finish in time the duplicate gets 409 idempotency_request_in_progress. Keys are retained for 24 hours. Only successful (2xx) responses are stored; a failed request frees the key so it can be retried.

min length 1 · max length 255
Request body
application/json
spanIdstring
max length 80
sourcestring
Allowed:usermodelcode
labelstring
max length 80
ratingnumber
commentstring
max length 4000
metadataobject
Responses
201

Feedback attached.

successbooleanrequired
Allowed:true
dataRunFeedbackrequired
Show properties
idstringrequired

Public feedback id (fbk_xxx).

runIdstringrequired
spanIdstring | nullrequired

The span this targets, or null for the whole run.

sourcestringrequired

Explicit human feedback vs an implicit signal.

Allowed:usermodelcode
labelstring | nullrequired
ratingnumber | nullrequired
commentstring | nullrequired
metadataobject | null
createdAtstring<date-time>required
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/runs/string/feedback' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "spanId": "string",
  "source": "user",
  "label": "string",
  "rating": 0,
  "comment": "string",
  "metadata": {}
}'
Response
{
  "success": true,
  "data": {
    "id": "string",
    "runId": "string",
    "spanId": "string",
    "source": "user",
    "label": "string",
    "rating": 0,
    "comment": "string",
    "metadata": {},
    "createdAt": "2019-08-24T14:15:22Z"
  }
}