Skip to main content
POST
Report back on a query that already ran: what was missing, what was wrong, or that it was exactly right. Feedback feeds retrieval-quality work; it does not change the result of the query it refers to. A successful submission returns 201.
Every HydraDB response carries a request_id in meta, and the same value in the X-Request-ID header. Send that ID back so HydraDB can match your feedback to the exact query it is about: the text queried, what came back, and how long it took.
Query response
Send request_id back exactly as you received it. It must be the UUID from meta.request_id (or the X-Request-ID header). Any other value is rejected with 400. Submit feedback for queries that returned. If the query itself failed, handle the error instead: there is no retrieval to judge, and the fix is in the request, not in the index.

Fields

Ground truth

If you already know the right answer (you are running an evaluation set, or you know which document the user needed), send it. It is a much stronger signal than a comment, because HydraDB can score it without a human reading it.
source_ids is the field that grades retrieval: it tells HydraDB whether the query surfaced those sources, and where they ranked. Send answer or source_ids on its own, or both together. If ground_truth is your only signal, at least one of the two has to carry something; values that are empty or all whitespace are treated as not sent. Duplicate source_ids are collapsed and blank entries dropped, so you do not need to de-duplicate or filter your answer key first. A list that still has one real ID in it is scored on that ID.
Evaluation run
This example skips feedback that exceeds the rate limit and continues the evaluation. Other errors stop the run so invalid credentials or malformed requests are visible.

Behavior notes

Submitting more than once: Each submission is stored separately: a second comment about the same query does not replace the first. Send several as your understanding of a bad result develops, and submit feedback from more than one user on the same query. Rate limit: 100 submissions per minute per organization. Over that, you get 429 with a Retry-After header and a message naming the seconds to wait. It is safe to retry after waiting.

Errors

Each submission is its own row, so the worst case of retrying after a 500 is a duplicate report.
  • Before this: Query: run the query and read meta.request_id
  • Related: Error Responses: the error envelope and retry rules

Authorizations

Authorization
string
header
required

Send your API key as Authorization: Bearer <your_api_key>.

Body

application/json

Send feedback, ground_truth, or both. A request with neither is rejected with 400.

request_id
string<uuid>
required

The request_id from meta of the query this feedback is about. Required: it links the feedback to the query that ran.

Example:

"9d13aef4-02f4-4e73-8c62-4c2601d04f9d"

collection
string

Optional collection scope for this feedback. A collection is scoped to a database, so database must be sent alongside it; sending collection on its own is rejected.

Minimum string length: 1
Example:

"team_docs"

database
string

Owning database. Formerly tenant_id; the tenant_id alias is still accepted (deprecated).

Minimum string length: 1
Example:

"acme_corp"

feedback
string

Free-text comment describing what was right or wrong about the results. Required unless ground_truth is supplied.

Maximum string length: 8000
ground_truth
FeedbackGroundTruth · object

The known right answer: an expected answer, the source_ids that contain it, or both. When sent, feedback becomes optional.

Example:
metadata
object

Free-form key-value context stored alongside the feedback (e.g. agent name, conversation or eval-run ID).

Example:
rating
enum<string>

Optional overall judgement: positive, negative, or neutral. Omit to send a comment with no rating.

Available options:
positive,
negative,
neutral
source
enum<string>

Who is submitting: user (default) or agent.

Available options:
user,
agent
sub_tenant_id
string
deprecated

Deprecated: use collection.

Minimum string length: 1
Example:

"sub_tenant_4567"

tenant_id
string
deprecated

Deprecated: use database.

Minimum string length: 1
Example:

"tenant_1234"

Response

Created

data
FeedbackSubmitResponse · object
Example:
error
HandlerApiError · object | null

Error details on failure, or null on success.

Example:

null

meta
HandlerResponseMeta · object
Example:
success
boolean

Whether the request succeeded.

Example:

true