Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/admin/adminattendingenrichboxscores

# Backfill MLB box score data into attended events

POST `https://api.rewind.rest/v1/admin/attending/enrich-boxscores`

Pulls MLB Stats API box score + live feed for each attended MLB game, upserts every player who played, writes per-player appearance rows with batting/pitching lines, and merges game-level extras (attendance, weather, linescore, decisions) into attended\_events.event\_data. Idempotent — by default skips events already enriched. Use `skip_enriched: false` to force re-enrichment.

## Authorization

#### Authorization (header, string, required)

API key. Read keys (rw\_live\_...) access GET endpoints. Admin keys (rw\_admin\_...) access all endpoints.

## Body

#### game\_pks (body, array of integer)

#### skip\_enriched (body, boolean)

#### limit (body, integer)

#### dry\_run (body, boolean)

## Response

#### 200

Enrichment completed

#### status (enum (string), required) — allowed: completed

#### scanned (integer, required)

#### enriched (integer, required)

#### players\_inserted (integer, required)

#### players\_updated (integer, required)

#### appearances\_inserted (integer, required)

#### appearances\_updated (integer, required)

#### failures (array of object, required)

#### properties

#### event\_id (integer, required)

#### reason (string, required)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### 500

Internal server error

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X POST 'https://api.rewind.rest/v1/admin/attending/enrich-boxscores' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"game_pks": [0], "skip_enriched": true, "limit": 0, "dry_run": true}'
```

```javascript JavaScript
const res = await fetch('https://api.rewind.rest/v1/admin/attending/enrich-boxscores', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"game_pks": [0], "skip_enriched": true, "limit": 0, "dry_run": true}),
});
const data = await res.json();
```

```python Python
import requests

res = requests.post(
    'https://api.rewind.rest/v1/admin/attending/enrich-boxscores',
    headers={'Authorization': 'Bearer <token>'},
    json={"game_pks": [0], "skip_enriched": true, "limit": 0, "dry_run": true}
)
data = res.json()
```

#### Response

```json 200
{
  "status": "completed",
  "scanned": 0,
  "enriched": 0,
  "players_inserted": 0,
  "players_updated": 0,
  "appearances_inserted": 0,
  "appearances_updated": 0,
  "failures": [
    {
      "event_id": 0,
      "reason": "string"
    }
  ]
}
```

```json 401
{
  "error": "Not found",
  "status": 404
}
```

```json 500
{
  "error": "Not found",
  "status": 404
}
```
