Prediction Game
Add a prediction game to any website. Participants predict outcomes of events (matches, questions, categories) and compete on a leaderboard. Events live in MAPI entities — fully flexible per use case.
Endpoints (13)
Create or update a prediction game. Points the game at a MAPI entity that holds the events to predict. Configures prediction type and scoring rules.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | Unique slug for this game (e.g. "wk2026", "oscars2027"). |
name |
string | ✓ Yes | Display name of the game (e.g. "WK Poule 2026"). |
entity_name |
string | ✓ Yes | MAPI entity name (plural) holding the events (e.g. "matches", "questions"). |
prediction_type |
string | ✓ Yes | Type of prediction: exact_score, pick_one, pick_multiple, number, free_text, rank. |
scoring_rules |
object | ✓ Yes | Scoring rules JSON. Structure depends on prediction_type. |
description |
string | No | Optional game description. |
event_id_field |
string | No | MAPI field used as unique event identifier. Default: "id". |
deadline_field |
string | No | MAPI field containing per-event deadline (datetime). Omit for a global deadline. |
deadline_global |
string | No | Global deadline datetime (ISO 8601). Used when no per-event deadline field. |
prediction_schema |
object | No | Optional: define prediction input fields for the snippet form. |
display_config |
object | No | Snippet rendering config: event_title_template, group_by_field, sort_by_field, sort_direction. |
List all prediction games for this project.
No input parameters required.
Remove a prediction game and all associated participants and entries.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes |
Add a participant to a prediction game by name and optional email.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
display_name |
string | ✓ Yes | |
email |
string | No | |
is_admin |
boolean | No | Whether this participant can manage outcomes. |
Set the actual outcome of an event after it has concluded.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
event_ref |
string | ✓ Yes | MAPI record ID of the event. |
outcome |
object | ✓ Yes | The actual outcome. Structure matches prediction_type. |
Calculate scores for all predictions of an event or the entire game. Updates points_earned on entries and rank on participants.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
event_ref |
string | No | Calculate for a specific event only. Omit to recalculate entire game. |
Get the current leaderboard for a prediction game.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
limit |
integer | No | Max participants to return. Default: all. |
Get an embeddable HTML+JS snippet for a prediction game. Paste directly into a PAPI page.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
snippet_type |
string | ✓ Yes | Which snippet to generate: predict_form, leaderboard, my_predictions, event_list. |
Submit or update a prediction. Called from browser with SAPI Visitor Auth.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
event_ref |
string | ✓ Yes | |
prediction |
object | ✓ Yes |
Delete an existing prediction. Only allowed before the MAPI deadline and before an outcome has been set. Called from browser with SAPI Visitor Auth.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
event_ref |
string | ✓ Yes |
Get all predictions for the current visitor.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes |
Get all events with deadline status. Reads from the configured MAPI entity.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes |
Get the public leaderboard. No authentication required.
| Field | Type | Required | Description |
|---|---|---|---|
game_slug |
string | ✓ Yes | |
limit |
integer | No |
MCP Tool Names
When using this integration through an AI assistant (Claude, ChatGPT, Cursor, etc.), the endpoints are available as MCP tools:
| Endpoint | MCP Tool Name |
|---|---|
| configure | prediction_game_configure |
| list_games | prediction_game_list_games |
| remove_game | prediction_game_remove_game |
| add_participant | prediction_game_add_participant |
| set_outcome | prediction_game_set_outcome |
| calculate_scores | prediction_game_calculate_scores |
| get_leaderboard | prediction_game_get_leaderboard |
| get_snippet | prediction_game_get_snippet |
| predict | prediction_game_predict |
| delete-prediction | prediction_game_delete_prediction |
| my-predictions | prediction_game_my_predictions |
| events | prediction_game_events |
| public-leaderboard | prediction_game_public_leaderboard |