Risk Feedback API
Submit Feedback
Submit feedback for a previously analyzed risk check result.
Request
Request Structure
const response = await fetch('https://safeguardiqapi.xstereotype.com/api/bias/feedback', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Api-Key': 'YOUR_API_KEY' }, body: JSON.stringify({ content_id: "aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c", query_Text: "His handwriting is like a asian boy", is_Liked: true, bias_Label: "race" })});
import requests
response = requests.post( 'https://safeguardiqapi.xstereotype.com/api/bias/feedback', headers={ 'X-Api-Key': 'YOUR_API_KEY' }, json={ 'content_id': 'aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c', 'query_Text': 'His handwriting is like a asian boy', 'is_Liked': True, 'bias_Label': 'race' })
$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://safeguardiqapi.xstereotype.com/api/bias/feedback');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'X-Api-Key: YOUR_API_KEY'));curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'content_id' => 'aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c', 'query_Text' => 'His handwriting is like a asian boy', 'is_Liked' => true, 'bias_Label' => 'race']));
$response = curl_exec($ch);
using (var client = new HttpClient()){ client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR_API_KEY");
var response = await client.PostAsync( "https://safeguardiqapi.xstereotype.com/api/bias/feedback", new StringContent( JsonSerializer.Serialize(new { content_id = "aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c", query_Text = "His handwriting is like a asian boy", is_Liked = true, bias_Label = "race" }), Encoding.UTF8, "application/json" ) );}
client := &http.Client{}requestBody := map[string]interface{}{ "content_id": "aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c", "query_Text": "His handwriting is like a asian boy", "is_Liked": true, "bias_Label": "race",}jsonBody, _ := json.Marshal(requestBody)
req, _ := http.NewRequest("POST", "https://safeguardiqapi.xstereotype.com/api/bias/feedback", bytes.NewBuffer(jsonBody))req.Header.Set("Content-Type", "application/json")req.Header.Set("X-Api-Key", "YOUR_API_KEY")
response, err := client.Do(req)
require 'net/http'require 'json'
uri = URI('https://safeguardiqapi.xstereotype.com/api/bias/feedback')http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri)request['Content-Type'] = 'application/json'request['X-Api-Key'] = 'YOUR_API_KEY'request.body = { content_id: 'aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c', query_Text: 'His handwriting is like a asian boy', is_Liked: true, bias_Label: 'race'}.to_json
response = http.request(request)
HttpClient client = HttpClient.newHttpClient();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://safeguardiqapi.xstereotype.com/api/bias/feedback")) .header("Content-Type", "application/json") .header("X-Api-Key", "YOUR_API_KEY") .POST(HttpRequest.BodyPublishers.ofString( "{\"content_id\": \"aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c\"," + "\"query_Text\": \"His handwriting is like a asian boy\"," + "\"is_Liked\": true," + "\"bias_Label\": \"race\"}" )) .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
{ "content_id": "aa3b8b64-71eb-41d2-8e19-e4f8239bbf5c", "query_Text": "His handwriting is like a asian boy", "is_Liked": true, "bias_Label": "race"}
Headers
Header | Required | Description |
---|---|---|
X-Api-Key | Yes | Your API authentication key |
Content-Type | Yes | Must be application/json |
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
content_id | string | Yes | Unique identifier from the risk check response |
query_Text | string | Yes | Original text that was analyzed |
is_Liked | boolean | Yes | Whether the risk analysis was helpful |
bias_Label | string | Yes | Category of bias that was detected |
Response
"Feedback recorded"
{ "message": "Invalid or missing API key", "isSuccess": false}
{ "message": "Invalid request format", "isSuccess": false}