REST API
Human Feedback REST API
Create New Record (Suitable for Live Chatbot)
Endpoint
POST <API_HOST>/feedback-record
Description
Create a new feedback record with nested response, suitable for integrating with live chatbots.
Authentication
Bearer API_KEY
Request Body
-
record
(object, required): Details of the feedback record.feedback_dataset_id
(string, required): ID of the feedback dataset.field_to_value
(object, required): Mapping of dataset field names to corresponding values.
-
response
(object, required): Details of the feedback response.values
(object, required): Key-value pairs representing response data. Keys are question names defined in the dataset.
Example Request
{
"record": {
"field_to_value": {
"prompt": "Hello",
"response_1": "Hello! How can I assist you today?",
"response_2": "Hello! What do you want?"
}
},
"response": {
"values": {
"question_ranking": [
"response_2",
"response_1"
]
}
}
}
Responses
- 200 OK: Successfully created the feedback record.
- 400 Bad Request: If any of the required fields are missing or not in the expected format.
Notes
- The status of the created record is initially set to "submitted".
- Keys in response->values correspond to question names defined in the dataset.
- Keys in record->field_to_value correspond to fields defined in the dataset.
Update Feedback Response (Suitable for Annotation Tools)
Endpoint
POST <API_HOST>/feedback-response
Description
Create a new response under an existing feedback record, suitable for annotation tools where multiple annotations can annotate the same record.
Authentication
Bearer API_KEY
Request Body
feedback_record_id
(string, required): ID of the existing feedback record to update.response
(object, required): Details of the feedback response.status
(string, required): Status of the feedback response, accepted values are: "draft", "submitted", "discarded"values
(object, required): Key-value pairs representing response data.