Create observations
curl --request POST \
--url https://api.correl8.ai/v1/project/{project_id}/observations/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"user_sentiment": "negative",
"observations": [
{
"title": "Enter key did not submit message",
"description": "The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field."
}
]
}
'import requests
url = "https://api.correl8.ai/v1/project/{project_id}/observations/"
payload = {
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"user_sentiment": "negative",
"observations": [
{
"title": "Enter key did not submit message",
"description": "The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field."
}
]
}
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',
user_sentiment: 'negative',
observations: [
{
title: 'Enter key did not submit message',
description: 'The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.'
}
]
})
};
fetch('https://api.correl8.ai/v1/project/{project_id}/observations/', 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}/observations/",
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',
'user_sentiment' => 'negative',
'observations' => [
[
'title' => 'Enter key did not submit message',
'description' => 'The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.'
]
]
]),
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}/observations/"
payload := strings.NewReader("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\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}/observations/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.correl8.ai/v1/project/{project_id}/observations/")
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 \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "<string>",
"interaction_id": "<string>",
"source": "<string>",
"title": "<string>",
"description": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"config": {}
}
]
}
]
}{
"detail": "<unknown>"
}Endpoints
Create observations
Post one or more observations to a project. Same batch payload as the MCP post_observations tool: set user_id, interaction_id, and user_sentiment once, then list each observation in observations.
POST
/
v1
/
project
/
{project_id}
/
observations
/
Create observations
curl --request POST \
--url https://api.correl8.ai/v1/project/{project_id}/observations/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"user_sentiment": "negative",
"observations": [
{
"title": "Enter key did not submit message",
"description": "The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field."
}
]
}
'import requests
url = "https://api.correl8.ai/v1/project/{project_id}/observations/"
payload = {
"user_id": "user-42",
"interaction_id": "conv_9f3a2b1c",
"user_sentiment": "negative",
"observations": [
{
"title": "Enter key did not submit message",
"description": "The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field."
}
]
}
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',
user_sentiment: 'negative',
observations: [
{
title: 'Enter key did not submit message',
description: 'The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.'
}
]
})
};
fetch('https://api.correl8.ai/v1/project/{project_id}/observations/', 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}/observations/",
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',
'user_sentiment' => 'negative',
'observations' => [
[
'title' => 'Enter key did not submit message',
'description' => 'The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.'
]
]
]),
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}/observations/"
payload := strings.NewReader("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\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}/observations/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"user-42\",\n \"interaction_id\": \"conv_9f3a2b1c\",\n \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.correl8.ai/v1/project/{project_id}/observations/")
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 \"user_sentiment\": \"negative\",\n \"observations\": [\n {\n \"title\": \"Enter key did not submit message\",\n \"description\": \"The user pressed Enter in the chat composer expecting the message to send. The message stayed in the input field.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "<string>",
"interaction_id": "<string>",
"source": "<string>",
"title": "<string>",
"description": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"config": {}
}
]
}
]
}{
"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
Body
application/json
Your identifier for the end user
Maximum string length:
512Your identifier for the conversation thread
Maximum string length:
512Sentiment label applied to all items. See Sentiment docs.
Available options:
very negative, negative, neutral, positive, very positive One or more observations (max 50 per request). Do not nest user_id, interaction_id, user_sentiment, or observed_at inside items.
Required array length:
1 - 50 elementsShow child attributes
Show child attributes
Optional timestamp applied to all items. Defaults to server time if omitted.
Response
Observations created
Show child attributes
Show child attributes
⌘I