Post a research study answer
curl --request POST \
--url https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"answer": "The user said they could not find the invite button and expected it on the team settings page."
}
'import requests
url = "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/"
payload = {
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"answer": "The user said they could not find the invite button and expected it on the team settings page."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user-42',
interaction_id: 'conv_9f3a2b1c',
answer: 'The user said they could not find the invite button and expected it on the team settings page.'
})
};
fetch('https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'user-42',
'interaction_id' => 'conv_9f3a2b1c',
'answer' => 'The user said they could not find the invite button and expected it on the team settings page.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/"
payload := strings.NewReader("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"posted_at": "2023-11-07T05:31:56Z"
}{
"detail": "<unknown>"
}{
"detail": "<unknown>"
}Endpoints
Post a research study answer
Post one answer for an active research study. Same payload as the MCP post_research_answer tool, except the study is identified by UUID in the path (MCP uses a 0-based study_index in the studies array returned by get_active_studies). One answer per user per study.
POST
/
v1
/
project
/
{project_id}
/
research
/
studies
/
{study_id}
/
answers
/
Post a research study answer
curl --request POST \
--url https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"answer": "The user said they could not find the invite button and expected it on the team settings page."
}
'import requests
url = "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/"
payload = {
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"answer": "The user said they could not find the invite button and expected it on the team settings page."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'user-42',
interaction_id: 'conv_9f3a2b1c',
answer: 'The user said they could not find the invite button and expected it on the team settings page.'
})
};
fetch('https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 'user-42',
'interaction_id' => 'conv_9f3a2b1c',
'answer' => 'The user said they could not find the invite button and expected it on the team settings page.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/"
payload := strings.NewReader("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.correl8.ai/v1/project/{project_id}/research/studies/{study_id}/answers/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"answer\": \"The user said they could not find the invite button and expected it on the team settings page.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"posted_at": "2023-11-07T05:31:56Z"
}{
"detail": "<unknown>"
}{
"detail": "<unknown>"
}Authorizations
Project API key prefixed with ApiKey, e.g. Authorization: ApiKey c8.xxx. Alternatively use header X-Api-Key: c8.xxx.
Path Parameters
Project UUID
Research study UUID (from the Correl8 app when the study was created)
Body
application/json
⌘I