⚽ Convocados Docs GitHub

History API

Endpoints for listing past game results and editing scores while they are still editable.

GET /api/events/[id]/history

List all history entries for an event, ordered by date descending.

Response

[
  {
    "id": "clx9abc...",
    "eventId": "clx1abc...",
    "dateTime": "2026-03-13T19:00:00.000Z",
    "status": "played",
    "scoreOne": 3,
    "scoreTwo": 2,
    "teamsSnapshot": "{\"teamOne\":[...],\"teamTwo\":[...]}",
    "editableUntil": "2026-03-14T19:00:00.000Z",
    "createdAt": "2026-03-13T21:00:00.000Z",
    "editable": true
  }
]

Fields

FieldTypeDescription
idstringHistory entry ID
eventIdstringParent event ID
dateTimestringWhen the game was played (ISO 8601)
statusstring"played" or "cancelled"
scoreOnenumber | nullTeam one score
scoreTwonumber | nullTeam two score
teamsSnapshotstringJSON snapshot of team assignments at game time
editableUntilstringDeadline for editing this entry (ISO 8601)
editablebooleanWhether the entry can still be modified

PATCH /api/events/[id]/history/[historyId]

Update a history entry. Only works while editable is true (before editableUntil). Returns 403 if the edit window has closed.

Request body

FieldTypeRequiredDescription
statusstringNo"played" or "cancelled"
scoreOnenumber | nullNoTeam one score (null to clear)
scoreTwonumber | nullNoTeam two score (null to clear)
teamsSnapshotobjectNoUpdated team assignments

Example

curl -X PATCH https://convocados.fly.dev/api/events/EVENT_ID/history/HISTORY_ID \
  -H "Content-Type: application/json" \
  -d '{ "scoreOne": 4, "scoreTwo": 3 }'

Response

Returns the updated history entry in the same format as the GET response.

Error responses

StatusReason
404History entry not found
403Edit window has expired