Feedback API
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_keyYou'll also need to include your project ID:
x-project-id: your_project_idClick Here to know how to get your own API Key
Submit Feedback
The submitFeedback mutation allows you to submit feedback for a specific flow execution.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
requestId | String | Yes | The unique identifier from the flow execution response |
rating | Int | No | A numeric rating (e.g., 1-5) |
comment | String | No | Text feedback or comments |
metadata | JSON | No | Additional metadata as a JSON object |
Response Fields
| Field | Type | Description |
|---|---|---|
success | Boolean | Indicates if the feedback was submitted successfully |
message | String | A message describing the result |
data | JSON | Optional additional data |
error | String | Error 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!, $rating: Int, $comment: String, $metadata: JSON) { submitFeedback(requestId: $requestId, rating: $rating, comment: $comment, metadata: $metadata) { success message data error } }",
"variables": {
"requestId": "your_request_id",
"rating": 5,
"comment": "Great response!",
"metadata": {
"source": "api",
"user_id": "123"
}
}
}'Response Example
Success Response
{
"data": {
"submitFeedback": {
"success": true,
"message": "Feedback submitted successfully",
"data": null,
"error": null
}
}
}Error Response
{
"data": {
"submitFeedback": {
"success": false,
"message": "Failed to submit feedback",
"data": null,
"error": "Invalid requestId"
}
}
}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
This data helps you identify areas for improvement and track the quality of your AI applications.