Feedback resource
The mappa.feedback resource provides one method: create().
create()​
Submit feedback for either a report or a job.
await mappa.feedback.create({
reportId: "report_abc123",
rating: "thumbs_up",
comment: "Helpful analysis",
});
Parameters​
{
reportId?: string;
jobId?: string;
matchingAnalysisId?: string;
rating: "thumbs_up" | "thumbs_down";
comment?: string;
corrections?: Array<{
path: string;
expected?: unknown;
observed?: unknown;
}>;
idempotencyKey?: string;
requestId?: string;
signal?: AbortSignal;
}
Returns​
{
id: string;
createdAt: string;
target: {
reportId?: string;
jobId?: string;
matchingAnalysisId?: string;
};
rating: "thumbs_up" | "thumbs_down";
comment?: string;
credits: {
eligible: boolean;
reason?: string;
discountApplied: number;
netUsed: number;
};
}
Examples​
Feedback by report ID​
await mappa.feedback.create({
reportId: "report_abc123",
rating: "thumbs_down",
comment: "Missed key points in the closing section",
});
Feedback by job ID​
await mappa.feedback.create({
jobId: "job_abc123",
rating: "thumbs_up",
});
Feedback with corrections​
await mappa.feedback.create({
reportId: "report_abc123",
rating: "thumbs_down",
comment: "Sentiment classification is incorrect",
corrections: [
{
path: "$.insights.sentiment",
expected: "positive",
observed: "neutral",
},
],
});
Best practices​
- Submit feedback shortly after review.
- Use idempotency keys in retry flows.
- Include
correctionswhen you can pinpoint wrong fields.
await mappa.feedback.create({
reportId: "report_abc123",
rating: "thumbs_up",
idempotencyKey: "feedback:report_abc123:user_42",
});
Type reference​
import type { FeedbackReceipt } from "@mappa-ai/mappa-node";