- Your frontend collects thumbs up/down or star ratings from end users.
- You want to embed feedback links in emails, Slack messages, or other external channels.
- You need to decouple feedback collection from your backend.
If you are using Agent Server, presigned feedback URLs are generated automatically when you include
feedback_keys in the run request. For that workflow, refer to Collect user feedback for Agent Server runs.Create a presigned feedback token
Usecreate_presigned_feedback_token() / createPresignedFeedbackToken to generate a token for a specific run and feedback key. The returned object includes a url that clients can call to submit feedback:
Set token expiration
Tokens expire after 3 hours by default. Passexpiration to customize this with either a timedelta (relative) or a datetime (absolute):
Constrain feedback values
Passfeedback_config to restrict what values clients can submit. This is useful for enforcing a specific feedback schema (e.g., thumbs up/down, 1–5 stars, or categorical labels):
Create tokens in batch (Python only)
Usecreate_presigned_feedback_tokens (plural) to generate tokens for multiple feedback keys in a single call:
Python
Submit feedback with a presigned URL
Once you have a presigned URL, your frontend code or email client submits feedback by sending aPOST or GET request to it. The URL does not require an API key or authentication because the token provides the authorization.
POST request
UsePOST from your frontend when a user interacts with a feedback control (e.g., clicking a thumbs up button). POST supports score, value, comment, correction, and metadata fields.
GET request
UseGET when embedding a feedback link in an email or Slack message. The user’s click triggers the request. GET supports score, value, comment, and correction as query parameters. metadata is not supported with GET.
Submit feedback using the SDK
You can also submit feedback from a presigned token using the SDK, which is useful for server-side workflows where you received a token URL from another service.List existing tokens
Retrieve all presigned feedback tokens for a run usinglist_presigned_feedback_tokens / listPresignedFeedbackTokens.
Related
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

