Skip to main content
GET
/
v1
/
retrievers
/
interactions
/
{interaction_id}
Get Interaction
curl --request GET \
  --url https://api.mixpeek.com/v1/retrievers/interactions/{interaction_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Namespace: <x-namespace>'
{
  "description": "Minimal click interaction (query_snapshot and document_score optional)",
  "execution_id": "exec_minimal_123",
  "feature_id": "doc_abc123",
  "interaction_type": [
    "click"
  ],
  "position": 2,
  "session_id": "sess_minimal"
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key. Format: 'Bearer your_api_key'. To get an API key, create an account at mixpeek.com/start and generate a key in your account settings.

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

Examples:

"Bearer sk_live_abc123def456"

"Bearer sk_test_xyz789"

X-Namespace
string
required

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Examples:

"ns_abc123def456"

"production"

"my-namespace"

Path Parameters

interaction_id
string
required

Response

Successful Response

Response model for a stored interaction.

Extends SearchInteraction with system-assigned fields.

feature_id
string
required

ID of the document/feature that was interacted with. REQUIRED. This should be the document_id returned in retriever results. Used to track which specific items users engage with.

Examples:

"doc_abc123"

"prod_xyz789"

"feat_12345"

interaction_type
enum<string>[]
required

List of interaction types that occurred. REQUIRED. Multiple types can be recorded simultaneously (e.g., VIEW + CLICK + LONG_VIEW for a result the user engaged with). Use the InteractionType enum values.

Minimum length: 1
Examples:
["click"]
["positive_feedback", "click", "long_view"]
["negative_feedback"]
["purchase", "click"]
position
integer
required

Position in search results where interaction occurred (0-indexed). REQUIRED. Critical for Learning to Rank - helps identify position bias. E.g., position=0 means first result, position=9 means 10th result. Higher engagement at lower positions suggests higher quality.

Required range: x >= 0
Examples:

0

1

5

15

interaction_id
string
required

Unique identifier for this interaction record. System-assigned UUID. Use this to reference the interaction in subsequent requests.

Examples:

"int_abc123xyz789"

"550e8400-e29b-41d4-a716-446655440000"

metadata
object | null

Additional context about the interaction. NOT REQUIRED. Can include device, duration, viewport info, etc. Use this to enrich interaction data with application-specific context.

Examples:
{
  "device": "mobile",
  "duration_ms": 5000,
  "page": "search_results",
  "viewport_position": 0.75
}
{
  "interaction_reason": "not_relevant",
  "page_number": 2,
  "results_count": 50,
  "search_latency_ms": 150
}
user_id
string | null

Customer's authenticated user identifier. NOT REQUIRED. Persists across sessions for long-term tracking. Enables personalization and user-specific metrics. Use your application's user ID format.

Examples:

"user_abc123"

"customer_456"

"usr_xyz789"

session_id
string | null

Temporary identifier for a single search session. NOT REQUIRED. Typically 30min-1hr duration. Tracks anonymous and authenticated users within a session. Use to group related queries and understand search journeys.

Examples:

"sess_abc123"

"session_xyz789_1234567890"

execution_id
string | null

ID of the retriever execution that generated these results. NOT REQUIRED but HIGHLY RECOMMENDED for training and optimization. Links the interaction back to the exact search query, pipeline configuration, and stage execution that produced the results the user saw. Essential for: fine-tuning embeddings, training rerankers, query understanding, and tracing which pipeline configs produce better user engagement. Retrieve from the retriever execution response and pass to interactions.

Examples:

"exec_abc123xyz"

"exec_550e8400e29b41d4"

retriever_id
string | null

ID of the retriever that was executed. NOT REQUIRED but RECOMMENDED for multi-retriever analytics. Enables comparing performance across different retriever configurations. If execution_id is provided, retriever_id can be inferred from the execution record.

Examples:

"ret_abc123"

"ret_product_search_v2"

query_snapshot
object | null

Snapshot of the query input that generated these results. HIGHLY RECOMMENDED for training optimization. Storing the query directly enables 10-100x faster training data extraction by avoiding expensive joins to execution records. Use the same format as retriever query input (e.g., {'text': '...', 'filters': {...}}). Essential for: embedding fine-tuning (query-document pairs), query expansion learning, and analyzing which query patterns lead to better engagement. NOT REQUIRED but strongly recommended for production use cases involving model training.

Examples:
{ "text": "wireless headphones" }
{
  "filters": { "price": { "lte": 1000 } },
  "text": "laptop"
}
{
  "context": "summer collection",
  "text": "red shoes"
}
document_score
number | null

Initial retrieval score of this document when shown to the user. HIGHLY RECOMMENDED for Learning to Rank (LTR). This is a critical feature for reranker training - helps the model learn how to adjust initial scores based on user engagement. Should match the score from the retriever execution results. NOT REQUIRED but strongly recommended for LTR and reranker training.

Examples:

0.95

0.87

0.62

result_set_size
integer | null

Total number of results shown to the user in this search. NOT REQUIRED but useful for context. Helps understand interaction patterns - clicking position 5 of 10 results is different from position 5 of 100 results. Useful for position bias correction and CTR analysis.

Required range: x >= 1
Examples:

10

20

50

100

timestamp
string | null

ISO 8601 timestamp when the interaction was recorded. System-assigned. Used for time-based analysis, training data recency weighting, and temporal trends in user behavior.

Examples:

"2025-01-15T10:30:00Z"

"2025-01-15T14:45:30.123Z"