⚽ Convocados Docs GitHub

Events API

POST /api/events

Create a new event.

Request body

FieldTypeRequiredDescription
titlestringYesGame title (max 100 chars)
dateTimestringYesISO 8601 date, must be in the future
sportstringNoSport preset ID (e.g. "football-5v5", "padel", "basketball"). Defaults to "football-5v5"
locationstringNoLocation text or URL (max 200 chars)
maxPlayersnumberNo2–30, defaults based on sport preset
teamOneNamestringNoDefaults to "Ninjas"
teamTwoNamestringNoDefaults to "Gunas"
isRecurringbooleanNoEnable recurrence
recurrenceFreqstringNo"weekly" or "monthly"
recurrenceIntervalnumberNoRepeat interval (default 1)
recurrenceByDaystringNoDay code: MO, TU, WE, TH, FR, SA, SU

Example

curl -X POST https://convocados.fly.dev/api/events \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Friday Game Night",
    "dateTime": "2026-03-20T19:00:00Z",
    "sport": "basketball",
    "location": "Community Center",
    "maxPlayers": 10
  }'

Response

{ "id": "clx1abc2d..." }

GET /api/events/[id]

Get full event details including players and team results. Also triggers lazy recurrence reset if applicable.

Response

{
  "id": "clx1abc2d...",
  "title": "Friday Game Night",
  "location": "Community Center",
  "sport": "basketball",
  "dateTime": "2026-03-20T19:00:00.000Z",
  "maxPlayers": 10,
  "teamOneName": "Ninjas",
  "teamTwoName": "Gunas",
  "isRecurring": false,
  "nextResetAt": null,
  "wasReset": false,
  "players": [...],
  "teamResults": [...]
}

GET /api/events/[id]/status

Compact event status with player counts and team assignments. Useful for polling.

Response

{
  "id": "clx1abc2d...",
  "title": "Friday Game Night",
  "maxPlayers": 10,
  "players": {
    "active": [{ "id": "...", "name": "Alice" }],
    "bench": [],
    "total": 1,
    "spotsLeft": 9
  },
  "teams": [
    { "name": "Ninjas", "players": ["Alice", "Bob"] },
    { "name": "Gunas", "players": ["Carol", "Dave"] }
  ]
}