DocsFeedback API

Feedback API

img_9.png The Feedback API allows you to collect user feedback from any flows, specifically GraphQL APIs. This enables you to gather ratings, comments, and metadata about API responses, which can be viewed in the Reports section to improve your AI applications.

Overview

When executing flows via GraphQL API, you receive a requestId in the response. This requestId can be used to submit feedback about the flow execution, helping you track user satisfaction and identify areas for improvement.

Getting the Request ID

After executing a flow via GraphQL API, you’ll receive a requestId in the response. This unique identifier is used to associate feedback with a specific flow execution.

{
  "data": {
    "executeWorkflow": {
      "requestId": "your_request_id",
      "status": "success",
      "result": { ... }
    }
  }
}

Authentication

To submit feedback, you’ll need to include your API key in the request headers:

Authorization: Bearer your_api_key

You’ll also need to include your project ID:

x-project-id: your_project_id

Click Here to know how to get your own API Key

Submit Feedback

The submitFeedback mutation allows you to submit feedback for one or more flow executions.

Existing projects get these fields after their next deployment. Redeploy any flow in your project to enable them.

Request Parameters

ParameterTypeRequiredDescription
requestIdStringOne of requestId / requestIdsThe requestId returned by a flow execution.
requestIds[String!]One of requestId / requestIdsUp to 25 request IDs. The same feedback is attached to each one. Duplicates are ignored.
ratingIntNoWhole-number rating. We recommend a 1–5 scale; values from 0 to 255 are accepted.
weightFloatNoNumber between 0 and 1 indicating how much this feedback should count (e.g. confidence or importance).
commentStringNoFree-text feedback, up to 5,000 characters.
metadataJSONNoAny extra data as a JSON object (not an array or string). Max 16 KB, nesting depth up to 5, up to 100 keys in total.
  • Provide exactly one of requestId or requestIds. Sending both, or neither, returns an error.
  • Include at least one of rating, weight, comment or metadata.
  • Invalid input is rejected and nothing is stored. The error field lists every problem at once, separated by ”; ”.

Response Fields

FieldTypeDescription
successBooleanIndicates if the feedback was submitted successfully
messageStringA message describing the result
dataJSONContains feedbackId on every successful submission, plus results (a per-request outcome list) when requestIds is used
errorStringError message if submission failed

Code Examples

curl -X POST \
  https://sandbox566-acridxylophone.lamatic.dev/graphql \
  -H "Authorization: Bearer ${LAMATIC_API_KEY}" \
  -H 'Content-Type: application/json' \
  -H 'x-project-id: 93628611-e45c-4895-a807-7e6f950b295c' \
  -d '{
    "query": "mutation SubmitFeedback($requestId: String, $requestIds: [String!], $rating: Int, $weight: Float, $comment: String, $metadata: JSON) { submitFeedback(requestId: $requestId, requestIds: $requestIds, rating: $rating, weight: $weight, comment: $comment, metadata: $metadata) { success message data error } }",
    "variables": {
      "requestId": "your_request_id",
      "rating": 5,
      "weight": 0.8,
      "comment": "Great response!",
      "metadata": {
        "source": "api",
        "user_id": "123"
      }
    }
  }'

Feedback for multiple requests

Use requestIds to give one piece of feedback to several requests that were made together. For example, two calls that together answered one user question.

curl -X POST \
  https://sandbox566-acridxylophone.lamatic.dev/graphql \
  -H "Authorization: Bearer ${LAMATIC_API_KEY}" \
  -H 'Content-Type: application/json' \
  -H 'x-project-id: 93628611-e45c-4895-a807-7e6f950b295c' \
  -d '{
    "query": "mutation SubmitFeedback($requestId: String, $requestIds: [String!], $rating: Int, $weight: Float, $comment: String, $metadata: JSON) { submitFeedback(requestId: $requestId, requestIds: $requestIds, rating: $rating, weight: $weight, comment: $comment, metadata: $metadata) { success message data error } }",
    "variables": {
      "requestIds": ["request_id_1", "request_id_2"],
      "rating": 4,
      "weight": 0.8,
      "comment": "Good together"
    }
  }'

The feedback is stored on each request, and all copies share one feedbackId. You can send up to 25 request IDs per call.

Response Examples

Success (single request)

{
  "data": {
    "submitFeedback": {
      "success": true,
      "message": "Feedback submitted successfully",
      "data": {
        "feedbackId": "6f1c...-uuid",
        "requestId": "your_request_id",
        "rating": 5,
        "weight": 0.8,
        "comment": "Great response!",
        "timestamp": "2026-10-13T10:00:00.000Z"
      },
      "error": null
    }
  }
}

Success (multiple requests)

{
  "data": {
    "submitFeedback": {
      "success": true,
      "message": "Feedback submitted successfully",
      "data": {
        "feedbackId": "6f1c...-uuid",
        "requestIds": ["request_id_1", "request_id_2"],
        "rating": 4,
        "weight": 0.8,
        "comment": "Good together",
        "timestamp": "...",
        "results": [
          { "requestId": "request_id_1", "success": true },
          { "requestId": "request_id_2", "success": true }
        ]
      },
      "error": null
    }
  }
}

Partial failure (multiple requests)

If feedback can’t be stored for some of the requests, success is false and message reads, for example, “Feedback submitted for 1 of 2 requests”. data.results marks each request with success, and with an error for the ones that failed. Feedback for the requests that succeeded is still stored.

Validation error

{
  "data": {
    "submitFeedback": {
      "success": false,
      "message": "Invalid feedback input",
      "data": null,
      "error": "rating must be an integer between 0 and 255; weight must be a number between 0 and 1"
    }
  }
}

Viewing Feedback

After submitting feedback, you can view all collected feedback in the Reports section of your Lamatic dashboard. The reports provide insights into:

  • User ratings and satisfaction levels
  • Comments and textual feedback
  • Metadata associated with feedback submissions
  • Trends and patterns over time

Reports and the Logs view are based on ratings. Feedback submitted without a rating is stored but may not appear there.

This data helps you identify areas for improvement and track the quality of your AI applications.

Was this page useful?

Subscribe to updates