Settle match prediction
Send a match's final score to start paying rewards to the traders who predicted it correctly.
- Method
- POST
- Path
https://api.returning.ai / v1/ match-predictions/ {matchPredictionId}/ settlements - Permission
- matchPredictions
- Retries
- Idempotency-Key required; same key and body replays
When to use this
- The match has finished and your results feed has the final score.
- An earlier settlement failed and you need to run it again.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- matchPredictionsShown in the dashboard as “Match Prediction”
Use a Community API key with matchPredictions, shown in the dashboard as Match Prediction, and keep it on your server. The key decides the community: you only see and change match predictions in that community, and an ID from another community returns 404, the same as an unknown ID. Personal API keys are rejected with 403.
Behaviour#
api.returning.ai doesn't serve this route yet: requests return an empty 404. Ask Returning.AI before you build on it.
Settlement runs in the background: a 202 means it has started, not finished. Poll Get settlement results until it returns 200. While it runs, the match shows settlement_in_progress.
You can settle once kickoffAt has passed, and only a published match that isn't already settled, voided or being voided. A match whose settlement failed can be settled again.
Each prediction is scored against the score you send:
- Right result (team A win, team B win or draw), wrong score:
rewards.correctResult. - Right result and exact score:
rewards.correctResultplusrewards.exactScoreBonus. - Wrong result: nothing.
Winners also get their entry cost back, added to their coin payout. Settlement also sends your community's match prediction webhooks, if you have set any up.
Request#
Path parameters#
Rulemp_ and 24 hex characters
Eg"mp_66f000000000000000000801"
Headers#
matchPredictions.RuleBearer <API_KEY>
Rule1-255 characters
Eg"3f9c2a7e-1b4d-4e8a-9c61-2d5f7a8b9e10"
415.Ruleapplication/json
meta.requestId. Without it, a req_... ID is generated.Body#
curl --request POST \
--url https://api.returning.ai/v1/match-predictions/mp_66f000000000000000000801/settlements \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Idempotency-Key: 3f9c2a7e-1b4d-4e8a-9c61-2d5f7a8b9e10' \
--header 'Content-Type: application/json' \
--data '{
"fullTimeScore": {
"teamA": 2,
"teamB": 1
}
}'
Response#
A 202 returns the settlement's operationId and the resultsUrl to poll. If a settlement is already running on this match under a different key, you get 202 MATCH_PREDICTION_SETTLEMENT_IN_PROGRESS with the running settlement's details instead; poll its results rather than starting another.
Rulesuccess
RuleMATCH_PREDICTION_SETTLEMENT_ACCEPTED, or MATCH_PREDICTION_SETTLEMENT_IN_PROGRESS when a settlement is already running
X-Request-Id if you sent one, otherwise a generated req_... ID. Quote it when you contact support.Rulemps_ and 32 hex characters
settlement.settlement_in_progress when it starts. A replay shows the status the settlement had then.{
"meta": {
"status": "success",
"statusCode": 202,
"code": "MATCH_PREDICTION_SETTLEMENT_ACCEPTED",
"requestId": "req_66f00000000000000000000000000811"
},
"message": "Match prediction settlement accepted.",
"data": {
"operationId": "mps_66f00000000000000000000000000803",
"type": "settlement",
"status": "settlement_in_progress",
"submittedAt": "2026-10-10T21:00:00.000Z",
"resultsUrl": "/v1/match-predictions/mp_66f000000000000000000801/results"
}
}
Errors#
Every error carries its code in meta.code and the request's ID in meta.requestId. Validation errors list each problem in details, with a field, code and message. The API key checks (401, 403, 404 COMMUNITY_NOT_FOUND and 500 AUTHENTICATION_FAILED) return detail and solution instead. A 404 with an empty body means the route isn't available on api.returning.ai yet. A 400 or 409 changes nothing.
Fix the request10
MATCH_PREDICTION_VALIDATION_FAILEDFix the requestfullTimeScore is missing, a score isn't a whole number of 0 or more, or the body has another field. details names it. Nothing changed.READ_ONLY_FIELDFix the requeststatus or settlement. details names it. Remove it.INVALID_JSONFix the requestIDEMPOTENCY_KEY_REQUIREDFix the requestIdempotency-Key header with a unique value.IDEMPOTENCY_KEY_INVALIDFix the requestIdempotency-Key is longer than 255 characters. Use a shorter key, such as a UUID.UNSUPPORTED_MEDIA_TYPEFix the requestContent-Type: application/json.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestmatchPredictions, or it is a personal key. Use a Community API key and add Match Prediction in Settings > Integration > API Keys.IDEMPOTENCY_KEY_CONFLICTFix the requestIdempotency-Key was already used with a different body. Use a new key for a new body.Fix the data05
MATCH_PREDICTION_NOT_FOUNDFix the datamp_... ID from Create match prediction or List match predictions.COMMUNITY_NOT_FOUNDFix the dataMATCH_NOT_STARTEDFix the datakickoffAt hasn't passed yet. Settle after kickoff, or move kickoffAt with Patch match prediction if the match started early.INVALID_LIFECYCLE_TRANSITIONFix the datasettled or voided. Only a published match that isn't finished can be settled. Nothing changed.OPERATION_IN_PROGRESSFix the dataRetry with backoff05
RATE_LIMITEDRetry with backoffRetry-After, then retry.INTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoffSETTLEMENT_QUEUE_UNAVAILABLERetry with backoffIdempotency-Key: the same key returns this 503 again.MATCH_PREDICTION_FROZENRetry with backoff{
"meta": {
"status": "error",
"statusCode": 404,
"code": "MATCH_PREDICTION_NOT_FOUND",
"requestId": "req_66f00000000000000000000000000811"
},
"message": "Match prediction not found."
}