Returns the documents (e.g. products) matching a stream's query for a given language. Supports both GET (no body) and POST (with optional body parameters for variant grouping).
Requires the stream:documents:read or streams.read permission.
Request
GET /stream/documents/{id}/{language}
POST /stream/documents/{id}/{language}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The ID of the stream. |
language | string | Yes | The language code for which to retrieve documents (e.g. de, en). |
Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Request Body (POST only, optional)
| Field | Type | Required | Description |
|---|---|---|---|
group | string | No | Product group constraint for variant grouping. |
variant_count | integer | No | Maximum number of variants to include per product. |
config | object | No | Additional query configuration. Supports datatype (default: "makaira-productgroup"). |
Example Request (POST)
{
"variant_count": 3,
"config": {
"datatype": "makaira-productgroup"
}
}Response
Returns a JSON object with the matching documents and the total count.
Response Body
| Field | Type | Description |
|---|---|---|
total | integer | Number of documents in the current result page. |
items | array | Array of document source objects. |
The response also includes an X-Total-Count header with the overall count from the search engine.
Example Response
{
"total": 2,
"items": [
{
"id": "prod-001",
"title": "Running Shoes",
"price": 89.99
},
{
"id": "prod-002",
"title": "Trail Boots",
"price": 129.99
}
]
}
