Skip to main content
POST
/
api
/
dataset
/
events
Get events for the dataset
curl --request POST \
  --url https://api.trieve.ai/api/dataset/events \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TR-Dataset: <tr-dataset>' \
  --data '
{
  "page": 1,
  "page_size": 10,
  "type": [
    "chunk_action_failed"
  ]
}
'
import requests

url = "https://api.trieve.ai/api/dataset/events"

payload = {
"page": 1,
"page_size": 10,
"type": ["chunk_action_failed"]
}
headers = {
"TR-Dataset": "<tr-dataset>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'TR-Dataset': '<tr-dataset>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({page: 1, page_size: 10, type: ['chunk_action_failed']})
};

fetch('https://api.trieve.ai/api/dataset/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.trieve.ai/api/dataset/events",
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([
'page' => 1,
'page_size' => 10,
'type' => [
'chunk_action_failed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"TR-Dataset: <tr-dataset>"
],
]);

$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.trieve.ai/api/dataset/events"

payload := strings.NewReader("{\n \"page\": 1,\n \"page_size\": 10,\n \"type\": [\n \"chunk_action_failed\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("TR-Dataset", "<tr-dataset>")
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.trieve.ai/api/dataset/events")
.header("TR-Dataset", "<tr-dataset>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"page\": 1,\n \"page_size\": 10,\n \"type\": [\n \"chunk_action_failed\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.trieve.ai/api/dataset/events")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["TR-Dataset"] = '<tr-dataset>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": 1,\n \"page_size\": 10,\n \"type\": [\n \"chunk_action_failed\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "event_types": [
    "<string>"
  ],
  "events": [
    {
      "created_at": "2021-01-01 00:00:00.000",
      "dataset_id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
      "event_data": {
        "file_name": "file.txt",
        "group_id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3"
      },
      "event_type": "file_uploaded",
      "id": "e3e3e3e3-e3e3-e3e3-e3e3-e3e3e3e3e3e3",
      "updated_at": "2021-01-01 00:00:00.000"
    }
  ],
  "page_count": 123
}
{
"message": "Bad Request"
}

Authorizations

Authorization
string
header
required

Headers

TR-Dataset
string<uuid>
required

The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.

Body

application/json

JSON request payload to get events for a dataset

event_types
enum<string>[] | null

The types of events to get. Leave undefined to get all events.

Available options:
file_uploaded,
file_upload_failed,
chunks_uploaded,
chunk_action_failed,
chunk_updated,
bulk_chunks_deleted,
chunk_update_failed,
dataset_delete_failed,
qdrant_upload_failed,
bulk_chunk_upload_failed,
group_chunks_updated,
group_chunks_action_failed,
crawl_completed,
crawl_failed,
crawl_started,
csv_jsonl_processing_failed,
csv_jsonl_processing_checkpoint,
csv_jsonl_processing_completed,
video_uploaded,
pagefind_indexing_started,
pagefind_indexing_finished,
etl_started,
etl_completed,
etl_failed
page
integer<int64> | null

The page number to get. Default is 1.

page_size
integer<int64> | null

The number of items per page. Default is 10.

Response

Events for the dataset

event_types
string[]
required
events
object[]
required
page_count
integer<int32>
required