---
title: "Post Rank."
method: POST
path: "/rank"
tags: ["Rank"]
---

# Post Rank.

`POST /rank`

Submit a Personalizer rank request, to get which of the provided actions should be used in the provided context.

## Request body

- RankRequest — Request a set of actions to be ranked by the Personalizer service.
  - `contextFeatures` object[] — Features of the context used for Personalizer as a dictionary of dictionaries. This depends on the application, and typically includes features about the current user, their device, profile information, aggregated data about time and date, etc. Features should not include personally identifiable information (PII), unique UserIDs, or precise timestamps.
  - `actions` RankableAction[], required — The set of actions the Personalizer service can pick from. The set should not contain more than 50 actions. The order of the actions does not affect the rank result but the order should match the sequence your application would have used to display them. The first item in the array will be used as Baseline item in Offline evaluations.
    - `id` string, required — Id of the action.
    - `features` object[], required — List of dictionaries containing features.
  - `excludedActions` string[] — The set of action ids to exclude from ranking.
  - `eventId` string — Optionally pass an eventId that uniquely identifies this Rank event. If null, the service generates a unique eventId. The eventId will be used for associating this request with its reward, as well as seeding the pseudo-random generator when making a Personalizer call.
  - `deferActivation` boolean — Send false if it is certain the rewardActionId in rank results will be shown to the user, therefore Personalizer will expect a Reward call, otherwise it will assign the default Reward to the event. Send true if it is possible the user will not see the action specified in the rank results, because the page is rendering later, or the Rank results may be overridden by code further downstream.

## Response `201`

Success

- RankResponse — Returns which action to use as rewardActionId, and additional information about each action as a result of a Rank request.
  - `ranking` RankedAction[] — The calculated ranking for the current request.
    - `id` string — Id of the action
    - `probability` number, float — Probability of the action
  - `eventId` string — The eventId for the round trip from request to response.
  - `rewardActionId` string — The action chosen by the Personalizer service. This is the action your application should display, and for which to report the reward. This might not be the first found in 'ranking' if an action in the request in first position was part of the excluded ids.

## Other responses

- `default` — Invalid rank request.

---

[API](https://skmtc.dev/azure/apis/personalizer-client.md) · [All operations](https://skmtc.dev/azure/apis/personalizer-client/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/personalizer-client/revisions/a086285ef734/schema)
