For each submitted item, this endpoint deletes all votes that occurred prior to the supplied targetDate. This is useful if the item changed on the targetDate, and the votes prior are no longer valid.
You may supply item ids, or unique nameRefs.
curl -X POST "<https://unduel.com/api/v1/item/reset-rankings?user=><user name>" \\
-H "X-API-Key: <api key>" \\
-H "Content-Type: application/json" \\
-d '{
"listId": "<list id>",
"targetDate": "2023-01-01T00:00:00.000Z",
"items": [
{
"id": "<existing item id>"
}
]
}'
interface ResetRankingsRequestBody {
items: { id?: string; nameRef?: string }[];
listId: string;
targetDate: Date;
}
interface ResetRankingsResponse {
success: boolean;
message?: string;
error?: string;
}