Get stream documents

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

ParameterTypeRequiredDescription
idintegerYesThe ID of the stream.
languagestringYesThe language code for which to retrieve documents (e.g. de, en).

Headers

HeaderValue
AuthorizationBearer <token>

Request Body (POST only, optional)

FieldTypeRequiredDescription
groupstringNoProduct group constraint for variant grouping.
variant_countintegerNoMaximum number of variants to include per product.
configobjectNoAdditional 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

FieldTypeDescription
totalintegerNumber of documents in the current result page.
itemsarrayArray 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
    }
  ]
}