curl --request PUT \
--url https://api.honeyhive.ai/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": {
"rating": 5
},
"metrics": {
"num_words": 2
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"config": {
"template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
]
},
"user_properties": {
"user_id": "691b1f94-d38c-4e92-b051-5e03fee9ff86"
},
"duration": 42
}
'import requests
url = "https://api.honeyhive.ai/events"
payload = {
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": { "rating": 5 },
"metrics": { "num_words": 2 },
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"config": { "template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
] },
"user_properties": { "user_id": "691b1f94-d38c-4e92-b051-5e03fee9ff86" },
"duration": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_id: '7f22137a-6911-4ed3-bc36-110f1dde6b66',
metadata: {cost: 0.00008, completion_tokens: 23, prompt_tokens: 35, total_tokens: 58},
feedback: {rating: 5},
metrics: {num_words: 2},
outputs: {role: 'assistant', content: 'Hello world'},
config: {template: [{role: 'system', content: 'Hello, {{ name }}!'}]},
user_properties: {user_id: '691b1f94-d38c-4e92-b051-5e03fee9ff86'},
duration: 42
})
};
fetch('https://api.honeyhive.ai/events', 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.honeyhive.ai/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'event_id' => '7f22137a-6911-4ed3-bc36-110f1dde6b66',
'metadata' => [
'cost' => 0.00008,
'completion_tokens' => 23,
'prompt_tokens' => 35,
'total_tokens' => 58
],
'feedback' => [
'rating' => 5
],
'metrics' => [
'num_words' => 2
],
'outputs' => [
'role' => 'assistant',
'content' => 'Hello world'
],
'config' => [
'template' => [
[
'role' => 'system',
'content' => 'Hello, {{ name }}!'
]
]
],
'user_properties' => [
'user_id' => '691b1f94-d38c-4e92-b051-5e03fee9ff86'
],
'duration' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.honeyhive.ai/events"
payload := strings.NewReader("{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.honeyhive.ai/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}"
response = http.request(request)
puts response.read_bodyUpdate an event (deprecated)
Deprecated. Use PUT /v1/events/{event_id} instead.
curl --request PUT \
--url https://api.honeyhive.ai/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": {
"rating": 5
},
"metrics": {
"num_words": 2
},
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"config": {
"template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
]
},
"user_properties": {
"user_id": "691b1f94-d38c-4e92-b051-5e03fee9ff86"
},
"duration": 42
}
'import requests
url = "https://api.honeyhive.ai/events"
payload = {
"event_id": "7f22137a-6911-4ed3-bc36-110f1dde6b66",
"metadata": {
"cost": 0.00008,
"completion_tokens": 23,
"prompt_tokens": 35,
"total_tokens": 58
},
"feedback": { "rating": 5 },
"metrics": { "num_words": 2 },
"outputs": {
"role": "assistant",
"content": "Hello world"
},
"config": { "template": [
{
"role": "system",
"content": "Hello, {{ name }}!"
}
] },
"user_properties": { "user_id": "691b1f94-d38c-4e92-b051-5e03fee9ff86" },
"duration": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event_id: '7f22137a-6911-4ed3-bc36-110f1dde6b66',
metadata: {cost: 0.00008, completion_tokens: 23, prompt_tokens: 35, total_tokens: 58},
feedback: {rating: 5},
metrics: {num_words: 2},
outputs: {role: 'assistant', content: 'Hello world'},
config: {template: [{role: 'system', content: 'Hello, {{ name }}!'}]},
user_properties: {user_id: '691b1f94-d38c-4e92-b051-5e03fee9ff86'},
duration: 42
})
};
fetch('https://api.honeyhive.ai/events', 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.honeyhive.ai/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'event_id' => '7f22137a-6911-4ed3-bc36-110f1dde6b66',
'metadata' => [
'cost' => 0.00008,
'completion_tokens' => 23,
'prompt_tokens' => 35,
'total_tokens' => 58
],
'feedback' => [
'rating' => 5
],
'metrics' => [
'num_words' => 2
],
'outputs' => [
'role' => 'assistant',
'content' => 'Hello world'
],
'config' => [
'template' => [
[
'role' => 'system',
'content' => 'Hello, {{ name }}!'
]
]
],
'user_properties' => [
'user_id' => '691b1f94-d38c-4e92-b051-5e03fee9ff86'
],
'duration' => 42
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.honeyhive.ai/events"
payload := strings.NewReader("{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.honeyhive.ai/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event_id\": \"7f22137a-6911-4ed3-bc36-110f1dde6b66\",\n \"metadata\": {\n \"cost\": 0.00008,\n \"completion_tokens\": 23,\n \"prompt_tokens\": 35,\n \"total_tokens\": 58\n },\n \"feedback\": {\n \"rating\": 5\n },\n \"metrics\": {\n \"num_words\": 2\n },\n \"outputs\": {\n \"role\": \"assistant\",\n \"content\": \"Hello world\"\n },\n \"config\": {\n \"template\": [\n {\n \"role\": \"system\",\n \"content\": \"Hello, {{ name }}!\"\n }\n ]\n },\n \"user_properties\": {\n \"user_id\": \"691b1f94-d38c-4e92-b051-5e03fee9ff86\"\n },\n \"duration\": 42\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request to update an existing event (deprecated — use PUT /v1/events/{event_id})
Event ID to update
Metadata fields to merge into the event
Show child attributes
Show child attributes
Feedback fields to merge into the event
Show child attributes
Show child attributes
Metric values to merge into the event
Show child attributes
Show child attributes
Output data to replace on the event (accepts objects, strings, arrays, or scalars)
Configuration fields to merge into the event
Show child attributes
Show child attributes
User properties to merge into the event
Show child attributes
Show child attributes
Event duration in milliseconds
Unix timestamp in milliseconds for event end
IDs of child events to set (must be non-empty; an empty array is ignored)
Response
Event updated
Was this page helpful?

