Skip to main content

Feedback API

Submit corrections to improve agent behavior over time. You describe what the agent did wrong and what it should do instead. The agent stores these corrections in memory and uses them to adjust future responses. Use feedback when your agent produces output that is technically correct but misses the mark on style, tone, length, or format. Over time, corrections accumulate and the agent adapts its behavior without you needing to rewrite its system prompt.
All feedback endpoints require session authentication. Feedback entries are scoped to the authenticated user.

Submit feedback

POST /api/feedback
Record a correction for agent behavior. You must provide both the original behavior you want to correct and the desired behavior.

Request body

FieldTypeRequiredDescription
messagestringYesWhat the agent did wrong
correctionstringYesWhat the agent should do instead
categorystringNoFeedback category. One of tone, accuracy, format, behavior, general. Defaults to general.
typestringNoFeedback type. Defaults to correction.
agentIdstringNoID of the agent being corrected. Defaults to default.

Example request

curl -X POST https://agentbot.sh/api/feedback \
  -H "Content-Type: application/json" \
  -b "session=YOUR_SESSION_COOKIE" \
  -d '{
    "message": "The agent sent a tweet with 5 emojis and 3 hashtags",
    "correction": "No emojis. No hashtags in body. Short punchy sentences. One idea per tweet.",
    "category": "format",
    "agentId": "agent_123"
  }'

Response

{
  "success": true,
  "message": "Feedback recorded. Agent will learn from this correction.",
  "feedback": {
    "timestamp": "2026-04-10T00:00:00.000Z",
    "type": "correction",
    "original": "The agent sent a tweet with 5 emojis and 3 hashtags",
    "correction": "No emojis. No hashtags in body. Short punchy sentences. One idea per tweet.",
    "category": "format",
    "userId": "user_abc",
    "agentId": "agent_123"
  }
}
FieldTypeDescription
successbooleanWhether the feedback was saved
messagestringConfirmation message
feedback.timestampstringISO 8601 timestamp of when the feedback was recorded
feedback.typestringFeedback type
feedback.originalstringThe original agent behavior described
feedback.correctionstringThe desired behavior
feedback.categorystringFeedback category
feedback.userIdstringID of the user who submitted the feedback
feedback.agentIdstringID of the agent being corrected

Errors

CodeDescription
400message and correction are required
401Unauthorized
500Internal server error

Get feedback history

GET /api/feedback
Retrieve the most recent feedback entries for the authenticated user. Returns up to 50 entries, ordered by most recent first.

Example request

curl -X GET https://agentbot.sh/api/feedback \
  -b "session=YOUR_SESSION_COOKIE"

Response

{
  "feedbacks": [
    {
      "timestamp": "2026-04-10T00:00:00.000Z",
      "type": "correction",
      "original": "The agent sent a tweet with 5 emojis and 3 hashtags",
      "correction": "No emojis. No hashtags in body. Short punchy sentences.",
      "category": "format",
      "userId": "user_abc",
      "agentId": "agent_123"
    }
  ]
}
FieldTypeDescription
feedbacksarrayList of feedback entries
feedbacks[].timestampstringISO 8601 timestamp
feedbacks[].typestringFeedback type
feedbacks[].originalstringWhat the agent did wrong
feedbacks[].correctionstringWhat the agent should do instead
feedbacks[].categorystringOne of tone, accuracy, format, behavior, general
feedbacks[].userIdstringUser who submitted the feedback
feedbacks[].agentIdstringAgent the feedback applies to

Errors

CodeDescription
401Unauthorized

Categories

CategoryDescription
toneToo formal, too casual, wrong voice
accuracyWrong facts, missing sources
formatWrong structure, too long, too short
behaviorDid the wrong thing, missed context
generalOther feedback