Patch match prediction
Change fields on one match prediction, guarded by its version so you never overwrite someone else's change.
- Method
- PATCH
- Path
https://api.returning.ai / v1/ match-predictions/ {matchPredictionId} - Permission
- matchPredictions
- Retries
- No Idempotency-Key; read back before retrying
When to use this
- Fix a draft's teams, rewards or audience before you publish it.
- A fixture is delayed, and kickoff and the prediction deadline should move later.
- Correct a match title or description that traders already see.
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.
Only the fields you send change. teamA, teamB, rewards, entryCost and viewPermission are replaced as a whole, so send every part of them. Each change adds 1 to version.
While the match is a draft, every field can change. Once it is published, only title, description, externalReference and the three times can change; anything else returns 409 LOCKED_FIELDS_IMMUTABLE. While a published match is scheduled, open or locked, its times can only move later.
The time order is checked only among the times in the same request, and kickoffAt must be in the future whenever you send it. When you move kickoff, send lockAt in the same request so the order stays right.
Request#
Path parameters#
Egmp_01abc
Headers#
Body#
Send version and at least one other field. Time and other rules are the same as for Create match prediction. id, status and communityId return 409 LOCKED_FIELDS_IMMUTABLE; other fields the server sets, such as createdAt, return 400 READ_ONLY_FIELD.
version you last read. The change is rejected if the match has changed since.RuleWhole number, 1 or more
Eg1
Rule1-256 characters, trimmed
Eg"Australia vs New Zealand"
RuleUp to 10,000 characters
Eg"Predict the final score."
Rule1-128 characters, trimmed
Eg"provider-fixture-123"
Rule1-128 characters
Eg"Australia"
RuleA URL, up to 2,048 characters
Eg"https://cdn.example.com/teams/australia.png"
Rule1-128 characters
Eg"New Zealand"
RuleA URL, up to 2,048 characters
Eg"https://cdn.example.com/teams/new-zealand.png"
RuleISO 8601 in UTC ending in Z; at or before lockAt
Eg"2026-10-01T08:00:00.000Z"
RuleISO 8601 in UTC ending in Z; at or before kickoffAt
Eg"2026-10-10T18:55:00.000Z"
RuleISO 8601 in UTC ending in Z; in the future
Eg"2026-10-10T19:00:00.000Z"
Ruleregulation or extra_time
Eg"regulation"
RuleWhole number, 0-1,000,000
Eg100
RuleWhole number, 0-1,000,000
Eg50
correctResult when the called score is also exact.RuleWhole number, 0-1,000,000
Eg200
RuleWhole number, 0-1,000,000
Eg100
true to charge coins for each prediction.Egfalse
RuleWhole number; 0 when enabled is false
Eg0
RuleRole IDs in your community
Eg["66f000000000000000000806"]
RuleMembers of your community
Eg["3247779"]
curl --request PATCH \
--url https://api.returning.ai/v1/match-predictions/mp_66f000000000000000000801 \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"lockAt": "2026-10-10T19:25:00.000Z",
"kickoffAt": "2026-10-10T19:30:00.000Z"
}'
Response#
A 200 returns the whole match prediction after the change, with the new version. Keep it for your next change.
Rulesuccess
RuleMATCH_PREDICTION_UPDATED
X-Request-Id if you sent one, otherwise a generated req_... ID. Quote it when you contact support.Rulemp_ and 24 hex characters
.000.Ruleregulation or extra_time
correctResult when the called score is also exact.true when predicting costs coins.0 when enabled is false.draft until published. Then scheduled before predictionStartAt, open while traders can predict and locked from lockAt, all worked out from the clock. The rest follow a settle or void.Ruledraft, scheduled, open, locked, settlement_in_progress, settled, settlement_failed, void_in_progress, voided or void_failed
true once published.true while the match is open and the time is between predictionStartAt and lockAt.null here. Read the match with Get match prediction for its settlement totals.{
"meta": {
"status": "success",
"statusCode": 200,
"code": "MATCH_PREDICTION_UPDATED",
"requestId": "req_66f00000000000000000000000000811"
},
"message": "Match prediction updated.",
"data": {
"id": "mp_66f000000000000000000801",
"title": "Australia vs New Zealand",
"teamA": {
"name": "Australia",
"imageUrl": "https://cdn.example.com/teams/australia.png"
},
"teamB": {
"name": "New Zealand",
"imageUrl": "https://cdn.example.com/teams/new-zealand.png"
},
"predictionStartAt": "2026-10-01T08:00:00.000Z",
"lockAt": "2026-10-10T19:25:00.000Z",
"kickoffAt": "2026-10-10T19:30:00.000Z",
"scoreBasis": "regulation",
"viewPermission": {
"roleIds": ["66f000000000000000000806"],
"userIds": []
},
"rewards": {
"correctResult": {
"coins": 100,
"xp": 50
},
"exactScoreBonus": {
"coins": 200,
"xp": 100
}
},
"entryCost": {
"enabled": false,
"coins": 0
},
"status": "draft",
"isPublished": false,
"acceptingPredictions": false,
"attemptCount": 0,
"settlement": null,
"version": 2,
"createdAt": "2026-09-27T09:00:00.000Z",
"updatedAt": "2026-09-28T10:00:00.000Z",
"externalReference": "provider-fixture-123",
"description": "Predict the final score."
}
}
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 request08
MATCH_PREDICTION_VALIDATION_FAILEDFix the requestversion is missing, the body changes nothing (EMPTY_UPDATE), a field breaks its rule or isn't recognised, the times you sent are out of order, kickoffAt isn't in the future, or a viewPermission role or user isn't in your community (INVALID_REFERENCE). details lists each problem. Nothing changed.READ_ONLY_FIELDFix the requestcreatedAt, isPublished or attemptCount. details names it. Remove it.INVALID_JSONFix the requestUNSUPPORTED_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.LOCKED_FIELDS_IMMUTABLEFix the requestid, status or communityId, which never change, or the match is no longer a draft and you sent teamA, teamB, rewards, entryCost, scoreBasis or viewPermission. Nothing changed.Fix the data04
MATCH_PREDICTION_NOT_FOUNDFix the datamp_... ID from Create match prediction or List match predictions.COMMUNITY_NOT_FOUNDFix the dataVERSION_CONFLICTFix the dataversion.SCHEDULE_MAY_NOT_MOVE_EARLIERFix the dataRetry with backoff04
RATE_LIMITEDRetry with backoffRetry-After, then retry.INTERNAL_ERRORRetry with backoffexternalReference is already used by another match. Read the match, and send the change again with its current version if it isn't there.AUTHENTICATION_FAILEDRetry with backoffMATCH_PREDICTION_FROZENRetry with backoff{
"meta": {
"status": "error",
"statusCode": 404,
"code": "MATCH_PREDICTION_NOT_FOUND",
"requestId": "req_66f00000000000000000000000000811"
},
"message": "Match prediction not found."
}