Track Interaction Batch
curl --request POST \
--url https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interactions": [
{
"document_id": "<string>",
"interaction_type": [],
"position": 1,
"execution_id": "exec_abc123xyz",
"query_snapshot": {
"text": "wireless headphones"
},
"document_score": 0.95,
"result_set_size": 10,
"session_id": "sess_abc123",
"metadata": {}
}
]
}
'import requests
url = "https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch"
payload = { "interactions": [
{
"document_id": "<string>",
"interaction_type": [],
"position": 1,
"execution_id": "exec_abc123xyz",
"query_snapshot": { "text": "wireless headphones" },
"document_score": 0.95,
"result_set_size": 10,
"session_id": "sess_abc123",
"metadata": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
interactions: [
{
document_id: '<string>',
interaction_type: [],
position: 1,
execution_id: 'exec_abc123xyz',
query_snapshot: {text: 'wireless headphones'},
document_score: 0.95,
result_set_size: 10,
session_id: 'sess_abc123',
metadata: {}
}
]
})
};
fetch('https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch', 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.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch",
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([
'interactions' => [
[
'document_id' => '<string>',
'interaction_type' => [
],
'position' => 1,
'execution_id' => 'exec_abc123xyz',
'query_snapshot' => [
'text' => 'wireless headphones'
],
'document_score' => 0.95,
'result_set_size' => 10,
'session_id' => 'sess_abc123',
'metadata' => [
]
]
]
]),
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.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch"
payload := strings.NewReader("{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Public Retriever API
Track Interaction Batch
Track multiple interactions in a single request (batching).
More efficient than sending individual interaction requests. Use this for batching viewport visibility, bulk actions, etc.
Authentication:
- API key is OPTIONAL (same as execute endpoint)
- Password NOT required (tracking should work even without auth)
Recommended Headers:
X-Session-ID: Applied to all interactions in the batch
Limits:
- Maximum 100 interactions per batch
Example:
curl -X POST "https://api.mixpeek.com/v1/public/retrievers/video-search/interactions/batch" \
-H "X-Session-ID: sess_xyz..." \
-H "Content-Type: application/json" \
-d '{
"interactions": [
{
"document_id": "doc_123",
"interaction_type": ["VIEW"],
"position": 0,
"execution_id": "exec_abc"
},
{
"document_id": "doc_456",
"interaction_type": ["VIEW"],
"position": 1,
"execution_id": "exec_abc"
}
]
}'
POST
/
v1
/
public
/
retrievers
/
{public_name}
/
interactions
/
batch
Track Interaction Batch
curl --request POST \
--url https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interactions": [
{
"document_id": "<string>",
"interaction_type": [],
"position": 1,
"execution_id": "exec_abc123xyz",
"query_snapshot": {
"text": "wireless headphones"
},
"document_score": 0.95,
"result_set_size": 10,
"session_id": "sess_abc123",
"metadata": {}
}
]
}
'import requests
url = "https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch"
payload = { "interactions": [
{
"document_id": "<string>",
"interaction_type": [],
"position": 1,
"execution_id": "exec_abc123xyz",
"query_snapshot": { "text": "wireless headphones" },
"document_score": 0.95,
"result_set_size": 10,
"session_id": "sess_abc123",
"metadata": {}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
interactions: [
{
document_id: '<string>',
interaction_type: [],
position: 1,
execution_id: 'exec_abc123xyz',
query_snapshot: {text: 'wireless headphones'},
document_score: 0.95,
result_set_size: 10,
session_id: 'sess_abc123',
metadata: {}
}
]
})
};
fetch('https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch', 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.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch",
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([
'interactions' => [
[
'document_id' => '<string>',
'interaction_type' => [
],
'position' => 1,
'execution_id' => 'exec_abc123xyz',
'query_snapshot' => [
'text' => 'wireless headphones'
],
'document_score' => 0.95,
'result_set_size' => 10,
'session_id' => 'sess_abc123',
'metadata' => [
]
]
]
]),
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.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch"
payload := strings.NewReader("{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/public/retrievers/{public_name}/interactions/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interactions\": [\n {\n \"document_id\": \"<string>\",\n \"interaction_type\": [],\n \"position\": 1,\n \"execution_id\": \"exec_abc123xyz\",\n \"query_snapshot\": {\n \"text\": \"wireless headphones\"\n },\n \"document_score\": 0.95,\n \"result_set_size\": 10,\n \"session_id\": \"sess_abc123\",\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"status": 123,
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"details": {}
},
"success": false
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Public name of the published retriever
Body
application/json
Request to track multiple interactions in batch.
List of interactions to track (max 100 per batch)
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Successful Response
Was this page helpful?
⌘I

