Use this endpoint when you need to determine both which modules to display and how to order the items within each module.
Terminology
| Term | Description | Examples |
|---|---|---|
| Item | A single, discrete entity that can be recommended or ranked | Product, offer, experience, article |
| Module | A container or grouping that holds/displays multiple items and can also be ranked | Shelf, carousel, banner |
Endpoint
Request Body
Unique identifier for the user.
The name of the model to use for ranking.Example:
model_module-20250315_342VLPajymMOYwv9YqIzWjNUTv8Alternatively, older client versions can use the model_name field instead of model_id. Please confirm with our team if you are unsure.An array of module objects to rank. Each module object contains:Module Fields:
id(string, required): Unique identifier for the module.items(array, required): An array of item objects. Can be empty for modules that don’t contain items.is_pre_ranked(boolean, optional): Iftrue, items within this module will not be re-ranked. Defaults tofalse.fixed_position(number, optional): If provided, this module will be placed at the specified position (0-indexed) in the response, regardless of its score.limit(number, optional): Maximum number of items to return for this module. If not specified, all ranked items are returned.
items array):id(string, required): Unique identifier for the item.fixed_position(number, optional): If provided, this item will be placed at the specified position (0-indexed) within the module, regardless of its score.
Example Request
Response
A unique identifier for this specific set of recommendations.Example:
rec_0ujsswThIGTUYm2K8FjOOfXtY1KAn array of ranked module objects with scores.Module Object Fields:
id(string, required): The unique identifier of the modulescore(number): The ranking score assigned to this module by the model. Omitted iffixed_positionis set for this modulefixed_position(number, optional): Present if the module was assigned a fixed position in the requestis_pre_ranked(boolean, optional): Present if the module was marked as pre-ranked in the requestitems(array, optional): Array of item objects. For pre-ranked modules, items are returned in their original order without scores. For ranked modules, items include scores and are ordered by relevance (with fixed positions respected). Limited to the number specified bylimitif provided. May be empty or omitted if the module has no items
items array):id(string, required): The unique identifier of the itemscore(number): The ranking score assigned to this item by the model. Omitted iffixed_positionis set for this item or if the module is pre-rankedfixed_position(number, optional): Present if the item was assigned a fixed position in the request
Example Response
Behavior Notes
- Module Ranking: All modules receive a score and are returned in ranked order, unless a
fixed_positionis specified. - Fixed Module Position: When a module has
fixed_positionset, it will be placed at that specific position (0-indexed) in the response array and will not include a score. Other modules are ranked normally and fill remaining positions. - Modules Without Items: Modules can be included without any items and will still be ranked against other modules. This is useful for ranking placement slots or banners independently.
- Item Ranking: Items within modules are ranked by relevance unless
is_pre_ranked: trueis set. Items include scores and are ordered by their ranking scores in the response. - Fixed Item Position: When an item has
fixed_positionset, it will be placed at that specific position (0-indexed) within its module and will not include a score. Other items are ranked normally, include scores, and fill remaining positions. - Pre-ranked Modules: When
is_pre_ranked: true, the module’s items are not re-ranked. Theitemsarray is returned in the original order without scores. - Item Limit: When
limitis specified for a module, the response will include at most that many items for that module, even if more items were provided in the request. - Unified Scoring: Both module placement and item ordering are optimized in a single API call based on the user context.
Use Cases
This endpoint is ideal for scenarios where you need to:- Determine which content modules (carousels, shelves) to display on a page
- Personalize the order of items within each module
- Optimize homepage layouts with multiple recommendation sections
- A/B test different module configurations while maintaining item-level personalization
- Pin specific modules or items to fixed positions (e.g., always show a promotional banner first)
- Limit the number of recommendations per module to fit UI constraints
- Rank placement slots or banners independently, even without specific items
Response Codes
200 - OK
200 - OK
Successful response with ranked modules and items.
400 - Bad Request
400 - Bad Request
Malformed JSON or invalid parameters in the request body.
Example Error Response
401 - Unauthorized
401 - Unauthorized
422 - Validation Error
422 - Validation Error
Input failed validation. Check that required fields are present and correctly formatted.
429 - Too Many Requests
429 - Too Many Requests
Rate limit exceeded. Check the
Retry-After header for when to retry.5xx - Server Error
5xx - Server Error
Temporary server issue. Please retry with exponential backoff.

