> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://humanloop.com/docs/v4/api/projects/create-feedback-type/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/_mcp/server. # Create Feedback Type POST https://api.humanloop.com/v4/projects/{id}/feedback-types Content-Type: application/json Reference: https://humanloop.com/docs/v4/api/projects/create-feedback-type ## Authentication - `X-API-KEY` header (required) — API Key authentication via header ## Request ### Path parameters - `id` (string, required) — String ID of project. Starts with `pr_`. ### Body (application/json) This endpoint expects an object. - `type` (string, required) — The type of feedback to update. - `class` (enum, required) — The data type associated to this feedback type; whether it is a 'text'/'select'/'multi_select'. - Allowed values: `select`, `multi_select`, `text`, `number` - `values` (list of FeedbackLabelRequest, optional) — The feedback values to be available. This field should only be populated when updating a 'select' or 'multi_select' feedback class. ## Response ### 201 Successful Response - `type` (FeedbackTypeModelType, required) — The type of feedback. The default feedback types available are 'rating', 'action', 'issue', 'correction', and 'comment'. - `values` (list of CategoricalFeedbackLabel, optional) — The allowed values for categorical feedback types. Not populated for `correction` and `comment`. ## Errors ### 422 Projects Create Feedback Type Request Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### FeedbackLabelRequest - `value` (string, required) - `sentiment` (enum, optional) — How a label should be treated in calculating Version performance. Used by a File's PAPV (Positive Action Per View) metric. - Allowed values: `positive`, `negative`, `neutral`, `unset` ### FeedbackTypeModelType The type of feedback. The default feedback types available are 'rating', 'action', 'issue', 'correction', and 'comment'. ### CategoricalFeedbackLabel - `value` (string, required) - `sentiment` (enum, required) — Whether the feedback sentiment is positive or negative. - Allowed values: `positive`, `negative`, `neutral`, `unset` ### ValidationError - `loc` (list of ValidationErrorLocItem, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItem ## Examples **Request** ```json { "type": "type", "class": "select" } ``` **Response** ```json { "type": "rating", "values": [ { "value": "value", "sentiment": "positive" } ] } ``` **SDK Code** ```python import requests url = "https://api.humanloop.com/v4/projects/id/feedback-types" payload = { "type": "type", "class": "select" } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.humanloop.com/v4/projects/id/feedback-types'; const options = { method: 'POST', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"type":"type","class":"select"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.humanloop.com/v4/projects/id/feedback-types" payload := strings.NewReader("{\n \"type\": \"type\",\n \"class\": \"select\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.humanloop.com/v4/projects/id/feedback-types") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"type\": \"type\",\n \"class\": \"select\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.humanloop.com/v4/projects/id/feedback-types") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"type\": \"type\",\n \"class\": \"select\"\n}") .asString(); ``` ```php request('POST', 'https://api.humanloop.com/v4/projects/id/feedback-types', [ 'body' => '{ "type": "type", "class": "select" }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.humanloop.com/v4/projects/id/feedback-types"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"type\": \"type\",\n \"class\": \"select\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "type": "type", "class": "select" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v4/projects/id/feedback-types")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```