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

# Resolve ESPN player IDs via game summaries

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

For each attended MLB game, hits ESPN’s schedule + summary endpoints, walks the box score, and matches each ESPN athlete to an MLB player by last\_name + jersey to populate players.espn\_id. Run before enrich-player-photos to unlock the ESPN full-body photo variant.

## Authorization

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

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

## Body

#### event\_ids (body, array of integer)

#### limit (body, integer)

## Response

#### 200

ESPN ID cross-reference completed

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

#### scanned\_events (integer, required)

#### matched\_events (integer, required)

#### resolved\_player\_ids (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-espn-ids' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"event_ids": [0], "limit": 0}'
```

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

```python Python
import requests

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

#### Response

```json 200
{
  "status": "completed",
  "scanned_events": 0,
  "matched_events": 0,
  "resolved_player_ids": 0,
  "failures": [
    {
      "event_id": 0,
      "reason": "string"
    }
  ]
}
```

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

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