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": "doc_abc123",
"interaction_type": [
"click"
],
"position": 0,
"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": "doc_abc123",
"interaction_type": ["click"],
"position": 0,
"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: 'doc_abc123',
interaction_type: ['click'],
position: 0,
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' => 'doc_abc123',
'interaction_type' => [
'click'
],
'position' => 0,
'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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"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)
- A password-protected retriever needs the
X-Retriever-Passwordheader, as execute does - Rate limited with the retriever’s execute limits
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"
}
]
}'
Public Retriever API: A public retriever is a retriever you have published so people can search your collections without your API key, optionally behind a password and rate limits. These endpoints list public retrievers, return their display config and template, run searches that return only the fields you expose, and record interactions. Read the guide.
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": "doc_abc123",
"interaction_type": [
"click"
],
"position": 0,
"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": "doc_abc123",
"interaction_type": ["click"],
"position": 0,
"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: 'doc_abc123',
interaction_type: ['click'],
position: 0,
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' => 'doc_abc123',
'interaction_type' => [
'click'
],
'position' => 0,
'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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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\": \"doc_abc123\",\n \"interaction_type\": [\n \"click\"\n ],\n \"position\": 0,\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{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Body
application/json
Keys this body does not declare are refused with 422 extra_forbidden naming the accepted keys (since 2026-11-02).
Response
Successful Response
Was this page helpful?

