# Void match prediction

Cancel a published match prediction and refund every trader's entry cost, without paying any rewards.

- Endpoint: `POST https://api.returning.ai/v1/match-predictions/{matchPredictionId}/void`
- Section: Gamification / Match predictions
- Authentication: `Authorization: Bearer <API_KEY>` (Community API key)
- Permission: `matchPredictions` (Shown in the dashboard as "Match Prediction")
- Retries: Idempotency-Key required; same key and body replays
- Guide: hand-written
- Verified: code, 2026-09-27
- Last updated: 26 Sep 2026
- Web page: https://docs.returning.ai/api-reference/gamification-match-predictions/void-match-prediction

## When to use this

- The fixture was cancelled, abandoned or declared invalid.
- A published match was set up wrongly and shouldn't pay out.
- An earlier void failed and you need to run it again.

**Instead:** Use [Settle match prediction](https://docs.returning.ai/api-reference/gamification-match-predictions/settle-match-prediction.md) instead when the match was played and winners should be paid.

**Availability:** api.returning.ai doesn't serve this route yet: requests return an empty `404`. Ask Returning.AI before you build on it.

**No undo:** A voided match can't be settled or voided again.

## Authentication

- Header: `Authorization: Bearer <API_KEY>`
- Permission: `matchPredictions`

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.

A void runs in the background: a `202` means it has started. Traders can't submit predictions once it starts, and the match shows `void_in_progress`. Poll Get settlement results until it returns `200 MATCH_PREDICTION_VOID_COMPLETED`.

You can void a published match at any time, before or after kickoff, unless it is already settled or voided or another settlement or void is running. A match whose void failed can be voided again.

Every trader who paid an entry cost gets those coins back, and nobody gets rewards. The match becomes `voided` once every prediction has been handled.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `matchPredictionId` | `string` | Yes | The match prediction ID from Create match prediction or List match predictions. (`mp_` and 24 hex characters) |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | Yes | Community API key with `matchPredictions`. (`Bearer <API_KEY>`) |
| `Idempotency-Key` | `string` | Yes | A unique key you create for this void, such as a UUID. Reuse it only to retry the same body. (1-255 characters) |
| `Content-Type` | `string` | Yes | Request body format. Anything else returns `415`. (`application/json`) |
| `X-Request-Id` | `string` | No | Your own ID for this request, returned in `meta.requestId`. Without it, a `req_...` ID is generated. |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `reason` | `string` | Yes | Why you are voiding the match. Recorded with the void. (`fixture_cancelled`, `fixture_abandoned`, `fixture_invalid` or `operator_error`) |

### Example request

```bash
curl --request POST \
  --url https://api.returning.ai/v1/match-predictions/mp_66f000000000000000000801/void \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Idempotency-Key: 3f9c2a7e-1b4d-4e8a-9c61-2d5f7a8b9e10' \
  --header 'Content-Type: application/json' \
  --data '{
    "reason": "fixture_cancelled"
  }'
```

## Response

A `202` returns the void's `operationId` and the `resultsUrl` to poll.

### Response fields

| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `meta` | `object` | always | Result details. |
| `meta.status` | `string` | always | Result of the request. (`success`) |
| `meta.statusCode` | `integer` | always | The HTTP status, repeated. |
| `meta.code` | `string` | always | Machine-readable result code. (`MATCH_PREDICTION_VOID_ACCEPTED`) |
| `meta.requestId` | `string` | always | Your `X-Request-Id` if you sent one, otherwise a generated `req_...` ID. Quote it when you contact support. |
| `message` | `string` | always | Human-readable summary. Do not branch on it. |
| `data` | `object` | always | The void that was started. |
| `data.operationId` | `string` | always | The void ID. (`mpv_` and 32 hex characters) |
| `data.type` | `string` | always | Always `void`. |
| `data.status` | `string` | always | `void_in_progress` when it starts. A replay shows the status the void had then. |
| `data.submittedAt` | `string` | always | When the void was accepted. |
| `data.resultsUrl` | `string` | always | Where to poll for the outcome, without the host. |

### Example response (202)

```json
{
  "meta": {
    "status": "success",
    "statusCode": 202,
    "code": "MATCH_PREDICTION_VOID_ACCEPTED",
    "requestId": "req_66f00000000000000000000000000811"
  },
  "message": "Match prediction void accepted.",
  "data": {
    "operationId": "mpv_66f00000000000000000000000000804",
    "type": "void",
    "status": "void_in_progress",
    "submittedAt": "2026-10-10T17: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 request

| Status | Code | What to do |
| --- | --- | --- |
| 404 | - | The body is empty: api.returning.ai doesn't serve this route yet. Ask Returning.AI before you build on it. |
| 400 | `MATCH_PREDICTION_VALIDATION_FAILED` | `reason` is missing or not one of the four values, or the body has another field. `details` names it. Nothing changed. |
| 400 | `READ_ONLY_FIELD` | The request has a field the server sets, such as `status` or `settlement`. `details` names it. Remove it. |
| 400 | `INVALID_JSON` | The body is not valid JSON. Fix the syntax and send it again. |
| 400 | `IDEMPOTENCY_KEY_REQUIRED` | Send an `Idempotency-Key` header with a unique value. |
| 400 | `IDEMPOTENCY_KEY_INVALID` | The `Idempotency-Key` is longer than 255 characters. Use a shorter key, such as a UUID. |
| 415 | `UNSUPPORTED_MEDIA_TYPE` | Send the body as JSON with `Content-Type: application/json`. |
| 401 | `AUTHENTICATION_REQUIRED` | The key is missing, invalid or expired. Send `Authorization: Bearer <API_KEY>` with a current Community API key. |
| 403 | `API_KEY_PERMISSION_DENIED` | The key lacks `matchPredictions`, or it is a personal key. Use a Community API key and add Match Prediction in Settings > Integration > API Keys. |
| 409 | `IDEMPOTENCY_KEY_CONFLICT` | This `Idempotency-Key` was already used with a different body. Use a new key for a new body. |

### Fix the data

| Status | Code | What to do |
| --- | --- | --- |
| 404 | `MATCH_PREDICTION_NOT_FOUND` | No match prediction in your community has this ID. Check it is the full `mp_...` ID from Create match prediction or List match predictions. |
| 404 | `COMMUNITY_NOT_FOUND` | The community this key belongs to no longer exists. Contact Returning.AI support. |
| 409 | `INVALID_LIFECYCLE_TRANSITION` | The match is a draft, which has nothing to refund and can't be voided. It stays a draft. |
| 409 | `MATCH_ALREADY_SETTLED` | The match is already settled, and a settlement can't be reversed. Nothing changed. |
| 409 | `MATCH_ALREADY_VOIDED` | The match is already voided. Nothing more to do. |
| 409 | `OPERATION_IN_PROGRESS` | A settlement or another void is running on this match. Check the outcome with Get settlement results. |

### Retry with backoff

| Status | Code | What to do |
| --- | --- | --- |
| 429 | `RATE_LIMITED` | Your community is over its [rate limit](https://docs.returning.ai/how-it-works.md#rate-limits). Wait for the seconds in `Retry-After`, then retry. |
| 500 | `INTERNAL_ERROR` | The outcome is unclear. Check Get settlement results before you send the void again with a new key. |
| 500 | `AUTHENTICATION_FAILED` | The key could not be checked. Retry with backoff; nothing changed. |
| 503 | `VOID_QUEUE_UNAVAILABLE` | The void couldn't be started, and nothing changed. Retry later with a new `Idempotency-Key`: the same key returns this `503` again. |
| 503 | `MATCH_PREDICTION_FROZEN` | Returning.AI has paused match prediction requests. Nothing changed. Retry later with backoff. |

**Retries:** Every void needs an `Idempotency-Key`. The same key with the same body returns the first response again and never refunds twice. The same key with a different `reason` returns `409 IDEMPOTENCY_KEY_CONFLICT`. Responses are replayed for 24 hours, including errors, so after a `503` or a `500` use a new key. Before you send a new key after a timeout, check Get settlement results: a void that already started returns `202` there. Returning.AI can set a request limit for your community on these endpoints, counted per community and calling IP address. Over it, requests return `429 RATE_LIMITED` with a `Retry-After` header in seconds; wait that long, then retry.

## Next step

- [Get settlement results](https://docs.returning.ai/api-reference/gamification-match-predictions/get-settlement-results.md): `GET /v1/match-predictions/{matchPredictionId}/results`. Poll until the void finishes, then check each trader's refund.
